5

I have a multi-site network, on one of the sites the access is restricted to registered users, and only an administrator can create users.

I was asked to get rid of the confirmation email sent to new users, and I know you can select an option to add the user without sendind the email.

The problem is, that option is only available to super administrators (me) and not regular administrators.

Is there a way to add the new users without sending a confirmation email? I can get rid of the email, but I also need to remove the activation link, I need the users to be automatically added.

I've looking for hooks but I can't find anything helpful, any ideas?.

P.S. Every user is added from the Add new user menu in the backend.

2 Answers 2

2

Haven't really tested this, but WP actually uses this filter if you check the "noconfirmation" box, except that it does so only for super_admins, like you said:

add_filter( 'wpmu_signup_user_notification', '__return_false' );
2
  • Actually I figured this out days ago, but yes this was the answer, so thanks anyway. BTW I also had to edit the core to activate the users automatically...
    – Mario
    Commented Jan 13, 2012 at 21:59
  • The ability to check the tickbox would be great for administrators to see. The answer above is a workaround - how can we allow Administrators the option? Commented Feb 27, 2012 at 7:36
1

I think I figured out how to do this without editing any core files. I got things working (with minimal testing) using the following:

add_filter('wpmu_signup_user_notification', 'auto_activate_users', 10, 4);
function auto_activate_users($user, $user_email, $key, $meta){
  wpmu_activate_signup($key);
  return false;
}

The checkbox is still there on the page, but it has no effect.

As an aside, I completely disabled emails for my wordpress install by overwriting the wp_mail function:

function wp_mail($to, $subject, $message, $headers = '', $attachments = array() ){
  return true;
}

So that may have, in some way, allowed my auto_activate to work without sending emails.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.