WC_Log_Handler_Email::__construct() public WC 1.0
Constructor for log handler.
{} Это метод класса: WC_Log_Handler_Email{}
Хуков нет.
Возвращает
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 Log Handler Email:: construct WC 4.9.1
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' ) );
}