do_action( 'rest_insert_nav_menu_item', object $nav_menu_item, WP_REST_Request $request, bool $creating )
- Since
- 5.9.0
Fires after a single menu item is created or updated via the REST API.
Parameters
$requestWP_REST_Request- Request object.
$creatingbool- True when creating a menu item, false when updating.
Fired at · 2
wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php:166WP_REST_Menu_Items_Controller::create_item()wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php:252WP_REST_Menu_Items_Controller::update_item()
Source
* @since 5.9.0 * * @param object $nav_menu_item Inserted or updated menu item object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a menu item, false when updating. */ do_action( 'rest_insert_nav_menu_item', $nav_menu_item, $request, true ); $schema = $this->get_item_schema(); if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $nav_menu_item_id );History
Introduced in 5.9.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.