• Resolved Sho-Down

    (@sho-down)


    I use Register Plus Redux to change the style of my login and registration pages but your plugin has this code in it:

    <style type="text/css">
    		#login {
    			width:350px !important;
    		}
    		</style>

    inside inc/class-wp_recaptcha_nocaptcha.php which makes it override any width settings I input into Register Plus Redux even if I add !important. Please consider removing it.

    https://wordpress.org/plugins/wp-recaptcha-integration/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Sho-Down

    (@sho-down)

    Also, is there some code I can throw in my functions.php file to only load the javascript on certain pages? I only need it to load on the Contact page and WordPress’s register/login/forgot password pages.

    Plugin Contributor podpirate

    (@podpirate)

    Hi, I’m currently trying to implement some more conditionals to scripts inclusion. In the latest github version there are two new filters.

    This one will remove the login css (which is loaded only on login pages pages now):

    apply_filters('wp_recaptcha_print_login_css','__return_false');

    wp_recaptcha_do_scripts will load the scripts only on login, register and your contact form page. (Don’t forget to fill in the ID of your contact page):

    function recaptcha_disable_on_frontend( $enabled ) {
    	if ( get_the_ID() != CONTACT_FORM_PAGE_ID && ! is_admin() && ! in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) ) )
    		return false;
    	return $enabled;
    }
    add_filter('wp_recaptcha_do_scripts','recaptcha_disable_on_frontend');
    );

    I would really appreciate if you test it and give me some feedback, if it works for you.

    Thread Starter Sho-Down

    (@sho-down)

    Ok, I installed the github version and how can I get:

    apply_filters('wp_recaptcha_print_login_css','__return_false');

    To also return false on the login/register/lost password pages? I don’t want the css to load AT ALL because it’s forcing my form’s width to be too small. I’d rather not edit the plugin’s core files.

    Also this is my view source on the register/login pages, it seems to be adding the marked out code twice:

    <!-- BEGIN recaptcha, injected by plugin wp-recaptcha-integration  -->
    
    <!-- END recaptcha -->
    
    <!-- BEGIN recaptcha, injected by plugin wp-recaptcha-integration  -->
    <style type="text/css">
    		#login {
    			width:350px !important;
    		}
    		</style>
    <!-- END recaptcha -->

    This is my site: http://ow.ly/JVG6V

    Thread Starter Sho-Down

    (@sho-down)

    And your second conditional works perfectly, now the js only loads on my contact page and the login/register/lost password pages…thanks.

    Plugin Contributor podpirate

    (@podpirate)

    v1.1.1 just commited. can close this now.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Please remove width:350px !important’ is closed to new replies.