WordPress at a glance
function is not described

WP_Sitemaps_Users::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_Users{}

Hooks from the method
Return

Int. Total page count.

Usage

$WP_Sitemaps_Users = new WP_Sitemaps_Users();
$WP_Sitemaps_Users->get_max_num_pages( $object_subtype );
$object_subtype(string)
Not applicable for Users but required for compatibility with the parent provider class.
Default: ''

Notes

  • See: WP_Sitemaps_Provider::max_num_pages

Changelog

Since 5.5.0 Introduced.

Code of WP_Sitemaps_Users::get_max_num_pages() WP 5.5.1

<?php
public function get_max_num_pages( $object_subtype = '' ) {
	/**
	 * Filters the max number of pages before it is generated.
	 *
	 * Passing a non-null value will effectively short-circuit the generation,
	 * returning that value instead.
	 *
	 * @since 5.5.0
	 *
	 * @param int $max_num_pages The maximum number of pages. Default null.
	 */
	$max_num_pages = apply_filters( 'wp_sitemaps_users_pre_max_num_pages', null );

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

	$args  = $this->get_users_query_args();
	$query = new WP_User_Query( $args );

	$total_users = $query->get_total();

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