• Resolved jayme2604

    (@jayme2604)


    Hi Ultimate Member Support,

    I would like to replace the error text on the “username” meta key at login, but it does not seem to be fired at all. What I have done so far:

    Created a snippet:

    function um_custom_validate_user_email_details( $key, $array, $args ) {
    if ( isset( $args['username'] ) && $args['username'] == '' ) {
    UM()->form()->add_error( 'username', __( 'This is a test', 'ultimate-member' ) );
    }
    }
    add_action( 'um_custom_field_validation_user_email_details', 'um_custom_validate_user_email_details', 30, 3 );

    In Ultimate Member I went to Forms and updated the Username field in “Default Login” by taking the following steps:

    • Selected “Custom validation” at Validation
    • Entered at “Custom action”: user_email_details
    • Unchecked the option at “Is this field required?”

    The snippet is activated and all I see is the local Dutch error message which basically says: “Enter your username or email address”. It looks like it’s still getting overwritten somehow.

    I hope you can help me.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom login validation snippet not being fired’ is closed to new replies.