CSS change for form button in Membership plugin


My form button in the Membership plugin looks a bit weird compared to how it should actually look in my theme.

As you see here:

The button is with rounded corners, my theme is all squared corners, this type of button does not exist. I tried deleting the entire button.css file in the membership/css folder, but it still doesn't correct itself after my theme css.

If I copy the code: <p><input type="submit" value="Register My Account »" class="alignright button blue" name="register"></p>

That is used in the Membership plugin, into a page from my theme, I get the correct look for the button like this:

The membership plugin somehow adds these rounded borders that messes up the layout of the button.

How do I stop this? :slight_smile:

  • Tom

    For other people's benefit - this is how to do it.

    function remove_membership_css() {
    	// Remove plugin styles
    add_action('wp_head', 'remove_membership_css', 99999);

    For some incredibly bizarre reason WPMU have hooked their scripts to the wp_head action instead of wp_enqueue_scripts as they should have, which means that a wp_dequeue_style hooked onto wp_print_scripts doesn't work.

    As a feature note and why I'm marking this as not resolved, the button CSS for Membership is extremely generic, so the buttons.css file defines styles for the .button class and colour classes like .blue, meaning it will affect pretty much any theme across the board. WPMU should look at fixing the namespacing of their CSS, and fixing the enqueue so it's easier to remove these styles.

  • Vinod Dalvi

    Hi @Tom,

    Thank you for your quality reply and sharing the solution in the community.

    I hope this will help others in the community searching for similar solution.

    I can confirm the classes in the buttons.css file of Membership plugin is too generic like .orange, .red, .blue etc. and sometime can affect other elements of the site so i have notified the plugin developer to make it more specific.

    I have also notified the developer to get his invaluable reply regarding to know why wp_head hook is used instead of wp_enqueue_scripts to enqueue stylesheets in the Membership plugin.

    Thank you for being a WPMU DEV member and have a great day!

    Vinod Dalvi

  • Rheinard

    Hi everyone,

    Thanks for the feedback and help here.

    You could also override the styles by adding !important at the end of each rule you want to use to override the default styles. This is usually a last resort.

    Hooking wp_head was something that was introduced a few versions ago by another developer. I will examine the code here to see why this was done this way.

    That said, I will alter the code here to make it more generic and push it out in the next update.


  • Tom

    Thanks for your reply @Rheinard.

    Having to add !important to every declaration in the theme classes would be extremely bad practice, and a plugin shouldn't necessitate that. Broadly I think the styles in the membership plugin are too prescriptive, and should just set the layout not things like colour, gradients or large glows. Regardless, it would be very important to make these styles scoped within a class that is unique to the plugin.

    Hopefully you can fix up that wp_head issue too!


  • Vinod Dalvi

    Hi Tom,

    Yes i agree with you that using !important to every declaration in the theme classes would be extremely bad practice and this not a end solution at all but only the temporary solution for now, if you don't want to use !important then you can also overwrite this style by using more specific selector.

    I hope both of these issues will be fixed shortly but if you have any question and we can be of any further assistance please don't hesitate to ask :slight_smile:

    Vinod Dalvi

  • Rheinard

    Hi @Tom,

    Agreed. Thats why I say its a last resort.

    I'll be pushing out a release soon that have the specific colors removed from the button styles. The options will still be available though via a hook for people who have come to rely on those colors.

    Replacing the colors the styles now use the more generic 'button button-primary' classes that many WP core themes have adopted.