• Resolved qnkov

    (@qnkov)


    1. Create a new field with field key ‘question_answer’
    2. In the field settings, choose “Custom Validation” in the “Validate” option.
    3. It will show the “Custom Action” – Enter the key ‘question_answer’ in that field.
    4. Add the following code in your theme’s functions.php file or use the Code Snippets plugin:

    function um_custom_validate_question_answer( $key, $array, $args ) {
    	if ( isset( $args[$key] ) && $args[$key]  != 'IM HUMAN' ) {
              UM()->form()->add_error( $key, __( 'Please enter valid Answer.', 'ultimate-member' ) );
        } 
    }
    add_action( 'um_custom_field_validation_question_answer', 'um_custom_validate_question_answer', 30, 3 );

    5. Once you’ve added the PHP code, go to the Register page and try entering the answer IM HUMAN.

    My question about this is:

    Which box to chose – https://prnt.sc/11gknml
    Textarea, textbox? And should i use the bracers with ‘question_answer’ or without them when i insert? Thanks.

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