woocommerce_format_log_entry хук-фильтрWC 3.0.0

Filter the formatted log entry before it is written.

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

add_filter( 'woocommerce_format_log_entry', 'wp_kama_woocommerce_format_log_entry_filter', 10, 2 );

/**
 * Function for `woocommerce_format_log_entry` filter-hook.
 * 
 * @param string $entry The formatted entry.
 * @param array  $args  The raw data that gets assembled into a log entry.
 *
 * @return string
 */
function wp_kama_woocommerce_format_log_entry_filter( $entry, $args ){

	// filter...
	return $entry;
}
$entry(строка)
The formatted entry.
$args(массив)
The raw data that gets assembled into a log entry.

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

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

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

WC_Log_Handler::format_entry()
woocommerce_format_log_entry
LogHandlerFileV2::format_entry()
woocommerce_format_log_entry
woocommerce/includes/abstracts/abstract-wc-log-handler.php 54-63
return apply_filters(
	'woocommerce_format_log_entry',
	$entry,
	array(
		'timestamp' => $timestamp,
		'level'     => $level,
		'message'   => $message,
		'context'   => $context,
	)
);
woocommerce/src/Internal/Admin/Logging/LogHandlerFileV2.php 99-108
return apply_filters(
	'woocommerce_format_log_entry',
	$entry,
	array(
		'timestamp' => $timestamp,
		'level'     => $level,
		'message'   => $message,
		'context'   => $context,
	)
);

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

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