Make WordPress Core

Changeset 6098


Ignore:
Timestamp:
09/12/2007 08:48:21 PM (17 years ago)
Author:
markjaquith
Message:

Set widget classname when passed string, object/method, object-reference/method. fixes #4910

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/widgets.php

    r6054 r6098  
    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
Note: See TracChangeset for help on using the changeset viewer.