woocommerce_register_log_handlers
Filter the list of log handler class instances that will run whenever a log entry is added.
Использование
add_filter( 'woocommerce_register_log_handlers', 'wp_kama_woocommerce_register_log_handlers_filter' ); /** * Function for `woocommerce_register_log_handlers` filter-hook. * * @param WC_Log_Handler_Interface[] $array * * @return WC_Log_Handler_Interface[] */ function wp_kama_woocommerce_register_log_handlers_filter( $array ){ // filter... return $array; }
- $array(WC_Log_Handler_Interface[])
- -
Список изменений
С версии 3.0.0 | Введена. |
Где вызывается хук
woocommerce_register_log_handlers
woocommerce/includes/class-wc-logger.php 67
$handlers = apply_filters( 'woocommerce_register_log_handlers', array( $handler_instance ) );
Где используется хук в WooCommerce
woocommerce/includes/class-woocommerce.php 312
add_filter( 'woocommerce_register_log_handlers', array( $this, 'register_remote_log_handler' ) );