Make WordPress Core

Ticket #4910: 4910.003.diff

File 4910.003.diff, 933 bytes (added by markjaquith, 19 years ago)
  • wp-includes/widgets.php

     
    210210                $params = array_merge(array($sidebar), (array) $wp_registered_widgets[$id]['params']);
    211211
    212212                // Substitute HTML id and class attributes into before_widget
    213                 $classname_ = ( is_array($wp_registered_widgets[$id]['classname']) ) ? implode('_', $wp_registered_widgets[$id]['classname']) : $wp_registered_widgets[$id]['classname'];
     213                $classname_ = '';
     214                foreach ( (array) $wp_registered_widgets[$id]['classname'] as $cn ) {
     215                        if ( is_string($cn) )
     216                                $classname_ .= '_' . $cn;
     217                        elseif ( is_object($cn) )
     218                                $classname_ .= '_' . get_class($cn);
     219                }
     220                $classname_ = ltrim($classname_, '_');
    214221                $params[0]['before_widget'] = sprintf($params[0]['before_widget'], $id, $classname_);
    215222
    216223                if ( is_callable($callback) ) {