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