I need to add line breaks to the nav menu item titles. I didn't realize this was a problem as when I am logged in as a Super Admin, I can add <br/>
just fine, but apparently regular-level admins cannot.
I've read over this post Custom Menus Description Stripping HTML Tags
but I'm fairly convinced the tags are being stripped on on save/update, so I am not immediately seeing how a Custom Walker is the solution, but my brain is pretty well shot today, so it might be obvious.
There also doesn't seem to be any sanitation happening in wp_save_nav_menu_items()
or wp_update_nav_menu_item()
.
<br/>
tag... In any case menu items are post types, so I think the sanitisation is insanitize_post_field()
(specificallytitle_save_pre
- see source). Unfortunately there's no way to circumvent that for just menu titles - so your posted solution is probably the best.