woocommerce_is_cart
Filter to allow for custom logic to determine if the cart page is being viewed.
Использование
add_filter( 'woocommerce_is_cart', 'wp_kama_woocommerce_is_cart_filter' );
/**
* Function for `woocommerce_is_cart` filter-hook.
*
* @param bool $is_cart Whether the cart page is being viewed.
*
* @return bool
*/
function wp_kama_woocommerce_is_cart_filter( $is_cart ){
// filter...
return $is_cart;
}
- $is_cart(true|false)
- Whether the cart page is being viewed.
Список изменений
| С версии 2.4.0 | Введена. |
Где вызывается хук
woocommerce_is_cart
woocommerce/includes/wc-conditional-functions.php 103
return apply_filters( 'woocommerce_is_cart', false ) || Constants::is_defined( 'WOOCOMMERCE_CART' ) || CartCheckoutUtils::is_cart_page();