Displaying a message upon user registration

http://codex.wordpress.org/Plugin_API/Action_Reference/user_register This action hook allows you to access data for a new user immediately after they are added to the database. The user id is passed to hook as an argument. add_action(‘user_register’, ‘registration_redirect’); function registration_redirect($user_id) { $url=”PAGE_WHERE_YOUR_CODE_IS_DISPLAYED”; wp_redirect( $url ); exit; } placing that in your functions.php should work. This attempts to redirect the user … Read more

Store user’s registration date as meta

In your case $registered is the user id not the user object so it does not work. Please use the code as given below. add_action( ‘user_register’, ‘set_user_registration_date’, 10, 1 ); function set_user_registration_date( $user_id ) { $user = get_userdata ( $user_id ); // Update the registration meta data update_user_meta ( $user_id, ‘registration_date’, $user->user_registered ); }

Redirect if $_Server[‘REQUEST_URI’] is /wp-login.php?checkemail=registered

http://codex.wordpress.org/Plugin_API/Action_Reference/user_register The question you referenced uses the ‘register_post’ hook which is just before the user gets entered into the database. If the registration is successful, that is when it sounds like you want to redirect. So, use the hook that fires immediately after the user is entered into the database. TL;DR Use the ‘user_register’ hook … Read more

How to hook in after user’s registration email has been sent?

I would use the registration_redirect filter. This allows you to set where the user is sent to, but leaves WordPress to perform the redirect (after everything has successfully processed). function wpse_139267_registration_redirect( $url ) { return site_url( ‘thank-you’ ); } add_filter( ‘registration_redirect’, ‘wpse_139267_registration_redirect’ );

On user registration, if welcome mail sent, add post with new user as author

Instead of using wp_mail filter use action user_register: function fpw_new_user_post( $user_id ) { global $wpdb; update_user_meta( $user_id, $wpdb->base_prefix . ‘capabilities’, array( ‘author’ => TRUE ) ); $new_post = array ( ‘post_title’ => ‘User ‘ . get_user_by( ‘id’, $user_id )->user_login . ‘ registered @ ‘ . date( ‘Y-m-d H:i:s’, current_time( ‘timestamp’ ) ), ‘post_content’ => ‘This … Read more

How to add additional information to a user on user creation?

I’d think you’d need to hook into the user_register action, like recommended above, and then use some code similar to this: add_action(‘user_register’,’post_user_reg_redirect’); function post_user_reg_redirect( $user_id ) { if ( is_admin() ) { wp_redirect(get_edit_user_link( $user_id )); die(); } } This would check that you’re creating a user in the admin view, and then redirect to the … Read more

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