wp_nav_menu_item_custom_fields хук-событиеWP 5.4.0

Fires just before the move buttons of a nav menu item in the menu editor.

Использование

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(строка)
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.

Список изменений

С версии 5.4.0 Введена.

Где вызывается хук

Walker_Nav_Menu_Edit::start_el()
wp_nav_menu_item_custom_fields
wp-admin/includes/class-walker-nav-menu-edit.php 253
do_action( 'wp_nav_menu_item_custom_fields', $item_id, $menu_item, $depth, $args, $current_object_id );

Где используется хук в WordPress

Использование не найдено.