How set role at registration based on email?

Here is a snippet that assign author role to a new registered member whose email is [email protected] where you need to modify to fit your needs: add_action( ‘user_register’, ‘user_register_cb’, 10, 1 ); function user_register_cb( $user_id ){ $user_info = get_userdata( $user_id ); $email = $user_info->user_email; $domain = ‘.co.uk’; $pos = strpos( $email, $domain ); if( $pos …

Read more

Remove wp-login link from auto generated wordpress’s email

Are you referring to the email sent after new subscriber registered to the site? If so, it is a pluggable function, which means you can over ride it as you need. Put this code in your theme functions.php. if( ! function_exists(‘wp_new_user_notification’) ) { function wp_new_user_notification($user_id, $plaintext_pass) { $user = new WP_User($user_id); $user_login = stripslashes($user->user_login); $greetings …

Read more

Redirect after empty register form

I think I found the solution myself. When I adjusted the declaration of the registration form: <form name=”registerform” id=”registerform” action=”<?php echo esc_url( site_url(‘wp-login.php?action=register’, ‘login_post’) ); ?>” method=”post” novalidate=”novalidate”> To the following: <form name=”registerform” id=”registerform” action=”<?php echo esc_url( site_url(‘wp-login.php?action=register&role=”.$_GET[“role’], ‘login_post’) ); ?>” method=”post” novalidate=”novalidate”> Then my problem is solved and the registration page is not redirected …

Read more