wp_get_sidebars_widgets();
$this->
retrieve_widgets();
$widget_id =
$request['id'
];
$sidebar_id =
wp_find_widgets_sidebar( $widget_id );
// Allow sidebar to be unset or missing when widget is not a WP_Widget.
$parsed_id =
wp_parse_widget_id( $widget_id );
$widget_object =
$wp_widget_factory->
get_widget_object( $parsed_id['id_base'
] );
if ( is_null( $sidebar_id ) &&
$widget_object ) { return new WP_Error( 'rest_widget_not_found',
__( 'No widget was found with that id.'
),
array
( 'status' => 404
) );
} if ( $request->
has_param( 'instance'
) ||