• Resolved Subhro

    (@subhro2321)


    Unfortunately i couldn’t link it up with a page as i haven’t developed the site yet and was testing in local. So what i found was that the plugin works fine in default stage.

    But in free plan, i thought adding a security question for users, so i added a custom text field in the registration form with placeholder as ‘What is your last 3 digit of your mobile number and validated it with numerical only.

    It appeared in registration page perfectly! But when i added that custom field in login form, it doesn’t works.

    Can i get some help on this please. I have been trying to find a solution to it since last 3 days. Finally i decided to ask some support here.

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

    (@champsupertramp)

    Hi @subhro2321

    Unfortunately, UM doesn’t handle multiple fields in the Login form – only username, email address, and password fields are working. You will need to customize it to validate that custom field.

    You can attach your validation with the action hook um_submit_form_login.

    e.g.

    add_action("um_submit_form_login","um_011420_submit_form_error");
    function um_011420_submit_form_error( $post_form ){
      
        if( ! isset( $post_form['mobile_number] ) ){
            // register the error notice
           	UM()->form()->add_error('mobile_number', __( 'Mobile Number is required', 'ultimate-member' ) );
    			
        }  
        
    }

    Regards.

    • This reply was modified 5 years, 4 months ago by Champ Camba.
    Thread Starter Subhro

    (@subhro2321)

    Thank for reverting back!
    I am not very good with php.But i added your code and it responded with a syntax error. Can you please check it.

    I will be adding a custom text field while i will put meta as user_security_key so please give me a code which i can add so that UM login can handle the field in login form.

    Thank you in advance.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @subhro2321

    Sorry for the late response.

    What error are you getting? You can try using Code Snippet plugin to add and test the code: https://ww.wp.xz.cn/plugins/code-snippets/

    Feel free to re-open this thread by changing the topic status to “Not Resolved”.

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Ultimate member field issue.’ is closed to new replies.