wp_nav_menu_item_custom_fields
Fires just before the move buttons of a nav menu item in the menu editor.
Usage
add_action( 'wp_nav_menu_item_custom_fields', 'wp_kama_nav_menu_item_custom_fields_action', 10, 5 );
/**
* Function for `wp_nav_menu_item_custom_fields` action-hook.
*
* @param string $item_id Menu item ID as a numeric string.
* @param WP_Post $menu_item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
* @param stdClass|null $args An object of menu item arguments.
* @param int $current_object_id Nav menu ID.
*
* @return void
*/
function wp_kama_nav_menu_item_custom_fields_action( $item_id, $menu_item, $depth, $args, $current_object_id ){
// action...
}
- $item_id(string)
- Menu item ID as a numeric string.
- $menu_item(WP_Post)
- Menu item data object.
- $depth(int)
- Depth of menu item. Used for padding.
- $args(stdClass|null)
- An object of menu item arguments.
- $current_object_id(int)
- Nav menu ID.
Changelog
| Since 5.4.0 | Introduced. |
Where the hook is called
wp_nav_menu_item_custom_fields
wp-admin/includes/class-walker-nav-menu-edit.php 280
do_action( 'wp_nav_menu_item_custom_fields', $item_id, $menu_item, $depth, $args, $current_object_id );