Created
November 10, 2012 00:55
-
-
Save spivurno/4049312 to your computer and use it in GitHub Desktop.
Configure admin approval for new accounts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Configure Admin Approval for New Accounts | |
* http://gravitywiz.com/ | |
*/ | |
remove_filter('wpmu_signup_user_notification_email', array('GFUserSignups', 'modify_signup_user_notification_message')); | |
add_filter('wpmu_signup_user_notification_email', 'my_modify_signup_user_notification_message'); | |
function my_modify_signup_user_notification_message() { | |
return false; | |
} | |
add_action('gform_user_registered', 'my_new_user_notification', 10, 4); | |
function my_new_user_notification($user_id, $config, $lead, $password) { | |
$user = new WP_User($user_id); | |
$user_login = stripslashes($user->user_login); | |
$user_email = stripslashes($user->user_email); | |
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); | |
$message = "Thanks for signing up. Your account has been approved and you can now log in.\r\n"; | |
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n"; | |
$message .= "Password: the one you entered in the registration form\r\n"; | |
$message .= wp_login_url() . "\r\n"; | |
wp_mail($user_email, sprintf(__('[%s] Your account has been been approved'), $blogname), $message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment