Yoast\WP\SEO\Surfaces

Meta_Surface::for_home_page()publicYoast 1.0

Returns the meta tags context for the home page.

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

Хуков нет.

Возвращает

Meta|false. The meta values. False if none could be found.

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

$Meta_Surface = new Meta_Surface();
$Meta_Surface->for_home_page();

Код Meta_Surface::for_home_page() Yoast 22.4

public function for_home_page() {
	$front_page_id = (int) \get_option( 'page_on_front' );
	if ( \get_option( 'show_on_front' ) === 'page' && $front_page_id !== 0 ) {
		$indexable = $this->repository->find_by_id_and_type( $front_page_id, 'post' );

		if ( ! $indexable ) {
			return false;
		}

		return $this->build_meta( $this->context_memoizer->get( $indexable, 'Static_Home_Page' ) );
	}

	$indexable = $this->repository->find_for_home_page();

	if ( ! $indexable ) {
		return false;
	}

	return $this->build_meta( $this->context_memoizer->get( $indexable, 'Home_Page' ) );
}