Closed fabianwurk closed 2 years ago
And just to add, I have enabled the target within the array:
297 => {#14281 ▼
+"active": false
+"activeAncestor": false
+"activeParent": false
+"classes": false
+"dbId": 297
+"description": false
+"id": 297
+"label": "Test"
+"objectId": "297"
+"parent": false
+"slug": "test"
+"target": "_blank"
I've also tried using a filter but it doesn't seem to have any effect on it:
add_filter( 'nav_menu_link_attributes', function ( $atts, $item, $args ) {
if ( 297 === $item->ID ) {
$atts['target'] = '_BLANK';
}
return $atts;
}, 10, 3 );
wouldn't you just do:
<a href="..." target="{{ $item->target }}">...</a>
Is there a way for Navi to include 'target' attribute to menu links? I need just one item to go to target _BLANK.