WordPress.org

Support

Support » Plugins and Hacks » Hacks » default user role

default user role

  • Hi everyone!

    By some reason I can’t manage to change the default user role under settings -> general. Maybe because we’re using a plugin named “User role editor” (where you also can set the default role, but it doesn’t work)

    So what I’m trying to do here is to add an action to change the default role from author to contributor, but it still doesn’t seem to work.

    add_action('user_register','set_default_user_role');
    
    function set_default_user_role($user_id){
            $user = new WP_User( $user_id );
            return $user->set_role( 'contributor' );
    }

    any ideas?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    @bcworkz

    Try directly changing the value in the options table, it’s under the key ‘default_role’, use phpMyAdmin if necessary.

    It’s disconcerting you can’t change this, are you logged in as administrator? Did someone accidentally change your capabilities? Can you change this if the plugin is deactivated? If it’s really a plugin issue, I would think the author would like to know about it.

Viewing 1 replies (of 1 total)
  • The topic ‘default user role’ is closed to new replies.
Skip to toolbar