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
This commit is contained in:
markjaquith 2007-09-06 23:27:16 +00:00
parent eb2d6cea06
commit 1ba81b4f02
1 changed files with 2 additions and 1 deletions

View File

@ -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);