Code Duplication    Length = 11-11 lines in 2 locations

includes/cli/class-wc-cli-product.php 1 location

@@ 707-717 (lines=11) @@
704
		}
705
706
		// Filter by specific sku
707
		if ( ! empty( $args['sku'] ) ) {
708
			if ( ! is_array( $query_args['meta_query'] ) ) {
709
				$query_args['meta_query'] = array();
710
			}
711
712
			$query_args['meta_query'][] = array(
713
				'key'     => '_sku',
714
				'value'   => $args['sku'],
715
				'compare' => '='
716
			);
717
		}
718
719
		return $query_args;
720
	}

includes/api/class-wc-rest-orders-controller.php 1 location

@@ 293-303 (lines=11) @@
290
			$args['post_status'] = 'any';
291
		}
292
293
		if ( ! empty( $request['customer'] ) ) {
294
			if ( ! empty( $args['meta_query'] ) ) {
295
				$args['meta_query'] = array();
296
			}
297
298
			$args['meta_query'][] = array(
299
				'key'   => '_customer_user',
300
				'value' => $request['customer'],
301
				'type'  => 'NUMERIC',
302
			);
303
		}
304
305
		// Search by product.
306
		if ( ! empty( $request['product'] ) ) {