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:
parent
6995731f12
commit
cb81009729
|
@ -522,8 +522,9 @@ class WP_User_Query {
|
||||||
$search = trim($search, '*');
|
$search = trim($search, '*');
|
||||||
|
|
||||||
$search_columns = array();
|
$search_columns = array();
|
||||||
if ( $qv['search_columns'] )
|
if ( $qv['search_columns'] ) {
|
||||||
$search_columns = array_intersect( $qv['search_columns'], array( 'ID', 'user_login', 'user_email', 'user_url', 'user_nicename' ) );
|
$search_columns = array_intersect( $qv['search_columns'], array( 'ID', 'user_login', 'user_email', 'user_url', 'user_nicename', 'display_name' ) );
|
||||||
|
}
|
||||||
if ( ! $search_columns ) {
|
if ( ! $search_columns ) {
|
||||||
if ( false !== strpos( $search, '@') )
|
if ( false !== strpos( $search, '@') )
|
||||||
$search_columns = array('user_email');
|
$search_columns = array('user_email');
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue