woocommerce_is_cart хук-фильтрWC 2.4.0

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 Введена.

Где вызывается хук

is_cart()
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();

Где используется хук в WooCommerce

Использование не найдено.