WordPress at a glance
function is not described

WP_Sitemaps_Taxonomies::get_max_num_pages() public WP 5.5.0

Gets the max number of pages available for the object type.

It's a method of the class: WP_Sitemaps_Taxonomies{}

Return

Int. Total number of pages.

Usage

$WP_Sitemaps_Taxonomies = new WP_Sitemaps_Taxonomies();
$WP_Sitemaps_Taxonomies->get_max_num_pages( $taxonomy );
$taxonomy(string)
Taxonomy name.
Default: ''

Changelog

Since 5.5.0 Introduced.

Code of WP_Sitemaps_Taxonomies::get_max_num_pages() WP 5.5.1

<?php
public function get_max_num_pages( $taxonomy = '' ) {
	if ( empty( $taxonomy ) ) {
		return 0;
	}

	/**
	 * Filters the max number of pages before it is generated.
	 *
	 * Passing a non-null value will short-circuit the generation,
	 * returning that value instead.
	 *
	 * @since 5.5.0
	 *
	 * @param int    $max_num_pages The maximum number of pages. Default null.
	 * @param string $taxonomy      Taxonomy name.
	 */
	$max_num_pages = apply_filters( 'wp_sitemaps_taxonomies_pre_max_num_pages', null, $taxonomy );

	if ( null !== $max_num_pages ) {
		return $max_num_pages;
	}

	$term_count = wp_count_terms( $taxonomy, $this->get_taxonomies_query_args( $taxonomy ) );

	return (int) ceil( $term_count / wp_sitemaps_get_max_urls( $this->object_type ) );
}