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

@@ 287-297 (lines=11) @@
284
			$args['post_status'] = 'any';
285
		}
286
287
		if ( ! empty( $request['customer'] ) ) {
288
			if ( ! empty( $args['meta_query'] ) ) {
289
				$args['meta_query'] = array();
290
			}
291
292
			$args['meta_query'][] = array(
293
				'key'   => '_customer_user',
294
				'value' => $request['customer'],
295
				'type'  => 'NUMERIC',
296
			);
297
		}
298
299
		// Search by product.
300
		if ( ! empty( $request['product'] ) ) {