[wp-trac] Re: [WordPress Trac] #8441: New Widget API based on MultiWidget Class

WordPress Trac wp-trac at lists.automattic.com
Fri May 15 01:11:05 GMT 2009


#8441: New Widget API based on MultiWidget Class
------------------------------------------+---------------------------------
 Reporter:  thornomad                     |        Owner:  azaozz
     Type:  defect (bug)                  |       Status:  closed
 Priority:  low                           |    Milestone:  2.8   
Component:  Widgets                       |      Version:  2.8   
 Severity:  minor                         |   Resolution:  fixed 
 Keywords:  widget, plugin, multi-widget  |  
------------------------------------------+---------------------------------
Changes (by junsuijin):

  * priority:  high => low
  * type:  task (blessed) => defect (bug)
  * severity:  normal => minor


Comment:

 I really like the new widgets administration. I've remade all my widgets
 with the new API (fairly trivial since I was already utilizing the
 MultiWidget Class), and I've recently come across one bit of strange
 behavior while using the nightly build:

 When attempting to display widgets via returning the cached contents in
 the way that the default recent posts widget does, my 3rd sidebar (always
 the 3rd registered, no matter which is registered 3rd, but possibly other
 sidebars also) will only display additional instances (past the first
 instance in the sidebar) of any given widget. That is to say, I would have
 to place 2 recent posts widgets in my 3rd sidebar to get just 1 to output.

 In order to counter the problem, I've changed my own widgets that use
 similar caching methods, so that this bit of code:

 {{{
 if (isset($cache[$args['widget_id']]))
    return $cache[$args['widget_id']];
 }}}

 reads instead as such:

 {{{
 if (isset($cache[$args['widget_id']]))
    echo substr($cache[$args['widget_id']][1], 1);
 }}}

 Is this a bug that could/should be easily fixed before the official 2.8
 release?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/8441#comment:55>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list