Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
Adding a hook callback - alphabet order - WooCommerce
// 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
You can’t perform that action at this time.