Menu Block: Output target attribute

When creating a menu in WordPress, you can set per menu item whether you would like it to be opened in another tab/window. I have created a WordPress menu and configured one item to be opened in a new tab/window.

Unfortunately I seems that you are not yet outputting a link’s target attribute in the menu block.
Looking at the source code I could not find anything about this in core/includes/dynamic/cc-menu.php.

Can you please add this feature?
Or at least provide some information about a workaround?

Thanks in advance!
Stefan

Interesting.
Wasn’t aware of that yet.
Definitely needed :+1:

What about other WP menu options, like CSS classes, etc.?

Hello @stefan,

I’m sorry for not reacting earlier to this post.
Most of the menu additions are now available in 1.2.5.2.

As for classes, I’m still hesitant on whether we should include them as well since there are quite a few default ones. Maybe a toggle in the menu block?

Thanks for the request @stefan

Hey @Louis.

target="_blank" is not working as intended in my testings.
When removing the click event from the menu’s block li, it does.

It only seems to affect the vertical layout.

1 Like

Hi @Marius,

Indeed, thanks for noticing that one.
Seems that the browser is considering it to be a popup because of our scripting the click.

Will have a fix in the next update.

1 Like

Hi. Just checking out. Was it fixed? This request can be marked as completed if it’s fixed.

That has been fixed the same day.

The reason why it hasn’t been marked as done yet is probably:

Do you have an opinion here @dranzer?
I would rather say no in terms of the backend menu options, something like a toggle wouldn’t hurt though.
Let’s see what the upcoming nav block will offer.
Creating and managing menu items and entire menus inside the editor would be amazing.

Up until now, I’ve only utilized the WP menu class field for icons. But that can also be achieved through relative styling, or maybe the new block will offer us a dedicated icon inserter for each menu item.