Fixe the return type of wc_order_search()
This commit is contained in:
parent
b3dbd93df5
commit
c9a3ce465f
|
@ -1516,7 +1516,7 @@ class WC_Admin_Post_Types {
|
|||
|
||||
$post_ids = wc_order_search( $_GET['s'] );
|
||||
|
||||
if ( is_array( $post_ids ) ) {
|
||||
if ( ! empty( $post_ids ) ) {
|
||||
// Remove "s" - we don't want to search order name.
|
||||
unset( $wp->query_vars['s'] );
|
||||
|
||||
|
|
|
@ -431,7 +431,7 @@ class WC_REST_Orders_Controller extends WC_REST_Posts_Controller {
|
|||
if ( ! empty( $args['s'] ) ) {
|
||||
$order_ids = wc_order_search( $args['s'] );
|
||||
|
||||
if ( is_array( $order_ids ) ) {
|
||||
if ( ! empty( $order_ids ) ) {
|
||||
unset( $args['s'] );
|
||||
$args['post__in'] = array_merge( $order_ids, array( 0 ) );
|
||||
}
|
||||
|
|
|
@ -993,7 +993,7 @@ function wc_order_search( $term ) {
|
|||
global $wpdb;
|
||||
|
||||
$term = str_replace( 'Order #', '', wc_clean( $term ) );
|
||||
$post_ids = false;
|
||||
$post_ids = array();
|
||||
|
||||
// Search fields.
|
||||
$search_fields = array_map( 'wc_clean', apply_filters( 'woocommerce_shop_order_search_fields', array(
|
||||
|
|
Loading…
Reference in New Issue