wp_sitemaps_index_entry
Filters the sitemap entry for the sitemap index.
Использование
add_filter( 'wp_sitemaps_index_entry', 'wp_kama_sitemaps_index_entry_filter', 10, 4 ); /** * Function for `wp_sitemaps_index_entry` filter-hook. * * @param array $sitemap_entry Sitemap entry for the post. * @param string $object_type Object empty name. * @param string $object_subtype Object subtype name. Empty string if the object type does not support subtypes. * @param int $page Page number of results. * * @return array */ function wp_kama_sitemaps_index_entry_filter( $sitemap_entry, $object_type, $object_subtype, $page ){ // filter... return $sitemap_entry; }
- $sitemap_entry(массив)
- Sitemap entry for the post.
- $object_type(строка)
- Object empty name.
- $object_subtype(строка)
- Object subtype name. Empty string if the object type does not support subtypes.
- $page(int)
- Page number of results.
Список изменений
С версии 5.5.0 | Введена. |
Где вызывается хук
wp_sitemaps_index_entry
wp-includes/sitemaps/class-wp-sitemaps-provider.php 128
$sitemap_entry = apply_filters( 'wp_sitemaps_index_entry', $sitemap_entry, $this->object_type, $type['name'], $page );