wpseo_xml_sitemap_img_src
Filter image URL to be included in XML sitemap for the post.
Использование
add_filter( 'wpseo_xml_sitemap_img_src', 'wp_kama_wpseo_xml_sitemap_img_src_filter', 10, 2 ); /** * Function for `wpseo_xml_sitemap_img_src` filter-hook. * * @param string $src Image URL. * @param object $post Post object. * * @return string */ function wp_kama_wpseo_xml_sitemap_img_src_filter( $src, $post ){ // filter... return $src; }
- $src(строка)
- Image URL.
- $post(объект)
- Post object.
Где вызывается хук
wpseo_xml_sitemap_img_src
yoast/inc/sitemaps/class-sitemap-image-parser.php 325
$image['src'] = apply_filters( 'wpseo_xml_sitemap_img_src', $src, $post );