WordPress.org

Ready to get started?Download WordPress

Forums

Responsive Select Menu
[resolved] Container css class is replaced instead of added (3 posts)

  1. shortster
    Member
    Posted 11 months ago #

    The 'responsiveSelectContainer' class which is added to the menu div container replaces the standard WordPress class of the container.

    For compatibility, a plugin should not interfere with the WordPress added classes of the menu, it should only use them or add to them, not replace them.

    http://wordpress.org/plugins/responsive-select-menu/

  2. sevenspark
    Member
    Plugin Author

    Posted 10 months ago #

    No, it does not.

    You can see in the code that this is how the class is added

    $args['container_class'].= ' responsiveSelectContainer';

    it is specifically written to append and not to override, for exactly the reasons you stated.

    If your classes are being replaced, they may have been added in a non-standard way. If they were added via parameters in the wp_nav_menu function as per the WordPress standard, there should be no compatibility issue.

  3. sevenspark
    Member
    Plugin Author

    Posted 10 months ago #

    Note that the class that WordPress adds by default is removed automatically by WordPress if the container_class argument is set. That is intended WordPress functionality and isn't something that the plugin is changing - that's just how the core wp_nav_menu code works. In your normal wp_nav_menu() function, simply pass the class that should appear and the RSM class will be appended appropriately.

    Hope that helps,

    Chris

Reply

You must log in to post.

About this Plugin

About this Topic