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:
@@ -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 );
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user