• Greetings

    Can someone please tell me where exactly do I place a hook code for custom validation in a registration form made with Ultimate Member?

    Supose I have a custom field FIELD_1, and on submission I want to run Function_1. The code will be:

    add_action(‘um_submit_form_errors_hook_’,’Function_1′);
    function Function1( $args ) {
    global $ultimatemember;
    //check var $args[‘F1’]
    //…
    }

    Where exactly do I place this code? Inside the registration page as PHP?

    Another question, if I may: can I override the wp-signup.php with Ultimate Member or must it be done via .htaccess?

    Kind regards

    Kepler

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support mansurahamed

    (@mansurahamed)

    Hi @jkepler,

    You custom hook codes should be placed in your child theme’s functions.php file. UM overrides wordpress signup. you should see the default signup form & allow you to register using um registration form in https://yousite.com/register page.

    Thank you.

    Thread Starter jkepler

    (@jkepler)

    Hi @mansurahamed

    Thanks for the reply. One question if I may: if I use “My Custom Functions” plugin, and add my code there, will it work right?

    Kind regards

    JKepler

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @jkepler,

    Yes, it should work.

    Regards.

    Thread Starter jkepler

    (@jkepler)

    Hi

    It doesn’t…I’m doing something wrong… Can you help me please with an example?

    NOTE: If I place the code in function.php of the child template it works. With a code snippet plugin it doesn’t. So I must be placing the wrong code/hook

    Kind regards

    JKepler

    • This reply was modified 7 years, 2 months ago by jkepler.
    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @jkepler,

    Have you selected “Custom validation” in Validate dropdown in your field settings?
    Please also make sure to add your action name in Custom Action field.

    Regards.

    Thread Starter jkepler

    (@jkepler)

    Hi,

    Yes I did. The proof is that if I place my validating code in the functions.php child theme, the validation is done correctly (it only allows what I want, otherwise gives a custom error message defined by me).

    So with codes snippets the code is not being injected – whatever value I place in the custom field is accepted.

    Kind regards

    JKepler

    I’m having the same problem. Is this a bug in Ultimate Member?

    @jkepler were you able to solve your issue?

    Trying to add validation in my plugin, but it doesn’t work.

    I have a field for a verification code, that shall be verified against another server (api stuff) and it seems that the validation doesn’t run at all. tried die’ing inside my validate function to no avail.

    the code should be like this, right:

    add_action( ‘um_submit_form_errors_hook_’, ‘my_validation’ )
    function my_validation($args) {
    // code
    }

    And what shall I put in the form editors custom validation field? All docs on this is EXTREMELY vague.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Ultimate Member hook’ is closed to new replies.