wpseo_exclude_from_sitemap_by_post_ids
Filter: wpseo_exclude_from_sitemap_by_post_ids Allow extending and modifying the posts to exclude.
Использование
add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', 'wp_kama_wpseo_exclude_from_sitemap_by_post_ids_filter' ); /** * Function for `wpseo_exclude_from_sitemap_by_post_ids` filter-hook. * * @param array $posts_to_exclude The posts to exclude. * * @return array */ function wp_kama_wpseo_exclude_from_sitemap_by_post_ids_filter( $posts_to_exclude ){ // filter... return $posts_to_exclude; }
- $posts_to_exclude(массив)
- The posts to exclude.
Где вызывается хук
wpseo_exclude_from_sitemap_by_post_ids
yoast/inc/sitemaps/class-post-type-sitemap-provider.php 296
$excluded_posts_ids = apply_filters( 'wpseo_exclude_from_sitemap_by_post_ids', $excluded_posts_ids );