Yoast\WP\SEO\Helpers

Post_Type_Helper::is_post_type_archive_indexable()publicYoast 1.0

Checks if the archive of a post type is indexable.

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

Хуков нет.

Возвращает

true|false. if the archive is indexable.

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

$Post_Type_Helper = new Post_Type_Helper();
$Post_Type_Helper->is_post_type_archive_indexable( $post_type );
$post_type(строка) (обязательный)
The post type to check.

Код Post_Type_Helper::is_post_type_archive_indexable() Yoast 24.3

public function is_post_type_archive_indexable( $post_type ) {
	$public_type_objects = $this->get_indexable_post_archives();
	$public_types        = \array_map(
		static function ( $post_type_object ) {
			return $post_type_object->name;
		},
		$public_type_objects
	);

	return \in_array( $post_type, $public_types, true );
}