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.
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.
Thanks for this. For consistency, we'll need a similar check for when the conditionals have arguments.
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?
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.
@johnReeve are you able to update this with @Foxaii's suggestion? If not, we'll be closing this and doing it ourselves.
Check sidebar conditional tag exists
Return false for non-existent conditional tags. Fixes #993