WP_REST_Server::get_max_batch_size() WordPress Method

The WP_REST_Server::get_max_batch_size() function is used to get the maximum number of items that can be requested in a batch request. This can be useful when making large requests that may need to be divided into smaller batches in order to not exceed the maximum batch size.

WP_REST_Server::get_max_batch_size() #

Gets the maximum number of requests that can be included in a batch.


Return

(int) The maximum requests.


Top ↑

Source

File: wp-includes/rest-api/class-wp-rest-server.php

	protected function get_max_batch_size() {
		/**
		 * 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.
		 */
		return apply_filters( 'rest_get_max_batch_size', 25 );
	}


Top ↑

Changelog

Changelog
VersionDescription
5.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.