Skip Navigation

[Resolved] Images and repeater URL via FluentForms to Toolset custom fields

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 1 voice.

Last updated by Minesh 1 week, 6 days ago.

Assisted by: Minesh.

Author
Posts
#2846546

This is a follow-up for this ticket: https://toolset.com/forums/topic/images-and-repeater-url-via-fluentforms-to-toolset-custom-fields/

I got a reply from Fluent Forms support:

Fluent Forms provides a hook that runs after a submission is created, which can be used to access and normalize the submitted data as required by Toolset.
fluentform/submission_inserted
Please note that this requires custom PHP implementation, as this behavior is outside Fluent Forms’ default data handling.
We have also provided the documentation regarding these submission-related hooks for your reference. hidden link

#2846568

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I see they shared the following hook:
=> hidden link

add_action('fluentform/submission_inserted', function($submissionId, $formData, $form) {
   // Do whatever you want with the new submission
}, 10, 3);

So, you can use something like this:

add_action('fluentform/submission_inserted', function($submissionId, $formData, $form) {
  if ($form->id==32) {
              
        $field_slug = 'media-gallery';
  
        $field_content = $_POST['wpcf-'.$field_slug];
              
            $sort_order = array();
              
             
            delete_post_meta($submissionId,'wpcf-'.$field_slug);
        
            foreach($field_content as $k=>$v):
                $sort_order[] = add_post_meta($submissionId,'wpcf-'.$field_slug,$v);
            endforeach;
     
            update_post_meta($submissionId,'_wpcf-'.$field_slug.'-sort-order', $sort_order);
        
    }

}, 10, 3);

Where make sure that the fluentform sends the full image URL with $_POST object.