wpseo_sitemap_urlimages
Filter images to be included for the post in XML sitemap.
Использование
add_filter( 'wpseo_sitemap_urlimages', 'wp_kama_wpseo_sitemap_urlimages_filter', 10, 2 );
/**
* Function for `wpseo_sitemap_urlimages` filter-hook.
*
* @param array $images Array of image items.
* @param int $post_id ID of the post.
*
* @return array
*/
function wp_kama_wpseo_sitemap_urlimages_filter( $images, $post_id ){
// filter...
return $images;
}
- $images(массив)
- Array of image items.
- $post_id(int)
- ID of the post.
Где вызывается хук
wpseo_sitemap_urlimages
yoast/inc/sitemaps/class-sitemap-image-parser.php 127
$image_list = apply_filters( 'wpseo_sitemap_urlimages', $images, $post->ID );