Changeset 28124 for trunk/src/wp-includes/widgets.php
- Timestamp:
- 04/14/2014 10:45:40 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets.php
r27967 r28124 1402 1402 } 1403 1403 1404 // look for "lost" widgets, this has to run at least on each theme change 1405 function retrieve_widgets($theme_changed = false) { 1404 /** 1405 * Look for "lost" widgets, this has to run at least on each theme change. 1406 * 1407 * @since 2.8.0 1408 * 1409 * @param mixed $theme_changed Whether the theme was changed as a boolean. A value 1410 * of 'customize' defers updates for the customizer. 1411 * @return array 1412 */ 1413 function retrieve_widgets( $theme_changed = false ) { 1406 1414 global $wp_registered_sidebars, $sidebars_widgets, $wp_registered_widgets; 1407 1415 … … 1413 1421 // time() that sidebars were stored is in $old_sidebars_widgets['time'] 1414 1422 $_sidebars_widgets = $old_sidebars_widgets['data']; 1415 remove_theme_mod( 'sidebars_widgets' ); 1423 1424 if ( 'customize' === $theme_changed ) { 1425 remove_theme_mod( 'sidebars_widgets' ); 1426 } 1416 1427 1417 1428 foreach ( $_sidebars_widgets as $sidebar => $widgets ) { … … 1496 1507 1497 1508 $sidebars_widgets['wp_inactive_widgets'] = array_merge($lost_widgets, (array) $sidebars_widgets['wp_inactive_widgets']); 1498 wp_set_sidebars_widgets($sidebars_widgets); 1509 if ( 'customize' === $theme_changed ) { 1510 wp_set_sidebars_widgets( $sidebars_widgets ); 1511 } 1499 1512 1500 1513 return $sidebars_widgets;
Note: See TracChangeset
for help on using the changeset viewer.