Filter hook 'rest_get_max_batch_size'

in WP Core File wp-includes/rest-api/class-wp-rest-server.php at line 1709

View Source

rest_get_max_batch_size

Filter Hook
Description
Filters the maximum number of REST API requests that can be included in a batch.

Hook Information

File Location wp-includes/rest-api/class-wp-rest-server.php View on GitHub
Hook Type Filter
Line Number 1709

Hook Parameters

Type Name Description
int $max_size The maximum size.

Usage Examples

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

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

Source Code Context

wp-includes/rest-api/class-wp-rest-server.php:1709 - How this hook is used in WordPress core
<?php
1704  		 *
1705  		 * @since 5.6.0
1706  		 *
1707  		 * @param int $max_size The maximum size.
1708  		 */
1709  		return apply_filters( 'rest_get_max_batch_size', 25 );
1710  	}
1711  
1712  	/**
1713  	 * Serves the batch/v1 request.
1714  	 *

PHP Documentation

<?php
/**
		 * Filters the maximum number of REST API requests that can be included in a batch.
		 *
		 * @since 5.6.0
		 *
		 * @param int $max_size The maximum size.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/rest-api/class-wp-rest-server.php
Related Hooks

Related hooks will be displayed here in future updates.