$user_id not returned in user_register()

Home Forums Everest Forms $user_id not returned in user_register()

This topic contains 4 replies, has 3 voices, and was last updated by  zyveju 5 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #14085


    I try hooking an action on user_register hook, but I cannot retrieve the $user_id which should be delivered by the hook.
    I have come to suspect that maybe User Registration plugin is interfering. Could that be? I use this plugin for registration form.

    This is my code, just for testing:
    `add_action( ‘user_register’, ‘myplugin_registration_save’, 10, 1 );

    function myplugin_registration_save( $user_ID ) {



    The user_meta is updated if I hard-code a value, but with the $user_id variable, no value is stored in db.



    Hi there,

    The hook action is not correct. You can use do_action( 'user_registration_after_register_user_action', self::$valid_form_data, $form_id, $user_id ); this hook to get user_id. This hook is called after the user have been registered.

    Your code must be like this :

    add_action( ‘user_registration_after_register_user_action’, ‘myplugin_registration_save’, 10, 1 );
    function myplugin_registration_save( $form_data, $form_id, $user_ID ) {

    Thanks & Regards,
    WPEverest Support Team.



    Thank you! But unfortunately, this doesn’t seem to work at all? Is the name of the hook correct?



    Sorry, my first code is correct apart from using $user_ID instead of $user_id.
    I tried all this, but obviously, something must have been wrong, as it works now.
    Not with user_registration_after_register_user_action, but with user_register.

    Thanks anyway!



    When a developer try to make a program for the better lookup of his code then they will help the user to give his best products. I want to tell you the edu birdie who is the best opportunity for those who love to make you easy access to this program.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.