wc_batch_processing_log_message
Filters the error message for a batch processing.
Использование
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(строка)
- 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(массив)
- The batch that was being processed.
- $error_context(массив)
- Context to be passed to the logging function.
Список изменений
| С версии 6.8.0 | Введена. |
Где вызывается хук
wc_batch_processing_log_message
woocommerce/src/Internal/BatchProcessing/BatchProcessingController.php 775
$error_message = apply_filters( 'wc_batch_processing_log_message', $error_message, $error, $batch_processor, $batch, $error_context );