woocommerce_default_catalog_orderby_options
phpcs:disable WooCommerce.Commenting.CommentHooks.MissingHookComment
Usage
add_filter( 'woocommerce_default_catalog_orderby_options', 'wp_kama_woocommerce_default_catalog_orderby_options_filter' ); /** * Function for `woocommerce_default_catalog_orderby_options` filter-hook. * * @param $array * * @return */ function wp_kama_woocommerce_default_catalog_orderby_options_filter( $array ){ // filter... return $array; }
- $array
- -
Where the hook is called
woocommerce_default_catalog_orderby_options
woocommerce_default_catalog_orderby_options
woocommerce/includes/customizer/class-wc-shop-customizer.php 325-335
$options = apply_filters( 'woocommerce_default_catalog_orderby_options', array( 'menu_order' => __( 'Default sorting (custom ordering + name)', 'woocommerce' ), 'popularity' => __( 'Popularity (sales)', 'woocommerce' ), 'rating' => __( 'Average rating', 'woocommerce' ), 'date' => __( 'Sort by most recent', 'woocommerce' ), 'price' => __( 'Sort by price (asc)', 'woocommerce' ), 'price-desc' => __( 'Sort by price (desc)', 'woocommerce' ), ) );
woocommerce/includes/customizer/class-wc-shop-customizer.php 496-506
'choices' => apply_filters( 'woocommerce_default_catalog_orderby_options', array( 'menu_order' => __( 'Default sorting (custom ordering + name)', 'woocommerce' ), 'popularity' => __( 'Popularity (sales)', 'woocommerce' ), 'rating' => __( 'Average rating', 'woocommerce' ), 'date' => __( 'Sort by most recent', 'woocommerce' ), 'price' => __( 'Sort by price (asc)', 'woocommerce' ), 'price-desc' => __( 'Sort by price (desc)', 'woocommerce' ), ) ),