WC_Order::maybe_set_user_billing_email()protectedWC 1.0

Maybe set empty billing email to that of the user who owns the order.

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

Хуков нет.

Возвращает

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

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->maybe_set_user_billing_email();

Код WC_Order::maybe_set_user_billing_email() WC 8.7.0

protected function maybe_set_user_billing_email() {
	$user = $this->get_user();
	if ( ! $this->get_billing_email() && $user ) {
		try {
			$this->set_billing_email( $user->user_email );
		} catch ( WC_Data_Exception $e ) {
			unset( $e );
		}
	}
}