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.

Example Usage

In this example, we will set the batch size to 15. The default batch size shipped with version 4.0 was 10.

/**
 * 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 15;
}
add_filter( 'iaffpro_bu_batch_size', 'prefix_iap_modify_bu_batch_size' );