Yoast\WP\SEO\Helpers
Post_Type_Helper::has_archive() public Yoast 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() Post Type Helper::has archive Yoast 15.6.2
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 ) );
}