Skip to content

Instantly share code, notes, and snippets.

@conschneider
Last active December 20, 2018 09:40
Show Gist options
  • Save conschneider/70ed39c3fe1a379d92300cc143743354 to your computer and use it in GitHub Desktop.
Save conschneider/70ed39c3fe1a379d92300cc143743354 to your computer and use it in GitHub Desktop.
WooCommerce WordPress 5.0.2 orders tab fix - fixes the empty all orders tab in WooCommerce after updating to WordPress 5.0.2
if(version_compare(get_option( 'woocommerce_version' ),"3.5.2","<=") && version_compare(get_bloginfo( 'version' ),"5.0.2","=") ){
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