• Resolved dirkiev

    (@dirkiev)


    So I have removed all user types using

    add_role('student', 'Student', array(
        'read' => true,
        'edit_posts' => false,
        'delete_posts' => false,
    ));
    
    add_role('teacher', 'Teacher', array(
        'read' => true,
        'edit_posts' => false,
        'delete_posts' => false,
    ));
    
    remove_role('editor');
    remove_role('author');
    remove_role('contributor');
    remove_role('subscriber');

    and set the default user to be a student. But when I create a new user firstly it doesn’t actually default to being a student. and when I look in the database it still has
    a:2:{s:10:"subscriber";b:1;s:7:"student";b:1;}

    so I added a hook to try change this

    add_action('user_register','user_signup_mod_default',10,1);
    function user_signup_mod_default($user_id){
            $user = new WP_User($user_id);
            $user->remove_role('subscriber');
            $user->set_role('student');
    }

    But this has also not worked. So what I really want to know is why does the subscriber role still come up in the database? Is this some kind of default ? Any help be great.

    Thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Custom User Roles Not Working Correctly’ is closed to new replies.