Code Duplication    Length = 5-7 lines in 2 locations

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

@@ 571-575 (lines=5) @@
568
			'posts_per_page' => -1,
569
		);
570
571
		if ( ! empty( $args['status'] ) ) {
572
			$statuses                  = 'wc-' . str_replace( ',', ',wc-', $args['status'] );
573
			$statuses                  = explode( ',', $statuses );
574
			$query_args['post_status'] = $statuses;
575
		}
576
577
		if ( ! empty( $args['customer_id'] ) ) {
578
			$query_args['meta_query'] = array(

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

@@ 727-733 (lines=7) @@
724
		);
725
726
		// add status argument
727
		if ( ! empty( $args['status'] ) ) {
728
			$statuses                  = 'wc-' . str_replace( ',', ',wc-', $args['status'] );
729
			$statuses                  = explode( ',', $statuses );
730
			$query_args['post_status'] = $statuses;
731
732
			unset( $args['status'] );
733
		}
734
735
		if ( ! empty( $args['customer_id'] ) ) {
736
			$query_args['meta_query'] = array(