Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#8339 closed defect (bug) (fixed)

Widget option issue

Reported by: Denis-de-Bernardy Owned by:
Milestone: 2.7 Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: Cc:


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.


Change History (1)

#1 @ryan
9 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [9888]) Make sure widgets array version is set. fixes #8339

Note: See TracTickets for help on using tickets.