Make WordPress Core


Ignore:
Timestamp:
09/09/2021 09:39:39 PM (3 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/rest-api/endpoints/class-wp-rest-widgets-controller.php

    r51705 r51791  
    110110     */
    111111    public function get_items( $request ) {
    112         sync_registered_widgets();
     112        retrieve_widgets();
    113113
    114114        $prepared = array();
     
    152152     */
    153153    public function get_item( $request ) {
    154         sync_registered_widgets();
     154        retrieve_widgets();
    155155
    156156        $widget_id  = $request['id'];
     
    238238
    239239        /*
    240          * sync_registered_widgets() contains logic to move "hidden" or "lost" widgets to the
     240         * retrieve_widgets() contains logic to move "hidden" or "lost" widgets to the
    241241         * wp_inactive_widgets sidebar based on the contents of the $sidebars_widgets global.
    242242         *
     
    249249        wp_get_sidebars_widgets();
    250250
    251         sync_registered_widgets();
     251        retrieve_widgets();
    252252
    253253        $widget_id  = $request['id'];
     
    314314
    315315        /*
    316          * sync_registered_widgets() contains logic to move "hidden" or "lost" widgets to the
     316         * retrieve_widgets() contains logic to move "hidden" or "lost" widgets to the
    317317         * wp_inactive_widgets sidebar based on the contents of the $sidebars_widgets global.
    318318         *
     
    325325        wp_get_sidebars_widgets();
    326326
    327         sync_registered_widgets();
     327        retrieve_widgets();
    328328
    329329        $widget_id  = $request['id'];
Note: See TracChangeset for help on using the changeset viewer.