0

I am using WordPress v6.2. I have a custom form made in JetFormBuilder, at the end of which I am sending a "Call Hook" Post Submit Action and calculating final variable in the backend, specifically in functions.php file.

add_action('jet-form-builder/custom-action/calculate-total', function ( $request ) {
.
.
.
$user_id = get_current_user_id();
$total = 14500;
update_user_meta($user_id, $user_total_field, $total);
}

No user will be logged in during this workflow. I have to store the variable somewhere from the backend, where I can access it inside the JetFormBuilder hidden field or somewhere else in the JetFormBuilder. I was previously using user_meta for this. But since no user will be logged in, no user ID will be available.

enter image description here

total is the variable in the backend.

Also, I have some other variables, such as otp or e-mail which I have to store after the JetFormBuilder submission and access them in another JetForms form. I was previously storing them in user_meta which is now an nonviable option.

Suggest some ways or custom code using which I can make this happen in JetFormBuilder and Wordpress backend.

Thanks.

Varun
  • 31
  • 3

1 Answers1

-1

You can possibly use Option pages, as you can populate fields with it in the form.

JetSky
  • 1