Created
June 4, 2020 01:54
-
-
Save jonmspencer/1d7274fd43c04764291a9176579e2060 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_product_filters', 'filter_by_custom_taxonomy_dashboard_products' ); | |
function filter_by_custom_taxonomy_dashboard_products( $output ) { | |
global $wp_query; | |
$output .= wc_product_dropdown_categories( array( | |
'show_option_none' => 'Filter by Model Year', | |
'taxonomy' => 'pa_model_year', | |
'name' => 'pa_model_year', | |
'selected' => isset( $wp_query->query_vars['pa_model_year'] ) ? $wp_query->query_vars['pa_model_year'] : '', | |
) ); | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment