Support » Plugins and Hacks » [Plugin: Theme My Login] Erroneous register message

[Plugin: Theme My Login] Erroneous register message

Viewing 5 replies - 1 through 5 (of 5 total)
  • Why wouldn’t you expect it?

    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'));
        <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">
                <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" />
                <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" />
            <?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'); ?>" />
    //// I added the line below \\\
            <p class="message">A password will be e-mailed to you.</p>
        wdbj_tml_get_footer(true, false, true);

    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' );

    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.

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Theme My Login] Erroneous register message’ is closed to new replies.
Skip to toolbar