add_filter( 'nav_menu_link_attributes', function ($atts, $item, $args) {
$menu_items = array(1,2,3);
if (in_array($item->ID, $menu_items)) {
$atts['name'] = 'value';
}
return $atts;
}, 10, 3 );
Created
November 21, 2016 17:31
-
-
Save wassim/a344353a2a27712ae0ce0b0bd089cb94 to your computer and use it in GitHub Desktop.
[WordPress] Add link attributes to nav menu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment