Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change WooCommerce category dropdown to static list: If you don't like the empty 'Filter by category' dropdown then you can get the regular dropdown back. https://www.damiencarbery.com/2018/12/change-woocommerce-category-dropdown-to-static-list/
<?php
/*
Plugin Name: WooCommerce Category Dropdown in Products
Plugin URI: https://www.damiencarbery.com/2018/12/change-woocommerce-category-dropdown-to-static-list/
Description: Set the category dropdown to a static one in Products admin listing.
Author: Damien Carbery
Version: 0.1
*/
add_filter( 'woocommerce_product_category_filter_threshold', 'dcwd_categories_dropdown' );
function dcwd_categories_dropdown( $dropdown_cutoff ) {
return PHP_INT_MAX; // Ensure that the threshold is never reached.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment