From bb7b7901b96222a1382788c6a13acc11421e8469 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Thu, 6 Sep 2007 23:27:16 +0000 Subject: [PATCH] Properly construct widget classname if second param is an array. Props f00f. fixes #4910 git-svn-id: https://develop.svn.wordpress.org/trunk@6054 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/widgets.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index df75348d6d..0defdf4d33 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -210,7 +210,8 @@ function dynamic_sidebar($index = 1) { $params = array_merge(array($sidebar), (array) $wp_registered_widgets[$id]['params']); // Substitute HTML id and class attributes into before_widget - $params[0]['before_widget'] = sprintf($params[0]['before_widget'], $id, $wp_registered_widgets[$id]['classname']); + $classname_ = ( is_array($wp_registered_widgets[$id]['classname']) ) ? implode('_', $wp_registered_widgets[$id]['classname']) : $wp_registered_widgets[$id]['classname']; + $params[0]['before_widget'] = sprintf($params[0]['before_widget'], $id, $classname_); if ( is_callable($callback) ) { call_user_func_array($callback, $params);