Yoast\WP\SEO\Helpers

Current_Page_Helper::is_home_static_page()publicYoast 1.0

Determine whether this is the static frontpage.

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

Хуков нет.

Возвращает

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

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

$result = Current_Page_Helper::is_home_static_page();

Код Current_Page_Helper::is_home_static_page() Yoast 22.4

public function is_home_static_page() {
	$wp_query = $this->wp_query_wrapper->get_main_query();

	if ( ! $wp_query->is_front_page() ) {
		return false;
	}

	if ( \get_option( 'show_on_front' ) !== 'page' ) {
		return false;
	}

	return $wp_query->is_page( \get_option( 'page_on_front' ) );
}