• Hi,

    I want to Change only one field error message resat all are my field is fine how can i do it when i am puting this code in functions.php

    add_filter(‘um_submit_form_error’,’um_custom_submit_form_error’, 10, 2);
    function um_custom_submit_form_error( $key, $error_message ){

    if( $error_message == ‘mobile_number’ ){
    return ‘Please input a valid Mobile no (10 Digits)’;
    }
    return $error_message;
    }

    It change the field error that i want but also change the Other fields error messages also

    Please Can you help me to come out of this?

    https://www.ads-software.com/plugins/ultimate-member/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi,

    Can you please try this the following code?

    add_filter('um_submit_form_error','um_custom_submit_form_error', 10, 2);
    function um_custom_submit_form_error( $error_message, $key ){
    
    if( $key == 'mobile_number' ){
    return 'Please input a valid Mobile no (10 Digits)';
    }
    return $error_message;
    }

    Regards,

    Thread Starter salik Bin Siraj

    (@saliks)

    Thnaks, Champ Camba

    It works

    Plugin Author Ultimate Member

    (@ultimatemember)

    Thanks for letting us know ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Field’ is closed to new replies.