Filter hook 'wp_sitemaps_post_types'

in WP Core File wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php at line 49

View Source

wp_sitemaps_post_types

Filter Hook
Description
Filters the list of post object sub types available within the sitemap.

Hook Information

File Location wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php View on GitHub
Hook Type Filter
Line Number 49

Hook Parameters

Type Name Description
WP_Post_Type[] $post_types Array of registered post type objects keyed by their name.

Usage Examples

Basic Usage
<?php
// Hook into wp_sitemaps_post_types
add_filter('wp_sitemaps_post_types', 'my_custom_filter', 10, 1);

function my_custom_filter($post_types) {
    // Your custom filtering logic here
    return $post_types;
}

Source Code Context

wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php:49 - How this hook is used in WordPress core
<?php
  44  		 *
  45  		 * @since 5.5.0
  46  		 *
  47  		 * @param WP_Post_Type[] $post_types Array of registered post type objects keyed by their name.
  48  		 */
  49  		return apply_filters( 'wp_sitemaps_post_types', $post_types );
  50  	}
  51  
  52  	/**
  53  	 * Gets a URL list for a post type sitemap.
  54  	 *

PHP Documentation

<?php
/**
		 * Filters the list of post object sub types available within the sitemap.
		 *
		 * @since 5.5.0
		 *
		 * @param WP_Post_Type[] $post_types Array of registered post type objects keyed by their name.
		 */
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.