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