Skip to content

Commit

Permalink
Remove ConditonalTagCheck class
Browse files Browse the repository at this point in the history
  • Loading branch information
QWp6t committed Jul 9, 2015
1 parent 71c2e78 commit d5b14ac
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 65 deletions.
1 change: 0 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
'lib/utils.php', // Utility functions
'lib/init.php', // Initial theme setup and constants
'lib/wrapper.php', // Theme wrapper class
'lib/conditional-tag-check.php', // ConditionalTagCheck class
'lib/config.php', // Configuration
'lib/assets.php', // Scripts and stylesheets
'lib/titles.php', // Page titles
Expand Down
43 changes: 0 additions & 43 deletions lib/conditional-tag-check.php

This file was deleted.

37 changes: 16 additions & 21 deletions lib/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Roots\Sage\Config;

use Roots\Sage\ConditionalTagCheck;
use Roots\Sage\Utils;

/**
* Enable theme features
Expand Down Expand Up @@ -32,34 +32,29 @@
*/
function display_sidebar() {
static $display;

if (!isset($display)) {
$conditionalCheck = new ConditionalTagCheck(
$display = !in_array(true, [
/**
* 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.
* You can also specify your own callbacks as long as they each return a boolean.
*
* 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_single()
* is_archive()
* is_page('about-me')
* is_tax(['flavor', 'mild'])
* is_page_template('about.php')
* is_post_type_archive(['foo', 'bar', 'baz'])
* \MyNamespace\MyClass::MyMethod(['my', 'args'])
*
*/
[
'is_404',
'is_front_page',
['is_page_template', 'template-custom.php']
]
);

$display = apply_filters('sage/display_sidebar', $conditionalCheck->result);
is_404(),
is_front_page(),
is_page_template('template-custom.php'),
]);
}

return $display;
return apply_filters('sage/display_sidebar', $display);
}

0 comments on commit d5b14ac

Please sign in to comment.