WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] How do i change the default administrator role to author for new users ? (19 posts)

  1. DDT
    Member
    Posted 3 years ago #

    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,

  2. DDT
    Member
    Posted 3 years ago #

    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

  3. 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.

  4. DDT
    Member
    Posted 3 years ago #

    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??

  5. 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.

  6. David Sader
    Member
    Posted 3 years ago #

    "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 );
    ?>
  7. owagu
    Member
    Posted 3 years ago #

    David,

    you won't believe how much time that snippet saved me ... You the b*mb :-)

    tnx

  8. Huvet
    Member
    Posted 3 years ago #

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

  9. Alvaro
    Member
    Posted 3 years ago #

    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

  10. 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/

  11. Alvaro
    Member
    Posted 3 years ago #

    thanks Andrea
    its working like a charm for me

  12. justbishop
    Member
    Posted 3 years ago #

    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?

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

  14. justbishop
    Member
    Posted 3 years ago #

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

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

  16. justbishop
    Member
    Posted 3 years ago #

    I know, but no one wants to do it for what I can afford :(

  17. Kathy_Goss
    Member
    Posted 3 years ago #

    Hi,
    I tried to use the Role of User code by Sader to Editor. I already had a MU folder so I just created a new php file named editor-at-signup.php and placed in the MU folder.

    I get the following at main domain:
    Warning: Cannot modify header information - headers already sent by (output started at /home/content/31/7500231/html/caritaskids.com/wp-content/mu-plugins/editor-after-signup.php:9) in /home/content/31/7500231/html/caritaskids.com/wp-includes/pluggable.php on line 897

    1. Did I do the insertion properly into MU?
    2. Please advise how to solve.

    Thank you.

  18. Kathy_Goss - Make a NEW topic for this.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.