Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

orders

// WP_Query arguments
$args = array(
	'post_type'              => array( 'shop_order' ),
	'post_status'            => array( 'wc-processing' ),
);

// The Query
$orders = new WP_Query( $args );

// The Loop
if ( $orders->have_posts() ) {
	while ( $orders->have_posts() ) {
		$orders->the_post();
		// do something
	}
} else {
	// no posts found
}

// Restore original Post Data
wp_reset_postdata();