WC_Log_Handler_Email::__construct()publicWC 1.0

Constructor for log handler.

Метод класса: WC_Log_Handler_Email{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$WC_Log_Handler_Email = new WC_Log_Handler_Email();
$WC_Log_Handler_Email->__construct( $recipients, $threshold );
$recipients(строка|массив)
Email(s) to receive log messages.
По умолчанию: site admin email
$threshold(строка)
Minimum level that should receive log messages. One of: emergency|alert|critical|error|warning|notice|info|debug.
По умолчанию: 'alert'

Код WC_Log_Handler_Email::__construct() WC 9.4.2

public function __construct( $recipients = null, $threshold = 'alert' ) {
	if ( null === $recipients ) {
		$recipients = get_option( 'admin_email' );
	}

	if ( is_array( $recipients ) ) {
		foreach ( $recipients as $recipient ) {
			$this->add_email( $recipient );
		}
	} else {
		$this->add_email( $recipients );
	}

	$this->set_threshold( $threshold );
	add_action( 'shutdown', array( $this, 'send_log_email' ) );
}