wc_batch_processing_log_message
Filters the error message for a batch processing.
Usage
add_filter( 'wc_batch_processing_log_message', 'wp_kama_wc_batch_processing_log_message_filter', 10, 5 );
/**
* Function for `wc_batch_processing_log_message` filter-hook.
*
* @param string $error_message The error message that will be logged.
* @param \Exception $error The exception that was thrown by the processor.
* @param BatchProcessorInterface $batch_processor The processor that threw the exception.
* @param array $batch The batch that was being processed.
* @param array $error_context Context to be passed to the logging function.
*
* @return string
*/
function wp_kama_wc_batch_processing_log_message_filter( $error_message, $error, $batch_processor, $batch, $error_context ){
// filter...
return $error_message;
}
- $error_message(string)
- The error message that will be logged.
- $error(\Exception)
- The exception that was thrown by the processor.
- $batch_processor(BatchProcessorInterface)
- The processor that threw the exception.
- $batch(array)
- The batch that was being processed.
- $error_context(array)
- Context to be passed to the logging function.
Changelog
| Since 6.8.0 | Introduced. |
Where the hook is called
wc_batch_processing_log_message
woocommerce/src/Internal/BatchProcessing/BatchProcessingController.php 474
$error_message = apply_filters( 'wc_batch_processing_log_message', $error_message, $error, $batch_processor, $batch, $error_context );