Filter hook 'wp_sitemaps_users_pre_max_num_pages'

in WP Core File wp-includes/sitemaps/providers/class-wp-sitemaps-users.php at line 111

View Source

wp_sitemaps_users_pre_max_num_pages

Filter Hook
Description
Filters the max number of pages for a user sitemap before it is generated. Returning a non-null value will effectively short-circuit the generation, returning that value instead.

Hook Information

File Location wp-includes/sitemaps/providers/class-wp-sitemaps-users.php View on GitHub
Hook Type Filter
Line Number 111

Hook Parameters

Type Name Description
int|null $max_num_pages The maximum number of pages. Default null.

Usage Examples

Basic Usage
<?php
// Hook into wp_sitemaps_users_pre_max_num_pages
add_filter('wp_sitemaps_users_pre_max_num_pages', 'my_custom_filter', 10, 1);

function my_custom_filter($max_num_pages) {
    // Your custom filtering logic here
    return $max_num_pages;
}

Source Code Context

wp-includes/sitemaps/providers/class-wp-sitemaps-users.php:111 - How this hook is used in WordPress core
<?php
 106  		 *
 107  		 * @since 5.5.0
 108  		 *
 109  		 * @param int|null $max_num_pages The maximum number of pages. Default null.
 110  		 */
 111  		$max_num_pages = apply_filters( 'wp_sitemaps_users_pre_max_num_pages', null );
 112  
 113  		if ( null !== $max_num_pages ) {
 114  			return $max_num_pages;
 115  		}
 116  

PHP Documentation

<?php
/**
		 * Filters the max number of pages for a user sitemap before it is generated.
		 *
		 * Returning a non-null value will effectively short-circuit the generation,
		 * returning that value instead.
		 *
		 * @since 5.5.0
		 *
		 * @param int|null $max_num_pages The maximum number of pages. Default null.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/sitemaps/providers/class-wp-sitemaps-users.php
Related Hooks

Related hooks will be displayed here in future updates.