woocommerce_cross_sells_total
Filter the number of cross sell products should on the product page.
Usage
add_filter( 'woocommerce_cross_sells_total', 'wp_kama_woocommerce_cross_sells_total_filter' ); /** * Function for `woocommerce_cross_sells_total` filter-hook. * * @param int $limit number of cross sell products. * * @return int */ function wp_kama_woocommerce_cross_sells_total_filter( $limit ){ // filter... return $limit; }
- $limit(int)
- number of cross sell products.
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
woocommerce_cross_sells_total
woocommerce/includes/wc-template-functions.php 2230
$limit = intval( apply_filters( 'woocommerce_cross_sells_total', $limit ) );