Remove ConditonalTagCheck class

This commit is contained in:
QWp6t
2015-08-11 18:46:58 -07:00
parent 12fe047368
commit 6d05c67f44
4 changed files with 10 additions and 73 deletions

View File

@@ -28,38 +28,18 @@ if (!defined('DIST_DIR')) {
}
/**
* Define which pages shouldn't have the sidebar
* Determine which pages should NOT display the sidebar
*/
function display_sidebar() {
static $display;
if (!isset($display)) {
$conditionalCheck = new ConditionalTagCheck(
/**
* Any of these conditional tags that return true won't show the sidebar.
* You can also specify your own custom function as long as it returns a boolean.
*
* To use a function that accepts arguments, use an array instead of just the function name as a string.
*
* Examples:
*
* 'is_single'
* 'is_archive'
* ['is_page', 'about-me']
* ['is_tax', ['flavor', 'mild']]
* ['is_page_template', 'about.php']
* ['is_post_type_archive', ['foo', 'bar', 'baz']]
*
*/
[
'is_404',
'is_front_page',
['is_page_template', 'template-custom.php']
]
);
isset($display) || $display = !in_array(true, [
// The sidebar will NOT be displayed if ANY of the following return true.
// @link https://codex.wordpress.org/Conditional_Tags
is_404(),
is_front_page(),
is_page_template('template-custom.php'),
]);
$display = apply_filters('sage/display_sidebar', $conditionalCheck->result);
}
return $display;
return apply_filters('sage/display_sidebar', $display);
}