Allow display_name to be searchable - this will commonly be full name

Closes #17104
This commit is contained in:
Mike Jolley 2017-10-09 19:20:22 +01:00
parent 1831d7ec37
commit fae130d038
1 changed files with 13 additions and 0 deletions

View File

@ -602,3 +602,16 @@ function wc_get_customer_last_order( $customer_id ) {
return wc_get_order( $id );
}
/**
* Add support for searching by display_name.
*
* @since 3.2.0
* @param array $search_columns Column names.
* @return array
*/
function wc_user_search_columns( $search_columns ) {
$search_columns[] = 'display_name';
return $search_columns;
}
add_filter( 'user_search_columns', 'wc_user_search_columns' );