wpseo_sitemap_public_url
Retrieves the XSL URL that should be used in the current environment
When home_url and site_url are not the same, the home_url should be used. This is because the XSL needs to be served from the same domain, protocol and port as the XML file that is loading it.
Использование
add_filter( 'wpseo_sitemap_public_url', 'wp_kama_wpseo_sitemap_public_url_filter' );
/**
* Function for `wpseo_sitemap_public_url` filter-hook.
*
* @param $home_url
*
* @return
*/
function wp_kama_wpseo_sitemap_public_url_filter( $home_url ){
// filter...
return $home_url;
}
- $home_url
- -
Где вызывается хук
wpseo_sitemap_public_url
yoast/inc/sitemaps/class-sitemaps-renderer.php 342
return apply_filters( 'wpseo_sitemap_public_url', home_url( 'main-sitemap.xsl' ) );