wpseo_sitemap_(type)_content
Filter to add extra URLs to the XML sitemap by type.
Only runs for the first page, not on all.
Использование
add_filter( 'wpseo_sitemap_(type)_content', 'wp_kama_wpseo_sitemap_type_content_filter' ); /** * Function for `wpseo_sitemap_(type)_content` filter-hook. * * @param string $content String content to add. * * @return string */ function wp_kama_wpseo_sitemap_type_content_filter( $content ){ // filter... return $content; }
- $content(строка)
- String content to add.
По умолчанию: ''
Где вызывается хук
yoast/inc/sitemaps/class-sitemaps-renderer.php 129
$xml .= apply_filters( "wpseo_sitemap_{$type}_content", '' );