Ensure that funcitons exist in Roots_Sidebar #993

Closed
wants to merge 1 commit into
from

Projects

None yet

6 participants

@johnReeve

I added a check around the $conditional_tag(); in the sidebar to ensure that the function exists-- I was getting a 500 on a woocommerce theme when running it without the plugin enabled. This enables me to set functions like is_cart that are implemented in plugins and have the theme function without activating the plugins.

@johnReeve johnReeve Ensure that funcitons exist in Roots_Sidebar
I added a check around the $conditional_tag(); in the sidebar to ensure that the function exists-- I was getting a 500 on a woocommerce theme when running it without the plugin enabled.
1c961ba
@Foxaii
Member
Foxaii commented Feb 27, 2014

Thanks for this. For consistency, we'll need a similar check for when the conditionals have arguments.

@kjprince

I'm getting this error over and over in my nginx logs:

[error] 1390#0: *1855 FastCGI sent in stderr: "PHP message: PHP Warning: Missing argument 1 for is_post_type_hierarchical(), called in /srv/www/kj-prince.com/releases/20140416214842/app/content/themes/kj/lib/sidebar.php on line 36 and defined in /srv/www/kj-prince.com/releases/20140416214842/app/wp/wp-includes/post.php on line 1008" while reading upstream

May be related? Anyone seen this before?

@QWp6t
Member
QWp6t commented Apr 17, 2014

I think that would be resolved by specifying is_post_type_hierarchical in an array in config.php.

Untested, but I think this should work.

array('is_post_type_hierarchical', array(get_post_type(get_the_ID())))
@swalkinshaw
Member

@johnReeve are you able to update this with @Foxaii's suggestion? If not, we'll be closing this and doing it ourselves.

@retlehs
Member
retlehs commented Jul 26, 2014

:suspect:

@Foxaii Foxaii added a commit that referenced this pull request Jul 28, 2014
@Foxaii Foxaii Check sidebar conditional tag exists
Return false for non-existent conditional tags. Fixes #993
ce48b6c
@Foxaii Foxaii added a commit that referenced this pull request Jul 31, 2014
@Foxaii Foxaii Check sidebar conditional tag exists
Return false for non-existent conditional tags. Fixes #993
f213cc0
@swalkinshaw swalkinshaw closed this in #1113 Aug 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment