Skip to content

Commit 817c5aa

Browse files
committed
gpnf-auto-attach-parent-files.php: Added snippet to auto attach parent files to child notifications.
1 parent 2476c14 commit 817c5aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gp-nested-forms/gpnf-auto-attach-parent-files.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Author URI: https://gravitywiz.com/
1616
*/
1717

18-
class GPNF_Auto_Attach_Parent_Files {
18+
class GPNF_Auto_Attach_Parent_Files {
1919
/**
2020
* The ID of the child form to apply this to (optional).
2121
*/
@@ -87,11 +87,11 @@ function attach_parent_files_to_child_notifications( $notification, $form, $entr
8787
continue;
8888
}
8989

90-
$upload_root = GFFormsModel::get_upload_root();
91-
$upload_field = GFAPI::get_field( $parent_entry['form_id'], $field_id );
90+
$upload_root = GFFormsModel::get_upload_root();
91+
$upload_field = GFAPI::get_field( $parent_entry['form_id'], $field_id );
9292
$is_multiple_files = $upload_field->multipleFiles;
9393

94-
$files = $is_multiple_files ? json_decode( $uploaded_files, true ) : [ $uploaded_files ];
94+
$files = $is_multiple_files ? json_decode( $uploaded_files, true ) : array( $uploaded_files );
9595

9696
foreach ( $files as $file ) {
9797
$attachments[] = preg_replace( '|^(.*?)/gravity_forms/|', $upload_root, $file );

0 commit comments

Comments
 (0)