How to get the custom menu item css class with wp nav menu walker
-
Hi,
I’m trying to make a custom WP menu based on default walker function (wp-includes/nav-menu-template.php).
I want to add the custom menu item class ( CSS Classes (optional) ) to <i> element. Right now I can call out all classes including the custom one.
$item_output = $args->before; $item_output .= '<a'. $attributes .'>'; $item_output .= '<i aria-hidden="true" '. $class_names .'></i>'; $item_output .= '<span>'; $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; $item_output .= '<span>'; $item_output .= '</a>'; $item_output .= $args->after;
Is there a way to get the custom class?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to get the custom menu item css class with wp nav menu walker’ is closed to new replies.