[wp-trac] Re: [WordPress Trac] #4910: Widgets might get "Array" as CSS class instead of classname

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 11 19:40:41 GMT 2007


#4910: Widgets might get "Array" as CSS class instead of classname
-----------------------------------------+----------------------------------
 Reporter:  f00f                         |        Owner:  anonymous
     Type:  defect                       |       Status:  reopened 
 Priority:  high                         |    Milestone:  2.3      
Component:  General                      |      Version:  2.3      
 Severity:  minor                        |   Resolution:           
 Keywords:  widgets css class has-patch  |  
-----------------------------------------+----------------------------------
Changes (by mattyrob):

  * status:  closed => reopened
  * resolution:  fixed =>

Comment:

 This changeset has broken my widget called from within a class as follows:

 {{{
 register_sidebar_widget('Subscribe2Widget', array(&$this,
 'widget_subscribe2widget'));
 }}}


 With the following error:

 '''Catchable fatal error: Object of class s2class could not be converted
 to string in /Users/Matthew/Sites/trunk/wp-includes/widgets.php on line
 213'''

 A fix appears to be as follows:

 {{{
 $classname_ = ( is_array($wp_registered_widgets[$id]['classname']) ) ?
 $wp_registered_widgets[$id]['classname'][1] :
 $wp_registered_widgets[$id]['classname'];
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4910#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list