woocommerce_catalog_orderby
Usage
add_filter( 'woocommerce_catalog_orderby', 'wp_kama_woocommerce_catalog_orderby_filter' ); /** * Function for `woocommerce_catalog_orderby` filter-hook. * * @param $array * * @return */ function wp_kama_woocommerce_catalog_orderby_filter( $array ){ // filter... return $array; }
- $array
- -
Where the hook is called
woocommerce_catalog_orderby
woocommerce/includes/wc-template-functions.php 1503-1513
$catalog_orderby_options = apply_filters( 'woocommerce_catalog_orderby', array( 'menu_order' => __( 'Default sorting', 'woocommerce' ), 'popularity' => __( 'Sort by popularity', 'woocommerce' ), 'rating' => __( 'Sort by average rating', 'woocommerce' ), 'date' => __( 'Sort by latest', 'woocommerce' ), 'price' => __( 'Sort by price: low to high', 'woocommerce' ), 'price-desc' => __( 'Sort by price: high to low', 'woocommerce' ), ) );