WordPress filter hook

woocommerce_my_account_my_orders_query

Defined by WooCommerce and fired by 20 plugins in total, running on 7.1M+ sites between them.

How to use woocommerce_my_account_my_orders_query

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'woocommerce_my_account_my_orders_query', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

20 plugins that fire woocommerce_my_account_my_orders_query

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'customer' => get_current_user_id(), 'page' => $current_page, 'paginate' => true, ) ) includes/wc-template-functions.php:3868
  2. ShopEngine icon ShopEngine90,000+ installs apply_filters( 'woocommerce_my_account_my_orders_query', $query_arg ) widgets/lazy-cache.php:29
  3. Dokan: AI Powered WooCommerce Multivendor Marketplace Solution icon Dokan: AI Powered WooCommerce Multivendor Marketplace Solution30,000+ installs apply_filters( 'woocommerce_my_account_my_orders_query', $args ) includes/Order/Manager.php:425
  4. King Addons for Elementor icon King Addons for Elementor10,000+ installs apply_filters( 'woocommerce_my_account_my_orders_query', [ 'customer' => $user_id, 'page' => $paged, 'paginate' => true, 'limit' => $per_page, ] ) includes/widgets/Woo_My_Account_Orders/Woo_My_Account_Orders.php:134
  5. WP Crowdfunding icon WP Crowdfunding2,000+ installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'numberposts' => -1, 'post__in' => $order_ids, 'meta_key' => '_customer_user', 'post_type' => \wc_get_order_types( 'view-orders' ), 'post_status' => array_keys( wc_get_order_statuses() ), 'date_query' => array( array( 'after' => date( 'F jS, Y', strtotime( $from_date ) ), 'before' => array( 'year' => date( 'Y', strtotime( $to_date ) ), 'month' => date( 'm', strtotime( $to_date ) ), 'day'... ) includes/Functions.php:202
  6. StoreBuild icon StoreBuild400+ installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'posts_per_page' => -1, ) ) public/woocommerce/myaccount/dashboard.php:95
  7. Subaccounts for WooCommerce icon Subaccounts for WooCommerce200+ installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'customer' => $existing_children_ids, 'limit' => -1, ) ) public/my-account.php:1478
  8. Show Orders Shortcode for WooCommerce icon Show Orders Shortcode for WooCommerce100+ installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'customer' => get_current_user_id(), 'type' => 'shop_order', 'page' => 1, 'limit' => $order_count, 'paginate' => true, ) ) show-orders-shortcode-for-woocommerce.php:59
  9. PeproDev Ultimate Profile Solutions icon PeproDev Ultimate Profile Solutions70+ installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'customer' => get_current_user_id(), 'page' => $current_page, 'paginate' => true, 'limit' => -1, ) ) profile/libs/templates/modern/wc-orders.php:15
  10. Material Dashboard icon Material Dashboard40+ installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'meta_key' => '_customer_user', 'meta_value' => $uid == null ? get_current_user_id() : $uid, 'post_type' => wc_get_order_types( 'view-orders' ), 'post_status' => array_keys( wc_get_order_statuses() ), ) ) ext/woocommerce/functions.php:41
  11. BannerWoo icon BannerWoo10+ installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(), 'post_type' => wc_get_order_types( 'view-orders' ), 'post_status' => 'completed', ) ) includes/my-banners.php:11
  12. SaleDash icon SaleDash10+ installs apply_filters( 'woocommerce_my_account_my_orders_query', $args ) includes/api/class-w2w-rest-orders-controller.php:190
  13. Koin Official Payments for WooCommerce icon Koin Official Payments for WooCommerce10+ installs apply_filters( 'woocommerce_my_account_my_orders_query', [ 'customer' => get_current_user_id(), 'page' => $current_page, 'paginate' => true, 'payment_method' => [ "wc-koin-billet", "wc-koin-credit", "wc-koin-pix" ], 'status' => [ 'on-hold', 'processing', 'cancelled', 'completed', 'wc-awaiting-analysis', 'wc-awaiting-payment' ] ] ) app/Controllers/Render/KoinOrders.php:32
  14. IM WooCommerce My Account Widget icon IM WooCommerce My Account Widget10+ installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'numberposts' => -1, 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(), 'post_type' => wc_get_order_types( 'view-orders' ), 'post_status' => array_keys( wc_get_order_statuses() ) ) ) im-woocommerce-my-account-widget.php:178
  15. Thanh Toan The Cao Dien Thoai icon Thanh Toan The Cao Dien Thoai10+ installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'numberposts' => $order_count, 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(), 'post_type' => wc_get_order_types( 'view-orders' ), 'post_status' => array_keys( wc_get_order_statuses() ) ) ) templates/my-orders.php:20
  16. Alter Inventory icon Alter Inventory10+ installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'numberposts' => $order_count, 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(), 'post_type' => 'shop_order', 'post_status' => array('wc-processing', 'wc-completed'), 'posts_per_page' => -1, 'paged' => get_query_var('paged') ) ) admin/class-woocommerce-alter-inventory-admin.php:311
  17. Package Update Server for WooCommerce icon Package Update Server for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'customer' => get_current_user_id(), 'page' => $current_page, 'paginate' => true, ) ) includes/admin/views/template-purchased-downloadable-tokens.php:7
  18. Token Vendor for WooCommerce icon Token Vendor for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'customer' => get_current_user_id(), 'page' => $current_page, 'paginate' => true, ) ) includes/admin/views/template-purchased-tokens.php:7
  19. Advatix FEP API Connection icon Advatix FEP API ConnectionFewer than 10 installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'numberposts' => -1, 'post_type' => wc_get_order_types('view-orders'), 'post_status' => array_keys(wc_get_order_statuses()) ) ) includes/templates/admin-orders.php:8
  20. IPS Account for WooCommerce icon IPS Account for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_my_account_my_orders_query', array( 'customer' => get_current_user_id(), 'page' => $page, 'paginate' => true, ) ) includes/classes/Features/Templates/Orders/OrdersSectionController.php:89

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.