Site icon Hip-Hop Website Design and Development

Get_posts not returning any posts when used with switch_to_blog

I am making an attempt to drag in some order data from the “shop_orderpost_type.

That is on a multisite community, so I am utilizing switch_to_blog(1). Once I set the put up sort as “put up” it really works nice and I get the posts from the proper website. Once I set the post_type to “shop_order” I get nothing, regardless of there being 20,000 ‘shop_order‘ data within the database.

switch_to_blog(1);
$args = array (
        //'post_type' => 'put up',
        'post_type' => 'shop_order',
        'posts_per_page' => 2,
        );
$posts = get_posts( $args );
restore_current_blog();
var_dump($posts);