LLMS_Form_Validator::validate_field_user_email( string $posted_value )

Validate a user-email field


Description Description

User emails must be unique.


Top ↑

Parameters Parameters

$posted_value

(string) (Required) User-submitted (dirty) value.


Top ↑

Return Return

(WP_Error|boolean) Returns true for a valid submission, otherwise an error.


Top ↑

Source Source

File: includes/forms/class-llms-form-validator.php

	protected function validate_field_user_email( $posted_value ) {
		if ( email_exists( $posted_value ) ) {
			return new WP_Error( 'llms-form-field-not-unique', sprintf( __( 'An account with the email address "%s" already exists.', 'lifterlms' ), $posted_value ) );
		}

		return true;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.