Skip to content

Instantly share code, notes, and snippets.

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 jonmspencer/1d7274fd43c04764291a9176579e2060 to your computer and use it in GitHub Desktop.
Save jonmspencer/1d7274fd43c04764291a9176579e2060 to your computer and use it in GitHub Desktop.
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