WordPress.org

Make WordPress Core

Ticket #23902: nav-menu-template.php.patch

File nav-menu-template.php.patch, 746 bytes (added by tyxla, 7 years ago)

Merging the CSS classes after the "nav_menu_css_class" filter back to $item->classes

  • src/wp-includes/nav-menu-template.php

     
    9595                 * @param object $item    The current menu item.
    9696                 * @param array  $args    An array of wp_nav_menu() arguments.
    9797                 */
    98                 $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
     98                $classes = apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args );
     99                $item->classes = $classes;
     100
     101                $class_names = join( ' ', $classes );
    99102                $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
    100103
    101104                /**