Skip to content

Instantly share code, notes, and snippets.

@JudeRosario
Created February 5, 2015 13:51
Show Gist options
  • Save JudeRosario/a9ed4ae56d40caf45769 to your computer and use it in GitHub Desktop.
Save JudeRosario/a9ed4ae56d40caf45769 to your computer and use it in GitHub Desktop.
Force Single Blog Max Cap WP MS
// Special Thanks to Ashok and Tyler Postle for this code ( UNTESTED )
function wpms_one_blog_only($active_signup) {
// Get an array of the current user's blogs
$blogs = get_blogs_of_user( get_current_user_id() );
if ($blogs["1"]) unset($blogs["1"]);
$n = count($blogs);
if(n > 0){
$active_signup = 'none';
echo '';
} else {
$active_signup = $active_signup;
}
return $active_signup; // return "all", "none", "blog" or "user"
}
add_filter('wpmu_active_signup', 'wpms_one_blog_only');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment