Docs: Document the globals used in WP_REST_Widget_Types_Controller and WP_REST_Widgets_Controller.

Follow-up to [50995].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51279 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2021-06-30 12:54:10 +00:00
parent aa99d7e7a3
commit 1fffb4642c
2 changed files with 13 additions and 6 deletions

View File

@ -197,7 +197,8 @@ class WP_REST_Widget_Types_Controller extends WP_REST_Controller {
*
* @since 5.8.0
*
* @global array $wp_registered_widgets The list of registered widgets.
* @global WP_Widget_Factory $wp_widget_factory
* @global array $wp_registered_widgets The list of registered widgets.
*
* @return array Array of widgets.
*/
@ -412,6 +413,8 @@ class WP_REST_Widget_Types_Controller extends WP_REST_Controller {
* - form: The widget's admin form after updating the widget with the
* given form data.
*
* @global WP_Widget_Factory $wp_widget_factory
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/

View File

@ -228,6 +228,8 @@ class WP_REST_Widgets_Controller extends WP_REST_Controller {
*
* @since 5.8.0
*
* @global WP_Widget_Factory $wp_widget_factory
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/
@ -289,14 +291,14 @@ class WP_REST_Widgets_Controller extends WP_REST_Controller {
*
* @since 5.8.0
*
* @global array $wp_registered_widget_updates The registered widget update functions.
* @global WP_Widget_Factory $wp_widget_factory
* @global array $wp_registered_widget_updates The registered widget update functions.
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/
public function delete_item( $request ) {
global $wp_registered_widget_updates, $wp_widget_factory;
global $wp_widget_factory, $wp_registered_widget_updates;
retrieve_widgets();
@ -417,6 +419,9 @@ class WP_REST_Widgets_Controller extends WP_REST_Controller {
*
* @since 5.8.0
*
* @global WP_Widget_Factory $wp_widget_factory
* @global array $wp_registered_widget_updates The registered widget update functions.
*
* @param WP_REST_Request $request Full details about the request.
* @param string $sidebar_id ID of the sidebar the widget belongs to.
*
@ -560,9 +565,8 @@ class WP_REST_Widgets_Controller extends WP_REST_Controller {
*
* @since 5.8.0
*
* @global array $wp_registered_sidebars The registered sidebars.
* @global array $wp_registered_widgets The registered widgets.
* @global array $wp_registered_widget_controls The registered widget controls.
* @global WP_Widget_Factory $wp_widget_factory
* @global array $wp_registered_widgets The registered widgets.
*
* @param array $item An array containing a widget_id and sidebar_id.
* @param WP_REST_Request $request Request object.