wpseo_sitemap_post_type_archive_link
Filter the URL Yoast SEO uses in the XML sitemap for this post type archive.
Использование
add_filter( 'wpseo_sitemap_post_type_archive_link', 'wp_kama_wpseo_sitemap_post_type_archive_link_filter', 10, 2 ); /** * Function for `wpseo_sitemap_post_type_archive_link` filter-hook. * * @param string $archive_url The URL of this archive * @param string $post_type The post type this archive is for. * * @return string */ function wp_kama_wpseo_sitemap_post_type_archive_link_filter( $archive_url, $post_type ){ // filter... return $archive_url; }
- $archive_url(строка)
- The URL of this archive
- $post_type(строка)
- The post type this archive is for.
Где вызывается хук
wpseo_sitemap_post_type_archive_link
yoast/inc/sitemaps/class-post-type-sitemap-provider.php 404-408
$archive_url = apply_filters( 'wpseo_sitemap_post_type_archive_link', $this->get_post_type_archive_link( $post_type ), $post_type );