Docs: Clarify documentation for the `nav_menu_item_id` filter.

This aims to make it clear that the filter is applied to an HTML ID attribute for the menu item's `<li>` element, and not a numeric ID.

Follow-up to [15407], [25410], [27201], [38559], [51739].

Props dilipbheda, robinwpdeveloper, mukesh27, audrasjb, SergeyBiryukov.
See #56574, #55646.
Built from https://develop.svn.wordpress.org/trunk@54178


git-svn-id: http://core.svn.wordpress.org/trunk@53737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2022-09-15 12:32:08 +00:00
parent 57b47f0a09
commit 3b0c68d032
2 changed files with 6 additions and 6 deletions

View File

@ -159,15 +159,15 @@ class Walker_Nav_Menu extends Walker {
$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
/**
* Filters the ID applied to a menu item's list item element.
* Filters the ID attribute applied to a menu item's list item element.
*
* @since 3.0.1
* @since 4.1.0 The `$depth` parameter was added.
*
* @param string $menu_id The ID that is applied to the menu item's `<li>` element.
* @param WP_Post $menu_item The current menu item.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @param int $depth Depth of menu item. Used for padding.
* @param string $menu_item_id The ID attribute applied to the menu item's `<li>` element.
* @param WP_Post $menu_item The current menu item.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @param int $depth Depth of menu item. Used for padding.
*/
$id = apply_filters( 'nav_menu_item_id', 'menu-item-' . $menu_item->ID, $menu_item, $args, $depth );
$id = $id ? ' id="' . esc_attr( $id ) . '"' : '';

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-54177';
$wp_version = '6.1-alpha-54178';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.