wp_sitemaps_post_types filter-hookWP 5.5.0

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

Usage

add_filter( 'wp_sitemaps_post_types', 'wp_kama_sitemaps_post_types_filter' );

/**
 * Function for `wp_sitemaps_post_types` filter-hook.
 * 
 * @param WP_Post_Type[] $post_types Array of registered post type objects keyed by their name.
 *
 * @return WP_Post_Type[]
 */
function wp_kama_sitemaps_post_types_filter( $post_types ){

	// filter...
	return $post_types;
}
$post_types(WP_Post_Type[])
Array of registered post type objects keyed by their name.

Changelog

Since 5.5.0 Introduced.

Where the hook is called

WP_Sitemaps_Posts::get_object_subtypes()
wp_sitemaps_post_types
wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php 49
return apply_filters( 'wp_sitemaps_post_types', $post_types );

Where the hook is used in WordPress

Usage not found.