WordPress开发者和主题制作者的搜索引擎



nav_menu_css_class ›

Since4.1.0
已弃用n/a
apply_filters( 'nav_menu_css_class', array_filter( $classes )
参数: (4)
  • (string[]) $classes Array of the CSS classes that are applied to the menu item's `<li>` element.
    Required: Yes
  • (WP_Post) $item The current menu item.
    Required: Yes
  • (stdClass) $args An object of wp_nav_menu() arguments.
    Required: Yes
  • (int) $depth Depth of menu item. Used for padding.
    Required: Yes
定义在:
文档:

Filters the CSS classes applied to a menu item's list item element.





源码

$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ) );