Opened 4 years ago
Closed 4 years ago
#45719 closed defect (bug) (wontfix)
Setting an empty post_status in wp_edit_posts_query() breaks WooCommerce list tables
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.0.2 |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
[44185] sets the post_status
to an empty string, rather than leaving it unset.
WooCommerce checks this query var using isset()
rather than empty()
on the Orders screen, which results in no orders showing in that list table.
Change History (9)
#3
@
4 years ago
Again, I think these empty strings should be replaced with null
, which will work as expected with isset
This ticket was mentioned in Slack in #forums by yui. View the logs.
4 years ago
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
4 years ago
Note: See
TracTickets for help on using
tickets.
Here's a workaround:
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 );