WordPress.org

Support

Support » Multisite » [Resolved] How do i change the default administrator role to author for new users ?

[Resolved] How do i change the default administrator role to author for new users ?

  • Hi,

    How can change the default role for newly registered users with their own website from administrator to author??

    So when i am logged in as super admin, the box ‘site users’ should read ‘author’ under roles. How can i do this? Possible a function to add to functions.php??

    regards,

Viewing 15 replies - 1 through 15 (of 18 total)
  • hi andrea_r,

    tx for you answer i have installed the plugin but it doesn’t seem to do what i want. This plugin lets me

    Select the default role for each of your sites.

    But i like to set default role for every newly registered website. So
    if a new user registers as newuser, i want a blog/website for the new user
    – as in newuser.mydomain.com
    – and when he/she logs in at newuser.mydomain.com/wp-admin/ the role he has is author and not the default administrator. This might sound a bit odd, but i have hide a couple of admin panels and dashboard boxes based on the role.
    – i want to hide all the administrator role capabilities to make it simpler to post.

    regards

    Ah, here’s the one I was thinking of:
    http://wordpress.org/extend/plugins/wpmu-default-user-role/

    if a new user registers as newuser, i want a blog/website for the new user
    – as in newuser.mydomain.com

    Then when they signup, they have to check the “gimmie a site!” button. it will give them a blog with their username by default, as the first site they get.

    Hi Andrea_r,

    tx for the effort but this is still not exactly the function i was thinking off.

    Then when they signup, they have to check the “gimmie a site!” button. it will give them a blog with their username by default, as the first site they get.

    After this action i like the registered user with website to logged in as author on his own website. So not as an administrator on his own website??

    Yes, I understand exactly what you want. There’s a few similarly named plugins out there, that do similar things, so it’s easy to get them mixed up.

    * blanking on the rest * I bet d_sader knows offhand.

    David Sader
    Participant

    @dsader

    “i have hide a couple of admin panels and dashboard boxes based on the role.”

    Hide some admin menus:
    http://wordpress.org/extend/plugins/menus/

    Hide a few metaboxes (Dashboard and edit forms)
    http://wordpress.org/extend/plugins/toggle-meta-boxes-sitewide/

    To change role of user on the blog while it is being created add the following to “mu-plugins” the change occurs immediately after the user creates a blog either on first signup or anytime they visit signup to create an additional blog:

    <?php
    function ds_new_user_meta($blog_id, $user_id) {
     add_user_to_blog($blog_id, $user_id, 'author' );
    }
    add_action( 'wpmu_new_blog', 'ds_new_user_meta', 10, 2 );
    ?>
    owagu
    Member

    @owagu

    David,

    you won’t believe how much time that snippet saved me … You the b*mb 🙂

    tnx

    David Sader: Thanks, just like owagu, you’re four lines of codes saved me hours of Googling. THANKS!

    Alvaro
    Participant

    @nicardo

    hello
    I have installed wordpress 3.0.1 ,can you please guide me in which file i a have to add those 4 line of code as there is no mu-plugins folder

    <?php
    function ds_new_user_meta($blog_id, $user_id) {
    add_user_to_blog($blog_id, $user_id, ‘author’ );
    }
    add_action( ‘wpmu_new_blog’, ‘ds_new_user_meta’, 10, 2 );
    ?>

    i want all the default user have author role and they dont have any admin

    as there is no mu-plugins folder

    because you need to create it. it will still work.

    http://wpmututorials.com/basics/what-is-the-mu-plugins-folder/

    Alvaro
    Participant

    @nicardo

    thanks Andrea
    its working like a charm for me

    justbishop
    Member

    @justbishop

    Anyone know if this might somehow be useful for my issue of wanting to set a date for site admins to be automatically demoted to subscribers?

    not unless you want to write a whole bunch more code to go with it.

    justbishop
    Member

    @justbishop

    LOL, of course. I’m just always on the lookout for pieces of the puzzle (seeing as at the moment I have none) 😉

    Right now, all roads lead to paying for it. :-/

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘[Resolved] How do i change the default administrator role to author for new users ?’ is closed to new replies.