Automattic\WooCommerce\Internal\StockNotifications\Frontend

SignupService::get_error_message │ public │ WC 1.0

Get the error message for the error code.

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

Хуков нет.

Возвращает

string. The error message.

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

$SignupService = new SignupService();
$SignupService->get_error_message( $error_code ): string;
$error_code(строка) (обязательный)
The error code.

Код SignupService::get_error_message() WC 11.2.2

public function get_error_message( string $error_code ): string {
	switch ( $error_code ) {
		case self::ERROR_INVALID_PRODUCT:
			return wp_kses_post( __( 'Invalid product.', 'woocommerce' ) );
		case self::ERROR_INVALID_USER:
			return wp_kses_post( __( 'Invalid user.', 'woocommerce' ) );
		case self::ERROR_INVALID_EMAIL:
			return wp_kses_post( __( 'Invalid email address.', 'woocommerce' ) );
		case self::ERROR_RATE_LIMITED:
			return wp_kses_post( __( 'Please wait a moment before signing up again.', 'woocommerce' ) );
		case self::ERROR_INVALID_OPT_IN: // Deprecated code kept for callers passing the old code.
			return wp_kses_post( __( 'To proceed, please consent to the creation of a new account with your e-mail.', 'woocommerce' ) );
		default:
			return wp_kses_post( __( 'Failed to sign up. Please try again.', 'woocommerce' ) );
	}
}