Skip to content

Instantly share code, notes, and snippets.

@digitalchild
Last active November 28, 2023 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitalchild/f9a3ac6840eb01561c8d9dbdc589c414 to your computer and use it in GitHub Desktop.
Save digitalchild/f9a3ac6840eb01561c8d9dbdc589c414 to your computer and use it in GitHub Desktop.
Fix for no orders found WooCommerce
<?php
// Found https://core.trac.wordpress.org/ticket/45719
function fix_request_query_args_for_woocommerce( $query_args ) {
if ( isset( $query_args['post_status'] ) && empty( $query_args['post_status'] ) ) {
unset( $query_args['post_status'] );
}
return $query_args;
}
add_filter( 'request', 'fix_request_query_args_for_woocommerce', 1, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment