Fix: product type filter should show selected product type
Since admin lists were refactored in8f37ea33ed
, a bug was introduced that prevented the "Filter by product type" select box in the products list page in the admin from showing the selected product type when filtering by "Downloadable" products. Before marking this option as selected, the code was checking if `$wp_query->query['product_type']` is set. This check made sense before the refactor (see8f37ea33ed (diff-a116210e8adc50b0853846ba935daaadL1544)
) but it doesn't make sense anymore. In the new method, `$wp_query` is not even used.
This commit is contained in:
parent
ffc5fc6b74
commit
49855b4676
|
@ -340,17 +340,11 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
|
|||
if ( 'simple' === $term->name ) {
|
||||
|
||||
$output .= '<option value="downloadable" ';
|
||||
|
||||
if ( isset( $wp_query->query['product_type'] ) ) {
|
||||
$output .= selected( 'downloadable', $current_product_type, false );
|
||||
}
|
||||
|
||||
$output .= selected( 'downloadable', $current_product_type, false );
|
||||
$output .= '> ' . ( is_rtl() ? '←' : '→' ) . ' ' . __( 'Downloadable', 'woocommerce' ) . '</option>';
|
||||
|
||||
$output .= '<option value="virtual" ';
|
||||
|
||||
$output .= selected( 'virtual', $current_product_type, false );
|
||||
|
||||
$output .= '> ' . ( is_rtl() ? '←' : '→' ) . ' ' . __( 'Virtual', 'woocommerce' ) . '</option>';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue