Hot answers tagged

3

I think you are on the right track, wp_cache_delete was what finally helped me get an auto-signup with auto-login plugin working... I have this from there: wp_cache_delete($current_user->ID, 'users'); wp_cache_delete($current_user->user_login, 'userlogins'); Then see what roles you get after that with: $current_user = wp_get_current_user();


2

Have you tried logging in the user after your changes? Such as: wp_set_current_user( $current_user->ID, $current_user->user_login ); wp_set_auth_cookie( $current_user->ID ); do_action( 'wp_login', $current_user->user_login );


1

I suggest not to mess with the existing roles and capabilities in its default, it might help you some trouble when you will have a bunch of custom roles and capabilities in the future. To answer your question, I will have an example: I need new role/user group that has almost an Administrator but don't have the the capability to edit plugins and the ...



Only top voted, non community-wiki answers of a minimum length are eligible