I would like to edit my PHP registration form on my wordpress site so that all new users have the following:
- They only enter their email address (user_email) on the registration form, and this field is duplicated and used/entered as their username (user_login)
- The same identical password is assigned to all new users. Literally a password of "password" could be pre-entered on the form.
I know this sounds like a huge security mess, but for my particular site, it's fine since I don't use Wordpress as a typical blog, and instead just need it for CMS and my newsletter. New users can do nothing. Comments are not allowed, they are defaulted as "Subscribers" anyway.
The only reason I want them to register/login at all is so that I can have:
A. Conditional menus that will change based on those who are 'logged in' and those who are not. B. User registration so I can have users sign up for my email newsletter and register all at the same time by simply entering in their email address to a single registration email field.
The default identical password is only established because for my site needs, the login is only for conditional menus. Thus, if someone logs out, I want the login menu to have the password field pre-enter the default "password" so that users don't even need to remember anything besides their email address.
I'm using the standard wordpress form:
<form name="registerform" id="registerform" action="<?php echo esc_url( site_url('wp-login.php?action=register', 'login_post') ); ?>" method="post">
<p>
<label for="user_login"><?php _e('Username') ?><br />
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(wp_unslash($user_login)); ?>" size="20" /></label>
</p>
<p>
<label for="user_email"><?php _e('E-mail') ?><br />
<input type="text" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(wp_unslash($user_email)); ?>" size="25" /></label>
</p>
<?php
/**
* Fires following the 'E-mail' field in the user registration form.
*
* @since 2.1.0
*/
do_action( 'register_form' );
?>
<p id="reg_passmail"><?php _e('A password will be e-mailed to you.') ?></p>
<br class="clear" />
<input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e('Register'); ?>" /></p>
</form>
I guess an alternate option is just to hack the wordpress_logged_in_[hash] cookie so when users visit so that when they click a "login" and enter their email address, it really just adds them to my newsletter and then places a cookie as if they are logged in. Either way works so any help is appreciated, thanks.
I'm a bit new to this, so any help is appreciated, thanks.