WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Theme My Login] Erroneous register message (6 posts)

  1. Georg
    Member
    Posted 4 years ago #

    If I click Register on the login form, wp-theme-login displays the register form, but a message is printed between the header "Register" and the header "Username". The message says "A password will be e-mailed to you". I wouldn't expect this message as this time. Using version 5.0.5

    http://wordpress.org/extend/plugins/theme-my-login/

  2. Jeff Farthing
    Member
    Posted 4 years ago #

    Why wouldn't you expect it?

  3. marcy_sss
    Member
    Posted 4 years ago #

    It seemed really confusing to me as well. I am used to seeing an alert message like this one only after pressing Submit — I thought perhaps the Register page was submitted without me entering anything. So, for my install I moved the message below the Submit button by editing the wdbj_tml_get_register_form() function on line 231 of template-functions.php in the plugin's includes folder:

    I commented out $message so it would be empty when wdbj_tml_get_header($message) executed, and then added the message back in after the Submit button. Or, you could just leave the message off entirely.

    function wdbj_tml_get_register_form() {
        $current_instance = wdbj_tml_get_var('current_instance');
    
        $user_login = isset($_POST['user_login']) ? $_POST['user_login'] : '';
        $user_email = isset($_POST['user_email']) ? $_POST['user_email'] : '';
    
    ////// I commented out the line below \\\\\\
       // $message = apply_filters('register_message', __('A password will be e-mailed to you.', 'theme-my-login'));
    
        wdbj_tml_get_header($message);
        ?>
        <form name="registerform" id="registerform-<?php echo $current_instance['instance_id']; ?>" action="<?php echo esc_url(wdbj_tml_get_current_url('action=register&instance=' . $current_instance['instance_id'])); ?>" method="post">
            <p>
                <label for="user_login-<?php echo $current_instance['instance_id']; ?>"><?php _e('Username', 'theme-my-login') ?></label>
                <input type="text" name="user_login" id="user_login-<?php echo $current_instance['instance_id']; ?>" class="input" value="<?php echo attribute_escape(stripslashes($user_login)); ?>" size="20" />
            </p>
            <p>
                <label for="user_email-<?php echo $current_instance['instance_id']; ?>"><?php _e('E-mail', 'theme-my-login') ?></label>
                <input type="text" name="user_email" id="user_email-<?php echo $current_instance['instance_id']; ?>" class="input" value="<?php echo attribute_escape(stripslashes($user_email)); ?>" size="20" />
            </p>
            <?php do_action('register_form', $current_instance['instance_id']); ?>
            <p class="submit">
                <input type="submit" name="wp-submit" id="wp-submit-<?php echo $current_instance['instance_id']; ?>" value="<?php _e('Register', 'theme-my-login'); ?>" />
            </p>
    //// I added the line below \\\
            <p class="message">A password will be e-mailed to you.</p>
        </form>
        <?php
        wdbj_tml_get_footer(true, false, true);
    }
  4. Jeff Farthing
    Member
    Posted 4 years ago #

    If you look at the default registration form at yoursite.com/wp-login.php?action=register, you will see this message as well.

    However, if you want to remove it from TML, you should use the filter instead of modifying core code, as that will be lost when you upgrade. Try this in your theme's "functions.php" file:

    function remove_register_message($message) {
        return '';
    }
    add_filter( 'register_message', 'remove_register_message' );
  5. marcy_sss
    Member
    Posted 4 years ago #

    That's a good point, I just lost my changes when I upgraded the plugin. But I need to hide the register link. Any suggestions on how to do that without hacking core? The plugin page says you can do that, but I never figured out how. I think my CSS was overwritten as well.

  6. Jeff Farthing
    Member
    Posted 4 years ago #

    You can add show_reg_link=0 to the page shortcode. For the CSS, you can keep a copy of "theme-my-login.php" in your current theme's directory in order to maintain changes between updates. The plugin will always load this version first, if it exists.

Topic Closed

This topic has been closed to new replies.

About this Topic