Allow user searches to match the `display_name` field.

Props bcole808, pcarvalho.
Fixes #39643.
Built from https://develop.svn.wordpress.org/trunk@40982


git-svn-id: http://core.svn.wordpress.org/trunk@40832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2017-07-01 14:22:41 +00:00
parent 6995731f12
commit cb81009729
2 changed files with 4 additions and 3 deletions

View File

@ -522,8 +522,9 @@ class WP_User_Query {
$search = trim($search, '*');
$search_columns = array();
if ( $qv['search_columns'] )
$search_columns = array_intersect( $qv['search_columns'], array( 'ID', 'user_login', 'user_email', 'user_url', 'user_nicename' ) );
if ( $qv['search_columns'] ) {
$search_columns = array_intersect( $qv['search_columns'], array( 'ID', 'user_login', 'user_email', 'user_url', 'user_nicename', 'display_name' ) );
}
if ( ! $search_columns ) {
if ( false !== strpos( $search, '@') )
$search_columns = array('user_email');

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-40981';
$wp_version = '4.9-alpha-40982';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.