wc_batch_processing_log_message хук-фильтрWC 6.8.0

Filters the error message for a batch processing.

Использование

add_filter( 'wc_batch_processing_log_message', 'wp_kama_wc_batch_processing_log_message_filter', 10, 4 );

/**
 * 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.
 *
 * @return string
 */
function wp_kama_wc_batch_processing_log_message_filter( $error_message, $error, $batch_processor, $batch ){

	// 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.

Список изменений

С версии 6.8.0 Введена.

Где вызывается хук

BatchProcessingController::log_error()
wc_batch_processing_log_message
woocommerce/src/Internal/BatchProcessing/BatchProcessingController.php 394
$error_message = apply_filters( 'wc_batch_processing_log_message', $error_message, $error, $batch_processor, $batch );

Где используется хук в WooCommerce

Использование не найдено.