Yoast\WP\SEO\Helpers

Post_Type_Helper::has_archive()publicYoast 1.0

Checks if the post type with the given name has an archive page.

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

Хуков нет.

Возвращает

true|false. True when the post type has an archive page.

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

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

Код Post_Type_Helper::has_archive() Yoast 22.4

public function has_archive( $post_type ) {
	if ( \is_string( $post_type ) ) {
		$post_type = \get_post_type_object( $post_type );
	}

	return ( ! empty( $post_type->has_archive ) );
}