Ready to get started?Download WordPress


[resolved] Function Reference / add_role() (4 posts)

  1. Jan K.
    Posted 2 years ago #


    i would like to add a new usergroup to ALL sites (without plugin).


    1. In which file do i have to add the add_role() function to make this happen?
    2. Where can i set my new user role to the default user role for all new users?

    Thank a lot!!

  2. whiteatom
    Posted 2 years ago #

    You'll need to write a simple plugin and have the add_role part of the activation script. Then you can remove the plugin. If you add it to your themes functions file or anywhere else, it will get called over and over.

    To make it the default, go to the settings tab in the edit site page of the network admin? About 40 options down, you'll see Default Role... Enter the slug for your new role.



  3. Of course if you remove the plugin, it won't create it for NEW sites.

    You may want to try manually adding it to existing sites, and then making a plugin (toss it in mu_plugins) to create it on new sites when they're activated.

  4. Jan K.
    Posted 2 years ago #

    Thanks for your help!

Topic Closed

This topic has been closed to new replies.

About this Topic