woocommerce_product_meta_category_orderby
Filters the ordering mode for product categories in the single product meta.
Usage
add_filter( 'woocommerce_product_meta_category_orderby', 'wp_kama_woocommerce_product_meta_category_orderby_filter', 10, 2 );
/**
* Function for `woocommerce_product_meta_category_orderby` filter-hook.
*
* @param string $orderby Ordering mode passed to wc_get_product_category_list().
* @param WC_Product $product Product object.
*
* @return string
*/
function wp_kama_woocommerce_product_meta_category_orderby_filter( $orderby, $product ){
// filter...
return $orderby;
}
- $orderby(string)
- Ordering mode passed to wc_get_product_category_list().
- $product(WC_Product)
- Product object.
Changelog
| Since 11.2.0 | Introduced. |
Where the hook is called
In file: /templates/single-product/meta.php
woocommerce/templates/single-product/meta.php 45
$product_category_orderby = apply_filters( 'woocommerce_product_meta_category_orderby', 'breadcrumb', $product );