Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Could probably use a little cleaning up, but it works.
- $current_user = wp_get_current_user();
- if ( !(0 == $current_user->ID) ){
- $user_info = get_userdata($current_user->ID);
- $user_array = $user_info->roles;
- if (empty($user_array)){
- $u = new WP_User( $current_user->ID );
- $u->add_role( 'subscriber' );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement