nav_menu_link_attributes

最后更新于:2021-11-27 08:59:05

apply_filters( ‘nav_menu_link_attributes’, array $atts, GC_Post $item, stdClass $args, int $depth )

Filters the HTML attributes applied to a menu item’s anchor element.

参数

$atts

(array)
The HTML attributes applied to the menu item’s <a> element, empty strings are ignored.

  • ‘title’
    (string) Title attribute.
  • ‘target’
    (string) Target attribute.
  • ‘rel’
    (string) The rel attribute.
  • ‘href’
    (string) The href attribute.
  • ‘aria-current’
    (string) The aria-current attribute.

$item

(GC_Post)
The current menu item.

$args

(stdClass)
An object of gc_nav_menu() arguments.

$depth

(int)
Depth of menu item. Used for padding.

源文件

文件: gc-includes/class-walker-nav-menu.php

View on Trac