[wp-trac] [WordPress Trac] #8339: Widget option issue

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 24 21:16:38 GMT 2008


#8339: Widget option issue
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |       Owner:  anonymous
     Type:  defect             |      Status:  new      
 Priority:  normal             |   Milestone:  2.7      
Component:  Administration     |     Version:           
 Severity:  normal             |    Keywords:           
-------------------------------+--------------------------------------------
 I've traced a weird bug on my theme, whose sidebars differ depending on
 the layout.

 Basically, the sidebars_widgets options was getting updated properly but
 was then rendered broken on the next page load.

 I've traced it down to the code in wp_get_sidebars_widgets() and
 wp_set_sidebars_widgets(). The array version gets unset in
 wp_get_sidebars_widgets(), but you forget to re-add it in
 wp_set_sidebars_widgets().

 I've added this fix on my end until you fix the bug:

 {{{
 #
 # fix WP widgets
 #

 function fix_wp_widgets($o)
 {
         if ( !isset($o['array_version']) ) $o['array_version'] = 3;
         return $o;
 }

 add_filter('update_sidebars_widgets', 'fix_wp_widgets');

 }}}

 It would obviously be better to fix the wp_set_sidebars_widgets() instead.

 D.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8339>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list