wp_sitemaps_posts_pre_url_list filter-hookWP 5.5.0

Filters the posts URL list before it is generated.

Returning a non-null value will effectively short-circuit the generation, returning that value instead.

Usage

add_filter( 'wp_sitemaps_posts_pre_url_list', 'wp_kama_wp_sitemaps_posts_pre_url_list_filter', 10, 3 );
function wp_kama_wp_sitemaps_posts_pre_url_list_filter( $url_list, $post_type, $page_num ){
	// filter...

	return $url_list;
}
$url_list(array[]|null)
The URL list.
Default: null
$post_type(string)
Post type name.
$page_num(int)
Page of results.

Changelog

Since 5.5.0 Introduced.

Where the hook is called

WP_Sitemaps_Posts::get_url_list()
wp_sitemaps_posts_pre_url_list
wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php 87-92
$url_list = apply_filters(
	'wp_sitemaps_posts_pre_url_list',
	null,
	$post_type,
	$page_num
);

Where the hook is used in WordPress

Usage not found.