Hi @sethabreguer,
Please try the following new snippet and check whether it works fine:
<?php
add_filter( 'forminator_replace_form_data', 'wpmudev_send_uploaded_image_behavior', 10, 3 );
function wpmudev_send_uploaded_image_behavior( $content, $data, $original_content ){
$submitted_data = Forminator_CForm_Front_Action::$info['field_data_array'];
$prepped_data = wp_list_pluck( $submitted_data, 'value', 'name' );
if ( $data['form_id'] != 2910 ) {
return $content;
}
if ( strpos( $content, '{uploaded_image}' ) !== false ) {
$field_name = 'upload-1';
if ( is_array( $prepped_data[ $field_name ] ) && ! empty( $prepped_data[ $field_name ]['file'] ) ) {
if ( !empty( $prepped_data[ $field_name ]['file']['file_url'] ) ) {
$content = str_replace( '{uploaded_image}', $prepped_data[ $field_name ]['file']['file_url'], $content );
}
}
}
return $content;
}
The steps would be similar like the previous snippet ie change?2910
?in the above code to your form ID and also change?upload-1
?to your field’s name.
Also, in order to show the image after the submission, you’ll need to add?{uploaded_image}
?macro under After submission message ie under Behavior > Submission Behavior in your form.
I gave a quick test and can confirm the snippet works. Please do let us know how that goes.
The above code can be added as a mu-plugins. Please check this link on how to implement the above code as a mu-plugins:
https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
Best Regards
Nithin