WordPress at Your Fingertips
function is not described

WC_Log_Handler_Email::__construct() public WC 1.0

Constructor for log handler.

{} It's a method of the class: WC_Log_Handler_Email{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Log_Handler_Email = new WC_Log_Handler_Email();
$WC_Log_Handler_Email->__construct( $recipients, $threshold );
$recipients(string|array)
Email(s) to receive log messages.
Default: site admin email
$threshold(string)
Minimum level that should receive log messages. One of: emergency|alert|critical|error|warning|notice|info|debug.
Default: 'alert'

Code of WC_Log_Handler_Email::__construct() WC 5.8.0

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' ) );
}