Skip to content

Instantly share code, notes, and snippets.

@rohmann
Last active December 21, 2015 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rohmann/6261455 to your computer and use it in GitHub Desktop.
Save rohmann/6261455 to your computer and use it in GitHub Desktop.
Change the default role for users when creating a new site. http://git.io/6_L4Bw
<?php
//This will make the user an editor instead of admin for a new site
add_action('wpmu_new_blog','change_new_blog_role',100,6);
function change_new_blog_role($blog_id, $user_id, $domain, $path, $site_id, $meta) {
remove_user_from_blog($blog_id, $user_id);
add_user_to_blog($blog_id, $user_id, 'editor');
}
@rohmann
Copy link
Author

rohmann commented Sep 10, 2013

This can be placed in a network activated plugin or in a plugin in the mu-plugins folder

For quick implementation without coding, use these steps:

  1. Download the PHP file by click clicking the raw icon above (see image) and chosing "Save link as"
  2. Upload that file to the wp-content/mu-plugins folder
    alt text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment