Last active
December 23, 2015 23:39
-
-
Save nielsvr/6711405 to your computer and use it in GitHub Desktop.
Change the options of the WooCommerce orderby dropdown
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
<?php | |
// add in functions.php of your theme | |
// Change the options of the WooCommerce orderby dropdown | |
function modify_woocommerce_orderby( $orderby ) { | |
unset($orderby["popularity"]); | |
unset($orderby["pricemenu_orderdesc"]); | |
unset($orderby["rating"]); | |
unset($orderby["date"]); | |
// unset($orderby['menu_order']); | |
// unset($orderby['price']); | |
// unset($orderby['price-desc']); | |
return $orderby; | |
} | |
add_filter( "woocommerce_catalog_orderby", "modify_woocommerce_orderby", 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment