Check if “Send the new user an email about their account” is ticked

I believe I found a solution. Not sure if it is the best solution but at least it serves the purpose: if ( !function_exists(‘wp_new_user_notification’) ) { function wp_new_user_notification( $user_id, $plaintext_pass=”” ) { if($_POST[‘action’] == ‘createuser’){ if($_POST[‘send_user_notification’] == 1){ $user = new WP_User($user_id); $plaintext_pass = $_POST[‘pass1’]; wp_set_password( $plaintext_pass, $user_id ); $user_login = stripslashes($user->user_login); $user_email = stripslashes($user->user_email); … Read more

How to hide username on wordpress registration?

Well I was overthinking this way too much!! All you need to do for the form is put in a dummy value for user_login so that it looks like: <input class=”form-control” type=”hidden” name=”user_login” id=”user_login” value=”ABC”> On the top of the page I remove the $current_username = $current_email;. On the form submission code, I make the … Read more

Multisite: How to bypass wpmu_signup_user_notification and add my own notification logic?

This is actually quite easy. All I needed was to inject the appropriate add_filter() and follow it up with my custom function. That’s all I needed to completely override the original function. So sweeet. To bypass wpmu_signup_user_notification() and use my own custom function I needed the following: add_filter(‘wpmu_signup_user_notification’, ‘gqa_signup_user_notification’, 10, 4); And in my custom … Read more

Creating a custom register form

Ok, I found the solution. I placed the ‘wp_insert_user’ in a variable. And I used that variable to define the extra fields with ‘update_user_meta’. // If successful, register user $user_id = wp_insert_user($fields); update_user_meta( $user_id, ‘teste’, $fields[‘teste’] );

Insert user register into my own user table instead of wp own user

I figured it out myself I needed $wpdb and a , after the db_name Here is the result. $user_id = $wpdb->INSERT( ‘wp_fisker’, array ( ‘fisker_fornavn’ => apply_filters(‘pre_user_first_name’, $fisker_fornavn), ‘fisker_efternavn’ => apply_filters(‘pre_user_last_name’, $fisker_efternavn), ‘password’ => apply_filters(‘pre_user_user_pass’, $password), ‘telefon’ => apply_filters(‘pre_user_telefon’, $telefon), ‘zip’ => apply_filters(‘pre_user_zip’, $zip), ‘by_navn’ => apply_filters(‘pre_user_by_navn’, $by_navn), ’email’ => apply_filters(‘pre_user_user_email’, $email) ) ); if( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)