iaffpro_bu_batch_size

Modify the batch size of the bulk updater of Image Attributes Pro. This filter can be used to increase or decrease the default batch size.

A higher batch size means more images are processed in the same batch. Make sure your server is capable of handling the load or else it could lead to PHP time outs. You should be fine with 20-50 images per batch on most servers.

/**
 * Filter the Bulk Updater batch size.
 * 
 * @since 4.1
 * 
 * @param $batch_size (int) Defines the number of images that will be 
 * processed in a single call to the function. 
 * Higher batch sizes can lead to PHP time outs.
 */
$batch_size = apply_filters( 'iaffpro_bu_batch_size', $batch_size );

Available since Image Attributes Pro version 4.1. The default batch size shipped with version 4.0 was 10 which was later updated in version 4.2 to 20.

Image Attributes Pro version 4.2 and later varies the images per batch based on the server conditions. However, if you override the default batch size using this filter, the variable batch size is not used.

Example Usage

In this example, we will set the batch size to 40.

/**
 * Modify Image Attributes Pro Bulk Updater batch size.
 *
 * @link https://imageattributespro.com/codex/iaffpro_bu_batch_size/
 *  
 * @param $batch_size (int) Defines the number of images that will be 
 * processed in a single call to the function.
 * 
 * @return (int) New batch size.
 */
function prefix_iap_modify_bu_batch_size( $batch_size ) {
	return 40;
}
add_filter( 'iaffpro_bu_batch_size', 'prefix_iap_modify_bu_batch_size' );
Was this article helpful?
Yes, thanks! 👍Not really 👎