wp_sitemaps_index_entry
Filter HookDescription
Filters the sitemap entry for the sitemap index.Hook Information
File Location |
wp-includes/sitemaps/class-wp-sitemaps-provider.php
View on GitHub
|
Hook Type | Filter |
Line Number | 128 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$sitemap_entry
|
Sitemap entry for the post. |
string
|
$object_type
|
Object empty name. |
string
|
$object_subtype
|
Object subtype name. Empty string if the object type does not support subtypes. |
int
|
$page
|
Page number of results. |
Usage Examples
Basic Usage
<?php
// Hook into wp_sitemaps_index_entry
add_filter('wp_sitemaps_index_entry', 'my_custom_filter', 10, 4);
function my_custom_filter($sitemap_entry, $object_type, $object_subtype, $page) {
// Your custom filtering logic here
return $sitemap_entry;
}
Source Code Context
wp-includes/sitemaps/class-wp-sitemaps-provider.php:128
- How this hook is used in WordPress core
<?php
123 * @param string $object_type Object empty name.
124 * @param string $object_subtype Object subtype name.
125 * Empty string if the object type does not support subtypes.
126 * @param int $page Page number of results.
127 */
128 $sitemap_entry = apply_filters( 'wp_sitemaps_index_entry', $sitemap_entry, $this->object_type, $type['name'], $page );
129
130 $sitemaps[] = $sitemap_entry;
131 }
132 }
133
PHP Documentation
<?php
/**
* Filters the sitemap entry for the sitemap index.
*
* @since 5.5.0
*
* @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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-includes/sitemaps/class-wp-sitemaps-provider.php
Related Hooks
Related hooks will be displayed here in future updates.