how to disable user confirmation from administration?

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.

Read More

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.

Related posts

Leave a Reply

2 comments

  1. 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. 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.