Advertisement
lorro

WooCommerce - Restore admin category dropdown

Oct 27th, 2017
1,614
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. <?php
  2. // restore old dropdown category filter on admin products page
  3. // snippet goes in functions.php for your child theme if you have one, or you can use the "My Custom Functions" plugin
  4. add_action( 'restrict_manage_posts', 'wcacd_category_dropdown', 15 );
  5. function wcacd_category_dropdown() {
  6.   // show the old dropdown category filter from WC 3.1.2
  7.   wc_product_dropdown_categories( array( 'option_select_text' => __( 'Filter by category', 'woocommerce' ) ) );
  8.   // hide the WC 3.2+ ajax category filter
  9.   print '<style>.post-type-product .tablenav div .select2 {display:none;}</style>';
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement