[wp-trac] [WordPress Trac] #12342: New widget option after calling register_widget creating empty widget

WordPress Trac wp-trac at lists.automattic.com
Sat May 1 00:01:44 UTC 2010


#12342: New widget option after calling register_widget creating empty widget
--------------------------+-------------------------------------------------
 Reporter:  jimisaacs     |       Owner:  azaozz              
     Type:  defect (bug)  |      Status:  new                 
 Priority:  normal        |   Milestone:  3.1                 
Component:  Widgets       |     Version:  2.9.2               
 Severity:  normal        |    Keywords:  widgets dev-feedback
--------------------------+-------------------------------------------------
Changes (by azaozz):

  * milestone:  3.0 => 3.1


Comment:

 This seems to be caused by the (tons of) back-compat code in the API. It
 would be best fixed when we remove most of that code hopefully in 3.1.

 However you shouldn't be working directly with the widget option in your
 plugin. Best is to use the API, it has a lot of hooks everywhere to make
 that easy. When a user creates and deletes instances of the same widget
 several times, that number will always increment so the widget option
 would look something like `5 => array(options...), 9 => array(options...),
 15 => array(options...)` etc. and some of these instances could be in the
 inactive widgets area too.

 If you really need to access the widget option directly you'll need to
 check the `sidebars_widgets` too to determine which are active.

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


More information about the wp-trac mailing list