A project I’m working on is using Gravity Forms User Registration Add-On and we have two parent/child user roles. I used the gform_user_registration_update_user_id filter to populate the form fields with the required child account user ID. The data is coming fine but every time I submit the form it updates the logged in user which is the parent account instead of updating the one with the provided ID.
add_filter('gform_user_registration_update_user_id_5', function ( $user_id, $entry, $form, $feed ) {
if(isset($_GET['uid'])){
$user_id = $_GET['uid'];
}
return $user_id;
}, 10, 4 );