I am using the Gravity Forms registration plugin to register users on a website I am building and I am trying to add the ID of the newly created user to a URL which gets emailed to specific emails.
I found info herehttp://www.gravityhelp.com/documentation/page/Entry_Object that says you can get the current user ID of the logged in user however the value returns 0 because it seems as though the user isn’t quite logged in at the time this function is called.
This is how I am currently trying to access the ID
add_action("gform_after_submission", "set_post_content_stuff", 10, 2);
function set_post_content_stuff($entry, $form){
//get id of user submitting the form
$currUserID = $entry['created_by'];
}
Does anyone know how to access the ID from the wp_users table when a new user is registered?
You can use the gform_user_registered hook to access the recently created user id:
See documentation: https://www.gravityhelp.com/documentation/article/gform_user_registered/