rest_after_insert_nav_menu_item

rest_after_insert_nav_menu_item

Hook Type: action

See hook in core

Displaying hooks found in version: wordpress-6.7.1

do_action('rest_after_insert_nav_menu_item') is found 2 times:

  • /wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php line 181
    		 * @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_after_insert_nav_menu_item', $nav_menu_item, $request, true );
    
    		$post = get_post( $nav_menu_item_id );
    		wp_after_insert_post( $post, false, null );
    
    		$response = $this->prepare_item_for_response( $post, $request );
    		$response = rest_ensure_response( $response );
    
  • /wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php line 260
     
    		$request->set_param( 'context', 'edit' );
    
    		/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php */
    		do_action( 'rest_after_insert_nav_menu_item', $nav_menu_item, $request, false );
    
    		wp_after_insert_post( $post, true, $post_before );
    
    		$response = $this->prepare_item_for_response( get_post( $nav_menu_item_id ), $request );
    
    		return rest_ensure_response( $response );