1

When user registers to my site I want to make them inactive by default so I can manually update their status and send them their login info. I am using wordpress 3.1.2. Is it possible? Are there any plugins for this?

BTW, I am using Cimy User Extra Field plugin to add more fields to the registration page.

2
/*
Plugin Name: Role-less New Users
Description: Removes all roles from new registrations.
Author: 5ubliminal
*/
// Hook into the registration process
add_action('user_register', function($user_id){
    $user = new WP_User($user_id);
    // Remove all user roles after registration
    foreach($user->roles as $role){
        $user->remove_role($role);
    }
}, 11);

Create a new .php file. Paste the code above in it. Put it in your /wp-content/plugins folder and activate it. Do test it!

PS: Be advised, PHP 5.3 syntax, closures used. Incompatible with PHP 5.2 or older.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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