Yoast\WP\SEO\Surfaces

Meta_Surface::for_post_type_archive()publicYoast 1.0

Returns the meta tags context for a post type archive.

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

Хуков нет.

Возвращает

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

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

$Meta_Surface = new Meta_Surface();
$Meta_Surface->for_post_type_archive( $post_type );
$post_type(строка|null)
The post type to get the archive meta for.
По умолчанию: current post type

Код Meta_Surface::for_post_type_archive() Yoast 22.4

public function for_post_type_archive( $post_type = null ) {
	if ( $post_type === null ) {
		$post_type = \get_post_type();
	}

	$indexable = $this->repository->find_for_post_type_archive( $post_type );

	if ( ! $indexable ) {
		return false;
	}

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