Support » Networking WordPress » Change default admin to editor at signup

  • Hi,
    I tried to use the Role of User code by previously provided by Sader:
    “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 );
    ?>

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    Cannot modify header information – headers already sent by

    this error almost always means you have blank lines before or after the opening or closing php tags.

    hundsim

    (@hundsim)

    I’m getting some sort of error as well at the first login when using the code snippet:

    Warning: Invalid argument supplied for foreach() in /public_html/wp-includes/query.php on line 1689

    (The hack works though, and once logged in the error messages don’t show up again.)

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    Lead Plugin Wrangler

    hundsim – Please make a NEW topic for this, as it’s not the same issue 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change default admin to editor at signup’ is closed to new replies.