fabriciocarraro
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
@cosmiclove1978 Actually, on top on hiding it via CSS, you have to add some code (I used the Code Snippets plugin) so that it copies the email to be the username as well. I also hid the “Confirm email” and “Confirm password” fields, so this code below also copies both of them as well from the regular “email” and “password” fields. Here’s the code:
function my_generate_fields_for_users() { if ( !isset( $_REQUEST['level'] ) ) { return; } $generate_data_levels = array( '1'); // Level ID's to generate data for. if ( ! in_array( $_REQUEST['level'], $generate_data_levels ) ) { return; } // Generate Email Address as username. if(!empty($_REQUEST['bemail'])) { $_REQUEST['username'] = $_REQUEST['bemail']; } if(!empty($_POST['bemail'])) { $_POST['username'] = $_POST['bemail']; } if(!empty($_GET['bemail'])) { $_GET['username'] = $_GET['bemail']; } //Copy email to Confirm Email if( !empty( $_REQUEST['bemail'] ) ) { $_REQUEST['bconfirmemail'] = $_REQUEST['bemail']; } // Generate passwords confirm. if( !empty( $_REQUEST['password'] ) ) { $_REQUEST['password2'] = $_REQUEST['password']; } } add_action( 'init', 'my_generate_fields_for_users' );
- This reply was modified 3 years, 3 months ago by fabriciocarraro.
Fantastic! Thank you very much!
Viewing 2 replies - 1 through 2 (of 2 total)