wpseo_sitemap_exclude_post_type
Filter decision if post type is excluded from the XML sitemap.
Использование
add_filter( 'wpseo_sitemap_exclude_post_type', 'wp_kama_wpseo_sitemap_exclude_post_type_filter', 10, 2 ); /** * Function for `wpseo_sitemap_exclude_post_type` filter-hook. * * @param bool $exclude Default false. * @param string $post_type Post type name. * * @return bool */ function wp_kama_wpseo_sitemap_exclude_post_type_filter( $exclude, $post_type ){ // filter... return $exclude; }
- $exclude(true|false)
- Default false.
- $post_type(строка)
- Post type name.
Где вызывается хук
wpseo_sitemap_exclude_post_type
yoast/inc/sitemaps/class-post-type-sitemap-provider.php 269
if ( apply_filters( 'wpseo_sitemap_exclude_post_type', false, $post_type ) ) {