WordPress.org

Ready to get started?Download WordPress

Forums

WP Email Login
Internet Explorer Text Display Issue (6 posts)

  1. jlankford
    Member
    Posted 1 year ago #

    I'm going to play around with the code in wp-login.php, but I'm wondering why on Chrome and Firefox the Login box says "Username or Email" while in IE8 it says "Username."

    The issue is that people at my company have an irrational love for IE8, and hate usernames.

    I have BM Custom Login installed too. Would this make a difference?

    http://wordpress.org/extend/plugins/wp-email-login/

  2. Beau Lebens
    Member
    Plugin Author

    Posted 1 year ago #

    This plugin uses Javascript to replace some values on that page to change the label. It's possible that that code is not compatible with Internet Explorer (I haven't tested to be honest).

    Do you get any Javascript errors on that page?

    If you find a solution I'd be happy to include it in the plugin.

  3. autoverse
    Member
    Posted 1 year ago #

    Hi Beau - this is jlankford on another account (didn't realize I had this one). The following is happening:

    Message: 'childNodes.0' is null or not an object
    Line: 96
    Char: 3
    Code: 0
    URI: http://www.richsrecipes.net/wp-login.php?redirect_to=http%3A%2F%2Fwww.richsrecipes.net%2F

    Also, as you can see, there's a redirect in there too.

  4. Cor van Noorloos
    Member
    Posted 1 year ago #

    Not entirely sure if this reply should have its own thread, but the main 'Username' label could be filtered by something like this:

    add_filter( 'gettext', 'email_login_username_label', 10, 2 );
    function email_login_username_label( $translation, $text ) {
    	global $pagenow;
    	if ( ! is_user_logged_in() || 'wp-login.php' == $pagenow ) {
    		if ( $text === 'Username' ) {
    			$translation = __( 'Username or email', 'wp-email-login' );
    		}
    	}
    	return $translation;
    }

    I'm not really sure about the error notices however (and haven't really paid attention to yet).

    I believe they can be included in the same filter, but it might be better to use the authenticate filter for these (which is the part I'm not really sure about).

  5. Cor van Noorloos
    Member
    Posted 1 year ago #

    On second thought, equal should be identical:

    if ( ! is_user_logged_in() || 'wp-login.php' == $pagenow ) {

    should be

    if ( ! is_user_logged_in() || 'wp-login.php' === $pagenow ) {

  6. Cor van Noorloos
    Member
    Posted 1 year ago #

    The first turned out to be the easiest solution:

    add_filter( 'gettext', 'username_or_email_login', 10, 2 );
    function username_or_email_login( $translation, $text ) {
    	global $pagenow;
    	if ( 'wp-login.php' === $pagenow ) {
    		if ( $text === 'Username' ) {
    			$translation = __( 'Username or email', 'wp-email-login' );
    		}
    		if ( $text === '<strong>ERROR</strong>: The username field is empty.' ) {
    			$translation = __( '<strong>ERROR</strong>: The username or email field is empty.', 'wp-email-login' );
    		}
    	}
    	return $translation;
    }

    Since the language files will have to be regenerated anyway I've changed "email" from the first string and "username or email" from the second string to all lowercase.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.