Skip to content

Releases: davidwebca/wordpress-menu-classes

2.0.1

12 Mar 22:22
Compare
Choose a tag to compare

What changed

Using li_atts, a_atts, submenu_atts would lead to have the admin-provided classes to be overridden. After giving it some thought, I've decided that this was unwanted behaviour and now added some code to fix the issue and combine the classes so that the behaviour of _class and _atts are the same.

Future change?

That being said, I've now started considering to have an attribute like "li_atts_override" => true which would make sure attributes are completely overridden at the end of the process (a same thing could be easily added to classes like "li_class_override" => true. If that's of any interest to y'all, let me know by reacting 🚀 to this release.

(Very light) warning ⚠️

There is technically no breaking change in this release, but be aware that if a mega-menu plugin was watching or looking for ".menu-item" classes and was not kicking in before, it could now be kicking in. That would be a major issue for that mega-menu plugin to even do that out of the blue, but just wanted to write it down here as a warning... just in case!

2.0.0

31 Aug 17:11
Compare
Choose a tag to compare

This release introduces breaking changes and updates regarding custom attributes on any elements.

New

  • Any html attribute can now be added to any elements, including submenus (previously lacking because of WordPress core, fixed in (this trac ticket)[https://core.trac.wordpress.org/ticket/57140] thanks to my contribution to core).
  • Now supports arrays in all of our classes attributes and can now be declared like this :
 wp_nav_menu([
    'theme_location' => 'primary_navigation',
    'a_class' => ['text-white', 'bg-blue-500'],
    'li_atts' => [
        'class' => ['focus:ring-2', 'ring-orange-500']
    ]
    // ...
]);

Please note that this is not native WordPress behavior and that it is only provided by this package as a convenience.

Breaking

  • link_atts has been removed for consistency and a_atts should be used instead.