Automattic\WooCommerce\Blocks\Templates
CartTemplate::is_active_template
True when viewing the cart page or cart endpoint.
Метод класса: CartTemplate{}
Хуков нет.
Возвращает
true|false.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->is_active_template();
Код CartTemplate::is_active_template() CartTemplate::is active template WC 11.0.1
protected function is_active_template() {
global $post;
$placeholder = $this->get_placeholder_page();
return null !== $placeholder && $post instanceof \WP_Post && $placeholder->post_name === $post->post_name;
}