nav_menu_link_attributes

nav_menu_link_attributes

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('nav_menu_link_attributes') is found 1 times:

  • /wp-includes/class-walker-nav-menu.php line 280
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    * @param WP_Post  $menu_item The current menu item object.
     * @param stdClass $args      An object of wp_nav_menu() arguments.
     * @param int      $depth     Depth of menu item. Used for padding.
     */
    $atts       = apply_filters( 'nav_menu_link_attributes', $atts, $menu_item, $args, $depth );
    $attributes = $this->build_atts( $atts );
     
    $item_output  = $args->before;
    $item_output .= '<a' . $attributes . '>';
    $item_output .= $args->link_before . $title . $args->link_after;
    $item_output .= '</a>';

See this hook used in plugins: