How to get woocommerce orders with get_posts method in a shortcode

I found a solution to the problem, here is the code below. I just can’t get the pagination to work yet. Everything else works fine. Shortcode add_shortcode( ‘all_orders’ , ‘prc_orders’ ); function prc_orders() { // Get all orders for the current user. $customer = get_posts(apply_filters(‘woocommerce_my_account_my_orders_query’, array( ‘numberposts’ => -1, ‘meta_key’ => ‘_customer_user’, ‘meta_value’ => get_current_user_id(), … Read more