wp_sitemaps_posts_show_on_front_entry
Filter HookDescription
Filters the sitemap entry for the home page when the 'show_on_front' option equals 'posts'.Hook Information
File Location |
wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php
View on GitHub
|
Hook Type | Filter |
Line Number | 145 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$sitemap_entry
|
Sitemap entry for the home page. |
Usage Examples
Basic Usage
<?php
// Hook into wp_sitemaps_posts_show_on_front_entry
add_filter('wp_sitemaps_posts_show_on_front_entry', 'my_custom_filter', 10, 1);
function my_custom_filter($sitemap_entry) {
// Your custom filtering logic here
return $sitemap_entry;
}
Source Code Context
wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php:145
- How this hook is used in WordPress core
<?php
140 *
141 * @since 5.5.0
142 *
143 * @param array $sitemap_entry Sitemap entry for the home page.
144 */
145 $sitemap_entry = apply_filters( 'wp_sitemaps_posts_show_on_front_entry', $sitemap_entry );
146 $url_list[] = $sitemap_entry;
147 }
148
149 foreach ( $query->posts as $post ) {
150 $sitemap_entry = array(
PHP Documentation
<?php
/**
* Filters the sitemap entry for the home page when the 'show_on_front' option equals 'posts'.
*
* @since 5.5.0
*
* @param array $sitemap_entry Sitemap entry for the home page.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php
Related Hooks
Related hooks will be displayed here in future updates.