Automattic\WooCommerce\Internal\CustomerEmailVerification
VerificationController::result_notice
Map a redirect result code to its [ message, notice type ], or null for an unknown code.
Метод класса: VerificationController{}
Хуков нет.
Возвращает
array{0: string, 1: string}|null.
Использование
// private - только в коде основоного (родительского) класса $result = $this->result_notice( $code ): ?array;
- $code(строка) (обязательный)
- Result code from a send/confirm redirect.
Код VerificationController::result_notice() VerificationController::result notice WC 11.2.2
private function result_notice( string $code ): ?array {
switch ( $code ) {
case 'sent':
return array( __( 'A confirmation link has been sent to your email address. Please check your inbox.', 'woocommerce' ), 'success' );
case 'throttled':
return array( __( 'A confirmation link was sent recently. Please check your inbox, or wait a moment before requesting a new one.', 'woocommerce' ), 'notice' );
case 'confirmed':
return array( __( 'Your email address has been confirmed.', 'woocommerce' ), 'success' );
case 'expired':
return array( __( 'This confirmation link is invalid or has expired. Please request a new one.', 'woocommerce' ), 'error' );
case 'mismatch':
return array( __( 'Unable to confirm this email while you are logged in to a different account. Please log out and open the link again.', 'woocommerce' ), 'error' );
case 'invalid':
return array( __( 'Invalid request. Please try again.', 'woocommerce' ), 'error' );
default:
return null;
}
}