Filter: um_custom_error_message_handler

apply_filters( 'um_custom_error_message_handler', $error, $request_error, $args ) → {string}

Filters a custom error message.

Parameters:
Name Type Description
$error string

Error message.

$request_error string

Error data.

$args array

UM Form shortcode arguments.

Since:
  • 2.6.4 Added `$args` parameter.
Source:
Returns:

Error message.

Type
string
Example

It adds a custom error for `custom_key_on_profile` error key.

function my_custom_error_message( $error, $request_error, $args ) {
    if ( 'custom_key_on_profile' === $request_error ) {
        $error = 'Some custom message';
    }
    return $error;
}
add_filter( 'um_custom_error_message_handler', 'my_custom_error_message', 10, 3 );