Created
February 5, 2015 13:51
-
-
Save JudeRosario/a9ed4ae56d40caf45769 to your computer and use it in GitHub Desktop.
Force Single Blog Max Cap WP MS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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