gpev_validation_error_message

  1. Description
  2. Usage
  3. Since
  4. Examples
    1. Change the email validation error message to all forms.
    2. Change the email validation error message to a specific form.

Description

This filter is useful to change the email validation error message.

By default, the Email Validator will show the following error message on email validation error.

The email address entered cannot be used. Please enter a different email address.

Usage

add_filter( 'gpev_validation_error_message', function( $error_message, $field, $form, $validation_error_message, $can_user_edit_form ) {
    return 'My custom message.';
}, 10, 5 );

Since

This filter is available since GP Email Validator 1.0.2

Examples

Change the email validation error message to all forms.

add_filter( 'gpev_validation_error_message', function( $error_message, $field, $form, $validation_error_message, $can_user_edit_form ) {
    return 'My custom message.';
}, 10, 5 );

Change the email validation error message to a specific form.

add_filter( 'gpev_validation_error_message_1', function( $error_message, $field, $form, $validation_error_message, $can_user_edit_form ) {
    return 'My custom message.';
}, 10, 5 );

add_filter( 'gpev_validation_error_message_1_1', function( $error_message, $field, $form, $validation_error_message, $can_user_edit_form ) {
    return 'My custom message.';
}, 10, 5 );