WPSEO_Post_Type_Sitemap_Provider::is_valid_post_type
Check if post type should be present in sitemaps.
Метод класса: WPSEO_Post_Type_Sitemap_Provider{}
Хуки из метода
Возвращает
true|false.
Использование
$WPSEO_Post_Type_Sitemap_Provider = new WPSEO_Post_Type_Sitemap_Provider(); $WPSEO_Post_Type_Sitemap_Provider->is_valid_post_type( $post_type );
- $post_type(строка) (обязательный)
- Post type string to check for.
Код WPSEO_Post_Type_Sitemap_Provider::is_valid_post_type() WPSEO Post Type Sitemap Provider::is valid post type Yoast 27.4
public function is_valid_post_type( $post_type ) {
if ( ! WPSEO_Post_Type::is_post_type_accessible( $post_type ) || ! WPSEO_Post_Type::is_post_type_indexable( $post_type ) ) {
return false;
}
/**
* Filter decision if post type is excluded from the XML sitemap.
*
* @param bool $exclude Default false.
* @param string $post_type Post type name.
*/
if ( apply_filters( 'wpseo_sitemap_exclude_post_type', false, $post_type ) ) {
return false;
}
return true;
}