From 7bb79696644ba0b8bc53afc1340e29e5d1241fec Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 15 Sep 2022 12:30:54 +0000 Subject: [PATCH] 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 `
  • ` element, and not a numeric ID. Follow-up to [15407], [25410], [27201], [38559], [51739]. Props dilipbheda, robinwpdeveloper, mukesh27, audrasjb, SergeyBiryukov. See #56574, #55646. git-svn-id: https://develop.svn.wordpress.org/trunk@54178 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-walker-nav-menu.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/class-walker-nav-menu.php b/src/wp-includes/class-walker-nav-menu.php index 36be60f9d6..47b3368141 100644 --- a/src/wp-includes/class-walker-nav-menu.php +++ b/src/wp-includes/class-walker-nav-menu.php @@ -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 `
  • ` 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 `
  • ` 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 ) . '"' : '';