Action Scheduler claims a batch of actions to process in each request. It keeps the batch fairly small (by default, 25) in order to prevent errors like memory exhaustion.
This filter increases or decreases it so that more/less actions are processed in each queue cycle, which can speed up or slow down overall processing time due to latency in requests and the minimum 1 minute between each queue being processed.
apply_filters( 'pmpro_action_scheduler_batch_size', $batch_size );
This method also sets the batch size to 0 (essentially pausing all action processing) if PMPro is paused or Action Scheduler is halted for any reason.
In PMPro we keep the same default as Action Scheduler itself, with a couple minor tweaks for known hosting environments Pantheon (50) and WPEngine (20), which both benefit from adjustments.
Parameters
- $batch_size
- int; The number of async actions to process per batch (default is 25 unless overridden).
Source
View in Source CodeAbout Actions and Filters in PMPro
Hooks allow you to extend Paid Memberships Pro without editing any core plugin files. You can use a hook to program custom code that interacts with or modifies code in our plugin, Add Ons, your theme, and even WordPress itself.
There are two kinds of hooks: actions and filters.
- Action hooks allow you to run new custom code at pre-defined locations.
- Filter hooks allow you to change or extend existing code by modifying the data and returning it back to the software.
Click here to browse the full database of action and filter hooks available in Paid Memberships Pro. For help extending our Add Ons, refer to the individual Add On's documentation page for a list of available hooks.
For more developer-focused information about Paid Memberships Pro, check out the advanced developer topics documentation.