~canonical-sysadmins/wordpress/4.9

« back to all changes in this revision

Viewing changes to wp-includes/class-walker-nav-menu.php

  • Committer: Barry Price
  • Date: 2017-06-09 02:09:58 UTC
  • mfrom: (1.1.26 upstream)
  • Revision ID: barry.price@canonical.com-20170609020958-838whhwt2196f2vk
Merge WP4.8 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
                        $n = "\n";
59
59
                }
60
60
                $indent = str_repeat( $t, $depth );
61
 
                $output .= "{$n}{$indent}<ul class=\"sub-menu\">{$n}";
 
61
 
 
62
                // Default class.
 
63
                $classes = array( 'sub-menu' );
 
64
 
 
65
                /**
 
66
                 * Filters the CSS class(es) applied to a menu list element.
 
67
                 *
 
68
                 * @since 4.8.0
 
69
                 *
 
70
                 * @param array    $classes The CSS classes that are applied to the menu `<ul>` element.
 
71
                 * @param stdClass $args    An object of `wp_nav_menu()` arguments.
 
72
                 * @param int      $depth   Depth of menu item. Used for padding.
 
73
                 */
 
74
                $class_names = join( ' ', apply_filters( 'nav_menu_submenu_css_class', $classes, $args, $depth ) );
 
75
                $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
 
76
 
 
77
                $output .= "{$n}{$indent}<ul $class_names>{$n}";
62
78
        }
63
79
 
64
80
        /**