Automattic\WooCommerce\Internal\Email

DeferredEmailQueue::restore_email_from_queued_locale │ public │ WC 1.0

Restore the runner's locale after an email switched by switch_email_to_queued_locale(), from WC_Email::restore_locale().

Method of the class: DeferredEmailQueue{}

No Hooks.

Returns

mixed. The unchanged $allow.

Usage

$DeferredEmailQueue = new DeferredEmailQueue();
$DeferredEmailQueue->restore_email_from_queued_locale( $allow, $email );
$allow(mixed) (required)
Whether the email may restore its locale.
$email(mixed) (required)
The email being restored.

DeferredEmailQueue::restore_email_from_queued_locale() code WC 11.3.0

public function restore_email_from_queued_locale( $allow, $email ) {
	if ( is_object( $email ) && end( $this->switched_emails ) === spl_object_id( $email ) ) {
		array_pop( $this->switched_emails );
		$this->restore_runner_locale();
	}

	return $allow;
}