wp_create_user hook

There are actually two actions: One when the profile is updated and one when the user is registered. # Fires immediately after an existing user is updated. do_action( ‘profile_update’, $user_id, $old_user_data ); # Fires immediately after a new user is registered. do_action( ‘user_register’, $user_id ); So as long as the user login is not empty … Read more

Creating a Closed WordPress Community Using Referral Codes

So, first up, we need some sort of submit form. Here’s a simple one, it can be whatever you want, obviously. This is just for this example. Emails the person on submission and sets up a password key for them in the wp_options table. <?php add_action( ‘init’, ‘wpse15535_add_shortcode’ ); function wpse15535_add_shortcode() { add_shortcode( ‘invite-form’, ‘wpse15535_invite_form’ … Read more

How to add a description to the user name input field in the registration form?

OK, that’s possible using JavaScript (jQuery lib). Code – // load jquery on login screen if not loaded already add_action( ‘login_enqueue_scripts’, ‘wpse_login_head’ ); function wpse_login_head(){ wp_enqueue_script(‘jquery’); } add_action( ‘register_form’, ‘wpse_register_form’ ); function wpse_register_form(){ ?> <!– we have used an unique id for the description tag –> <span id=”user_login_description” style=” display:none;” class=”description”><?php _e(“Description text”); ?></span> <!– … Read more

User defined password at registration – registration email sends auto generated pass

Welcome to WPSE. You can use wp_insert_user, you don’t need to hook onto anything. Assuming here they fill out a form with a name, username, email and password field, and you capture it however you want. $name_array = explode(‘ ‘,$_POST[‘name’]); $user = array( ‘user_login’ => $_POST[‘username’], ‘user_pass’ => $_POST[‘password’], ‘user_email’ => $_POST[’email’], ‘first_name’ => $name_array[0], … Read more

Registration key

Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted. You could use plugin Pie Register for the invitation codes or have look at this snippet ( Creating a Closed WordPress Community Using Referral … Read more

Changing username after registration to get around the issue of having duplicate emails?

You can try this skeleton plugin: /** * Plugin Name: Allow duplicate emails on registration * Plugin URI: http://wordpress.stackexchange.com/a/125129/26350 */ add_action( ‘plugins_loaded’, array( ‘Allow_Duplicate_Emails_Registration’, ‘get_instance’ ) ); class Allow_Duplicate_Emails_Registration { private $rand = ”; static private $instance = NULL; static public function get_instance() { if ( NULL === self::$instance ) self::$instance = new self; return … Read more