rest_delete_nav_menu_item action-hookWP 5.9.0

Fires immediately after a single menu item is deleted via the REST API.

Usage

add_action( 'rest_delete_nav_menu_item', 'wp_kama_rest_delete_nav_menu_item_action', 10, 3 );

/**
 * Function for `rest_delete_nav_menu_item` action-hook.
 * 
 * @param object           $nav_menu_item Inserted or updated menu item object.
 * @param WP_REST_Response $response      The response data.
 * @param WP_REST_Request  $request       Request object.
 *
 * @return void
 */
function wp_kama_rest_delete_nav_menu_item_action( $nav_menu_item, $response, $request ){

	// action...
}
$nav_menu_item(object)
Inserted or updated menu item object.
$response(WP_REST_Response)
The response data.
$request(WP_REST_Request)
Request object.

Changelog

Since 5.9.0 Introduced.

Where the hook is called

WP_REST_Menu_Items_Controller::delete_item()
rest_delete_nav_menu_item
wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php 316
do_action( 'rest_delete_nav_menu_item', $menu_item, $response, $request );

Where the hook is used in WordPress

Usage not found.