Last active
August 29, 2015 14:19
-
-
Save chrdesigner/678981ecac3f38b5f12e to your computer and use it in GitHub Desktop.
Adding a hook callback - alphabet order - WooCommerce
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 | |
// Adding a hook callback. | |
add_filter( 'woocommerce_default_catalog_orderby_options', 'custom_woocommerce_catalog_orderby' ); | |
add_filter( 'woocommerce_catalog_orderby', 'custom_woocommerce_catalog_orderby' ); | |
function custom_woocommerce_catalog_orderby( $sortby ) { | |
$sortby['title_asc'] = __('Alphabetical - (A - Z)', 'your-theme'); | |
$sortby['title_desc'] = __('Alphabetical - (Z - A)', 'your-theme'); | |
return $sortby; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment