Consolidate larg network criteria into wp_is_large_network(). Allow plugins to change this criteria via filter. Props PeteMall. fixes #18464

git-svn-id: http://svn.automattic.com/wordpress/trunk@18871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2011-10-03 16:30:07 +00:00
parent 40794ebcd5
commit 69994de5d1
3 changed files with 25 additions and 7 deletions

View File

@@ -775,4 +775,23 @@ var tb_closeImage = "../../wp-includes/js/thickbox/tb-close.png";
<?php
}
/**
* Whether or not we have a large network.
*
* The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.
* Plugins can alter this criteria using the 'wp_is_large_network' filter.
*
* @since 3.3.0
* @param string $using 'sites or 'users'. Default is 'sites'.
* @return bool True if the network meets the criteria for large. False otherwise.
*/
function wp_is_large_network( $using = 'sites' ) {
if ( 'users' == $using ) {
$count = get_user_count();
return apply_filters( 'wp_is_large_network', $count > 10000, 'users', $count );
}
$count = get_blog_count();
return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count );
}
?>