rest_save_sidebar action-hookWP 5.8.0

Fires after a sidebar is updated via the REST API.

Usage

add_action( 'rest_save_sidebar', 'wp_kama_rest_save_sidebar_action', 10, 2 );

/**
 * Function for `rest_save_sidebar` action-hook.
 * 
 * @param array           $sidebar The updated sidebar.
 * @param WP_REST_Request $request Request object.
 *
 * @return void
 */
function wp_kama_rest_save_sidebar_action( $sidebar, $request ){

	// action...
}
$sidebar(array)
The updated sidebar.
$request(WP_REST_Request)
Request object.

Changelog

Since 5.8.0 Introduced.

Where the hook is called

WP_REST_Sidebars_Controller::update_item()
rest_save_sidebar
wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php 251
do_action( 'rest_save_sidebar', $sidebar, $request );

Where the hook is used in WordPress

wp-includes/default-filters.php 276
add_action( $action, '_delete_option_fresh_site', 0 );