Yoast\WP\SEO\Helpers

Woocommerce_Helper::current_post_is_terms_and_conditions_page()publicYoast 1.0

Checks if the current page is a WooCommerce shop page.

Метод класса: Woocommerce_Helper{}

Хуков нет.

Возвращает

true|false. True when the page is a shop page.

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

$Woocommerce_Helper = new Woocommerce_Helper();
$Woocommerce_Helper->current_post_is_terms_and_conditions_page();

Код Woocommerce_Helper::current_post_is_terms_and_conditions_page() Yoast 22.4

public function current_post_is_terms_and_conditions_page() {
	if ( ! \function_exists( 'wc_terms_and_conditions_page_id' ) ) {
		return false;
	}

	global $post;

	if ( ! isset( $post->ID ) ) {
		return false;
	}

	return \intval( $post->ID ) === \intval( \wc_terms_and_conditions_page_id() );
}