Make WordPress Core


Ignore:
Timestamp:
09/09/2021 09:39:39 PM (5 years ago)
Author:
hellofromTonya
Message:

Widgets: Revert [51705].

While the new name is much better, it doesn't fully tell what will happen when invoked nor does it fully solve the root problems.

Why? The function is doing too much. And naming is hard.

Props azaozz, desrosj, andraganescu, zieladam, hellofromTonya.
See #53811.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r51705 r51791  
    276276                $this->manager->set_post_value( 'old_sidebars_widgets_data', $this->old_sidebars_widgets ); // Override any value cached in changeset.
    277277
    278                 // sync_registered_widgets() looks at the global $sidebars_widgets.
     278                // retrieve_widgets() looks at the global $sidebars_widgets.
    279279                $sidebars_widgets = $this->old_sidebars_widgets;
    280                 $sidebars_widgets = sync_registered_widgets( 'customize' );
     280                $sidebars_widgets = retrieve_widgets( 'customize' );
    281281                add_filter( 'option_sidebars_widgets', array( $this, 'filter_option_sidebars_widgets_for_theme_switch' ), 1 );
    282282                // Reset global cache var used by wp_get_sidebars_widgets().
     
    288288         *
    289289         * When switching themes, filter the Customizer setting old_sidebars_widgets_data
    290          * to supply initial $sidebars_widgets before they were overridden by sync_registered_widgets().
     290         * to supply initial $sidebars_widgets before they were overridden by retrieve_widgets().
    291291         * The value for old_sidebars_widgets_data gets set in the old theme's sidebars_widgets
    292292         * theme_mod.
     
    306306         * Filters sidebars_widgets option for theme switch.
    307307         *
    308          * When switching themes, the sync_registered_widgets() function is run when the Customizer initializes,
     308         * When switching themes, the retrieve_widgets() function is run when the Customizer initializes,
    309309         * and then the new sidebars_widgets here get supplied as the default value for the sidebars_widgets
    310310         * option.
Note: See TracChangeset for help on using the changeset viewer.