From a27b194fe66d29aeebf9ddea7f37abfa58aa4c23 Mon Sep 17 00:00:00 2001 From: Scott Walkinshaw Date: Wed, 3 Oct 2012 14:53:30 -0400 Subject: [PATCH] Allow the sidebar config functions to accepts args --- lib/config.php | 6 ++++++ lib/sidebar.php | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/config.php b/lib/config.php index 8e8640d..e5c1870 100644 --- a/lib/config.php +++ b/lib/config.php @@ -20,6 +20,12 @@ function roots_display_sidebar() { /** * Conditional tag checks (http://codex.wordpress.org/Conditional_Tags) * Any of these conditional tags that return true won't show the sidebar + * + * To use a function that requires parameters, use the following format: + * + * array('function_name', array('arg1', 'arg2')) + * + * The second element must be an array even if there's only 1 argument. */ array( 'is_404', diff --git a/lib/sidebar.php b/lib/sidebar.php index 26c4e00..3d783ee 100644 --- a/lib/sidebar.php +++ b/lib/sidebar.php @@ -29,7 +29,11 @@ class Roots_Sidebar { } private function check_conditional_tag($conditional_tag) { - return $conditional_tag(); + if (is_array($conditional_tag)) { + return call_user_func_array($conditional_tag[0], $conditional_tag[1]); + } else { + return $conditional_tag(); + } } private function check_page_template($page_template) {