Change default admin to editor at signup (4 posts)

  1. Kathy_Goss
    Posted 5 years ago #

    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:

    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.

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

  3. hundsim
    Posted 5 years ago #

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

  4. hundsim - Please make a NEW topic for this, as it's not the same issue :)

Topic Closed

This topic has been closed to new replies.

About this Topic