Merge pull request #31295 from oscarssanchez/fix/customers-api-search-param

Customers endpoint: Check if search param could be considered empty
This commit is contained in:
Barry Hughes 2022-01-27 19:21:31 -08:00 committed by GitHub
commit a859cdd50c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -244,7 +244,7 @@ class WC_REST_Customers_V1_Controller extends WC_REST_Controller {
$prepared_args['orderby'] = $orderby_possibles[ $request['orderby'] ];
$prepared_args['search'] = $request['search'];
if ( '' !== $prepared_args['search'] ) {
if ( ! empty( $prepared_args['search'] ) ) {
$prepared_args['search'] = '*' . $prepared_args['search'] . '*';
}