Store display_sidebar in static variable
This commit is contained in:
@@ -34,6 +34,9 @@ add_filter('body_class', 'roots_sidebar_body_class');
|
||||
* See lib/sidebar.php for more details
|
||||
*/
|
||||
function roots_display_sidebar() {
|
||||
static $display;
|
||||
|
||||
if (!isset($display)) {
|
||||
$sidebar_config = new Roots_Sidebar(
|
||||
/**
|
||||
* Conditional tag checks (http://codex.wordpress.org/Conditional_Tags)
|
||||
@@ -57,8 +60,10 @@ function roots_display_sidebar() {
|
||||
'template-custom.php'
|
||||
)
|
||||
);
|
||||
$display = apply_filters('roots/display_sidebar', $sidebar_config->display);
|
||||
}
|
||||
|
||||
return apply_filters('roots/display_sidebar', $sidebar_config->display);
|
||||
return $display;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user