Make WordPress Core


Ignore:
Timestamp:
08/31/2021 07:57:20 PM (3 years ago)
Author:
hellofromTonya
Message:

Widgets: Rename and soft deprecate retrieve_widgets().

The original name retrieve_widgets() was unclear as it suggested it was a getter, i.e. getting the widgets. This function does more than get: finds orphaned widgets, assigns them to the inactive sidebar, and updates the database.

The new name is sync_registered_widgets() which better represents what happens when this function is invoked.

The original retrieve_widgets() function is soft deprecated to avoid unnecessary code churn downstream for developers that support more than the latest version of WordPress.

Follow-up to [18630].

Props zieladam, timothyblynjacobs, andraganescu, hellofromTonya.
See #53811.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php

    r51408 r51705  
    9999     */
    100100    public function get_items( $request ) {
    101         retrieve_widgets();
     101        sync_registered_widgets();
    102102
    103103        $data = array();
     
    138138     */
    139139    public function get_item( $request ) {
    140         retrieve_widgets();
     140        sync_registered_widgets();
    141141
    142142        $sidebar = $this->get_sidebar( $request['id'] );
Note: See TracChangeset for help on using the changeset viewer.