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

@@ 403-413 (lines=11) @@
400
			$args['post_status'] = 'any';
401
		}
402
403
		if ( ! empty( $request['customer'] ) ) {
404
			if ( ! empty( $args['meta_query'] ) ) {
405
				$args['meta_query'] = array();
406
			}
407
408
			$args['meta_query'][] = array(
409
				'key'   => '_customer_user',
410
				'value' => $request['customer'],
411
				'type'  => 'NUMERIC',
412
			);
413
		}
414
415
		if ( ! empty( $request['product'] ) ) {
416
			$order_ids = $wpdb->get_col( $wpdb->prepare( "