wp_sitemaps_taxonomies_pre_max_num_pages filter-hookWP 5.5.0

Filters the max number of pages for a taxonomy sitemap before it is generated.

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


add_filter( 'wp_sitemaps_taxonomies_pre_max_num_pages', 'wp_kama_sitemaps_taxonomies_pre_max_num_pages_filter', 10, 2 );

 * Function for `wp_sitemaps_taxonomies_pre_max_num_pages` filter-hook.
 * @param int|null $max_num_pages The maximum number of pages.
 * @param string   $taxonomy      Taxonomy name.
 * @return int|null
function wp_kama_sitemaps_taxonomies_pre_max_num_pages_filter( $max_num_pages, $taxonomy ){

	// filter...
	return $max_num_pages;
The maximum number of pages.
Default: null
Taxonomy name.


Since 5.5.0 Introduced.

Where the hook is called

wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php 166
$max_num_pages = apply_filters( 'wp_sitemaps_taxonomies_pre_max_num_pages', null, $taxonomy );

Where the hook is used in WordPress

Usage not found.