• Resolved mojorob

    (@mojorob)


    I’ve installed v2.9.1 of WP-Members on WP 3.9, and am trying to disable the default style sheet.

    As per this example on the rocketgeek website I have used the following code:

    add_action( 'wp_print_styles', 'my_styles' ); 
    
    function my_styles() {
      wp_deregister_style( 'wp-members' );
    }

    However in the header the following is still loaded:
    <link rel='stylesheet' id='wp-members-css' href='http://www.domain.com/wp-content/plugins/wp-members/css/generic-no-float.css' type='text/css' media='all' />
    And if I put in my theme’s stylesheet as the custom stylesheet in the WP-Members options it duplicates that stylesheet in the header.

    Is there something I’m missing? Has something changed, such as the handle for removing the default stylesheet?

    https://wordpress.org/plugins/wp-members/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mojorob

    (@mojorob)

    Another thing I have noticed since the above, is that in the change password and reset password forms you can’t seem to change button_class like you can in other forms.

    Is there a reason for this? It would seem to be an oversight. Thanks!

    Plugin Author Chad Butler

    (@cbutlerjr)

    Disabling the stylesheet, you probably just need to change the priority on the action call so it comes later:

    add_action( 'wp_print_styles', 'my_styles', 99 );

    When you specify a stylesheet in the plugin’s options, it’s going to load that stylesheet for the plugin. If you add styles to your theme’s stylesheet, there’s no need to specify that as a custom stylesheet – it’s already loaded.

    There are a few different ways to approach changing the class for the buttons. You can pass in a different wrapper class with wpmem_login_form_args (the default is button_div). You could str_replace the button html with wpmem_login_form_buttons (which is a just a direct filter of the html string containing the button wrapper and the button html itself.

    Thread Starter mojorob

    (@mojorob)

    Thanks for replying, what you suggested with the priority worked for disabling the stylesheet.

    Also the hook you mentioned for the other forms worked – I think I was looking at a different one, trying to make it work. My queries in regards to getting it working how I want is resolved.

    As a minor question, have you considered updating the submit buttons from <input type="submit"> to <button> in a future update?

    Plugin Author Chad Butler

    (@cbutlerjr)

    Glad you got it working the way you want it.

    On the submit button question – probably no change in the near future for a couple of reasons:

    • Most importantly, I don’t like to make changes to generated HTML because it affects users who are filtering the HTML. If/when I do implement changes like that, it’s usually in larger chunks so that it is more noticeable to people as they upgrade that they need to consider the how the changes will affect them.
    • The jury is still out on preferring one over the other. It depends on application. And there are issues with some older browsers. I personally don’t like to hold back due to browser issues, but there is a large user base of this plugin so that has to be considered.
    • Lastly, any plugin user that wanted to use <button> for its benefits could filter out the <input> and replace it.

    That’s probably a longer answer than necessary, but it kind of incorporates the development philosophy for the plugin as a whole.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Disabling stylesheet not working’ is closed to new replies.