if ( is_callable( $callback ) ) { ob_start();
call_user_func_array( $callback,
$params );
ob_end_clean();
} $_POST =
$original_post;
$_REQUEST =
$original_request;
if ( $widget_object ) { // Register any multi-widget that the update callback just created.
$widget_object->
_set( $number );
$widget_object->
_register_one( $number );
/*
* WP_Widget sets `updated = true` after an update to prevent more than one widget
* from being saved per request. This isn't what we want in the REST API, though,
* as we support batch requests.
*/
$widget_object->updated = false;
} /**
* Fires after a widget is created or updated via the REST API.
*
* @since 5.8.0
*
* @param string $id ID of the widget being saved.
* @param string $sidebar_id ID of the sidebar containing the widget being saved.
* @param WP_REST_Request $request Request object.
* @param bool $creating True when creating a widget, false when updating.
*/