Hello
I have a form on the product page that creates a cpt post “review” and I want to create a relationship between after submitting proforms
so basically I replace woo revews but I can’t get it to work
Here is my code
add_action('bricks/form/custom_action', 'add_relationship_review_product', 10, 1);
function add_relationship_review_product($form) {
$form_fields = $form->get_fields();
$form_id = $form_fields['formId'];
// Check if the form ID is for the specific form you're targeting
if ($form_id !== 'qosxpx') {
return;
}
// Get the submission ID from the special variable {{live_post_id}}
$submission_id = '{{live_post_id}}'; // Use {{live_post_id}} as submission ID
// Make sure submission ID is present
if (empty($submission_id)) {
return; // Exit if submission ID is empty
}
// Add relationship between product and review submission
MB_Relationships_API::add(get_queried_object_id(), $submission_id, 'product_review', $order_from = 1, $order_to = 1);
}
how i can get the $submission_id