I don’t fully understand what you are trying to do. But, there is a plugin called “Members” which you can use to set different access levels and permissions. You might want to look at it.
Thanks @mrtom414 but I already am using members to create my custom role. I just want to set things up where new registrations have to be approved before their account is active.
okay, maybe you can use the subscribe account as an account awaiting approval then create another role and assign it to approved users. If they are subscribers you can hide everything from them and redirect to a page that says awaiting approval. I have a few piece of the puzzle but not all.
in the functions.php file you can add an action for admin_init
add_action('admin_init','checkForSubscriber');
function checkForSubscriber(){
$currentUser = wp_get_current_user();
if(count($currentUser->roles == 1) && $currentUser->roles[0] == 'subscriber'){
wp_redirect(<<page you want>>);
wp_destroy_current_session();
wp_clear_auth_cookie();
exit;
}
}
the above code will redirect the user to the page you want and kill the user session if they are a subscriber. I only typed this from my notes you might want to test it before using it. Maybe create a plugin to test with.
@mrtom414 thanks again! That is definitely an interesting way to do it, and one I will likely look further into if there isn’t a way to actually set new registrations as pending for approval.
I know setting a specific user role registrations requiring approval should be doable as many membership plugins have this functionality. I am just hoping there is a snippet out there that lets me do that.