Yoast\WP\SEO\Helpers

Current_Page_Helper::is_static_posts_page()publicYoast 1.0

Determine whether this is the static posts page.

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

Хуков нет.

Возвращает

true|false. Whether or not the current page is a static posts page.

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

$result = Current_Page_Helper::is_static_posts_page();

Код Current_Page_Helper::is_static_posts_page() Yoast 22.4

public function is_static_posts_page() {
	$wp_query       = $this->wp_query_wrapper->get_main_query();
	$queried_object = $wp_query->get_queried_object();

	return (
		$wp_query->is_posts_page
		&& \is_a( $queried_object, WP_Post::class )
		&& $queried_object->post_type === 'page'
	);
}