mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 01:52:24 +01:00
Fix fatal error in WP_User_Query when searching users by URL. Move wp_is_large_network() to wp-includes. fixes #23683 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@23664 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
18d4ae9d54
commit
514e6ca11f
@ -695,23 +695,3 @@ var tb_pathToImage = "../../wp-includes/js/thickbox/loadingAnimation.gif";
|
||||
</script>
|
||||
<?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 );
|
||||
}
|
||||
|
@ -1977,4 +1977,24 @@ function upload_size_limit_filter( $size ) {
|
||||
return min( $size, $fileupload_maxk );
|
||||
|
||||
return min( $size, $fileupload_maxk, get_upload_space_available() );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 );
|
||||
}
|
||||
|
@ -474,7 +474,7 @@ class WP_User_Query {
|
||||
$search_columns = array('user_email');
|
||||
elseif ( is_numeric($search) )
|
||||
$search_columns = array('user_login', 'ID');
|
||||
elseif ( preg_match('|^https?://|', $search) && ! wp_is_large_network( 'users' ) )
|
||||
elseif ( preg_match('|^https?://|', $search) && ! ( is_multisite() && wp_is_large_network( 'users' ) ) )
|
||||
$search_columns = array('user_url');
|
||||
else
|
||||
$search_columns = array('user_login', 'user_nicename');
|
||||
|
Loading…
x
Reference in New Issue
Block a user