wp-bootstrap / wp-bootstrap-navwalker

A custom WordPress nav walker class to fully implement the Twitter Bootstrap 4.0+ navigation style (v3-branch available for Bootstrap 3) in a custom theme using the WordPress built in menu manager.
https://wp-bootstrap.github.io/wp-bootstrap-navwalker/
GNU General Public License v3.0
3.37k stars 1.94k forks source link

Swap to using class input instead of title for adding icons or link modifiers #287

Closed pattonwebz closed 6 years ago

pattonwebz commented 7 years ago

In the WP Menu Editor the input for title is what is used to add icons and link modifiers to nav items. Special classes (such as icons or divers) that were added also output as title attribute for the nav items. This results in the classes being showing over the link on hover as well as being the incorrect usage of the title attribute.

Instead of using title input for this there is a classes input that is the intended place to add classes to individual nav items. In the v4 branch I made a swap to using classes there. I wanted to also correct this in the master branch for BS3 but since it is somewhat of a breaking change I am hesitant to do so.

Steps to reproduce the issue:

pattonwebz commented 7 years ago

I have partially created a patch for this however I am struggling to make dividers and item headers fit into the new method. I do not know how many people use those features (personally I have not used them for a long time) so am hesitant to push any updates that does not include them.

szepeviktor commented 7 years ago

As it is about only glyphicons and f.a. we could emty out the title attribute when those are found. @pattonwebz What do you think?

pattonwebz commented 7 years ago

Emptying the title for icons is one method to go down but I would prefer to swap to using the class input field for this as the Title field is often used for accessibility reasons. In the V4 branch I have already made this swap but it's not working with headers and dividers properly :confused:

pattonwebz commented 6 years ago

I put the latest v4 version as the master branch today. It has improved handling of the special link classes. Closing this as it's unlikely to be fixed for the v3 branch of the walker.