Support » Plugin: My WordPress Login Logo » Suggestion for compatibility

  • I had someone contact me about a problem they were having getting a custom message to appear on the login page when someone is going through the password retrieval process. Finally I realized that your plugin was putting a display:none on the default WP message, I’m guessing in order to better display the custom message your plugin lets you add.

    This hides important messages like the “check your email for your new password” instructions that WP gives when doing the Forgot Password functionality. At minimum I would suggest NOT hiding the default messages if no custom messages have been created through your plugin. The most compatible thing to do would be allowing the customization of messages for each circumstance that WP gives a message, such as “incorrect password” and “lost password”. You can find what conditions give a message by looking through the wp-login.php file. It doesn’t seem like there’s a really great way to filter these messages, but you can use the translation feature to do it, here’s an example function:

    function change_lostpassword_message( $translated_text, $text, $domain ) {
    	//Check for login/register page and that an email address has been entered to send a new password link to
        if ( in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) ) && ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) ) {
    
        	//Alter only this certain text
        	if( $translated_text == 'Check your e-mail for the confirmation link.') {
        		$translated_text = 'Here is your custom message.';
        	}
        }
        //No matter what, we always want to return the text, changed or not
        return $translated_text;
    }
    add_filter( 'gettext', 'change_lostpassword_message', 20, 3 );

    I hope this can help improve the plugin. The guy who came to me for help was really desperate to get a message up for just the “forgot password” and your plugin made this difficult by hiding what should be visible.

    Take care!

    -Jarrod

    https://wordpress.org/plugins/my-wp-login-logo/

  • The topic ‘Suggestion for compatibility’ is closed to new replies.