From 1ba81b4f02694fb5f633f50904fb4a3fba058983 Mon Sep 17 00:00:00 2001 From: markjaquith 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: http://svn.automattic.com/wordpress/trunk@6054 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 df75348d6..0defdf4d3 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);