rest_delete_nav_menu_item
Fires immediately after a single menu item is deleted via the REST API.
Использование
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(объект)
- Inserted or updated menu item object.
- $response(WP_REST_Response)
- The response data.
- $request(WP_REST_Request)
- Request object.
Список изменений
С версии 5.9.0 | Введена. |
Где вызывается хук
rest_delete_nav_menu_item
wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php 314
do_action( 'rest_delete_nav_menu_item', $menu_item, $response, $request );