Add shared $post variable to Blade

This commit is contained in:
QWp6t
2017-01-09 19:32:16 -08:00
parent d1e4a07906
commit 69a292a5b3

View File

@@ -89,6 +89,14 @@ add_action('widgets_init', function () {
] + $config);
});
/**
* Updates the `$post` variable on each iteration of the loop.
* Note: updated value is only available for subsequently loaded views, such as partials
*/
add_action('the_post', function ($post) {
sage('blade')->share('post', $post);
});
/**
* Setup Sage options
*/