mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-27 14:53:08 +02: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: http://core.svn.wordpress.org/trunk@23664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f29bb91f05
commit
f86b1502a0
@ -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 );
|
||||
}
|
||||
|
@ -1978,3 +1978,23 @@ function upload_size_limit_filter( $size ) {
|
||||
|
||||
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…
Reference in New Issue
Block a user