Action hook 'rest_save_sidebar'

in WP Core File wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php at line 256

View Source

rest_save_sidebar

Action Hook
Description
Fires after a sidebar is updated via the REST API.

Hook Information

File Location wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php View on GitHub
Hook Type Action
Line Number 256

Hook Parameters

Type Name Description
array $sidebar The updated sidebar.
WP_REST_Request $request Request object.

Usage Examples

Basic Usage
<?php
// Hook into rest_save_sidebar
add_action('rest_save_sidebar', 'my_custom_function', 10, 2);

function my_custom_function($sidebar, $request) {
    // Your custom code here
}

Source Code Context

wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php:256 - How this hook is used in WordPress core
<?php
 251  		 * @since 5.8.0
 252  		 *
 253  		 * @param array           $sidebar The updated sidebar.
 254  		 * @param WP_REST_Request $request Request object.
 255  		 */
 256  		do_action( 'rest_save_sidebar', $sidebar, $request );
 257  
 258  		return $this->prepare_item_for_response( $sidebar, $request );
 259  	}
 260  
 261  	/**

PHP Documentation

<?php
/**
		 * Fires after a sidebar is updated via the REST API.
		 *
		 * @since 5.8.0
		 *
		 * @param array           $sidebar The updated sidebar.
		 * @param WP_REST_Request $request Request object.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php
Related Hooks

Related hooks will be displayed here in future updates.