wpseo_xml_sitemap_post_url хук-фильтрYoast 1.0

Filter the URL Yoast SEO uses in the XML sitemap.

Note that only absolute local URLs are allowed as the check after this removes external URLs.


add_filter( 'wpseo_xml_sitemap_post_url', 'wp_kama_wpseo_xml_sitemap_post_url_filter', 10, 2 );
function wp_kama_wpseo_xml_sitemap_post_url_filter( $url, $post ){
	// filter...

	return $url;
URL to use in the XML sitemap
Post object for the URL.

Где вызывается хук

yoast/inc/sitemaps/class-post-type-sitemap-provider.php 614
$url['loc'] = apply_filters( 'wpseo_xml_sitemap_post_url', get_permalink( $post ), $post );

Где используется хук в Yoast SEO

Использование не найдено.