Make WordPress Core

Ticket #33447: 33447.2.diff

File 33447.2.diff, 1.2 KB (added by paulwilde, 9 years ago)
  • wp-includes/nav-menu-template.php

    diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php
    index 7a61031..5ce1e51 100644
    a b class Walker_Nav_Menu extends Walker { 
    148148                        }
    149149                }
    150150
     151                /** This filter is documented in wp-includes/post-template.php */
     152                $title = apply_filters( 'the_title', $item->title, $item->ID );
     153
     154                /**
     155                 * Filter a menu item's title.
     156                 *
     157                 * @since 4.4.0
     158                 *
     159                 * @param string $title The menu item's title.
     160                 * @param object $item  The current menu item.
     161                 * @param array  $args  An array of {@see wp_nav_menu()} arguments.
     162                 * @param int    $depth Depth of menu item. Used for padding.
     163                 */
     164                $title = apply_filters( 'nav_menu_item_title', $title, $item, $args, $depth );
     165
    151166                $item_output = $args->before;
    152167                $item_output .= '<a'. $attributes .'>';
    153                 /** This filter is documented in wp-includes/post-template.php */
    154                 $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
     168                $item_output .= $args->link_before . $title . $args->link_after;
    155169                $item_output .= '</a>';
    156170                $item_output .= $args->after;
    157171