|
25 | 25 | class Pdf_Forms_For_WPForms
|
26 | 26 | {
|
27 | 27 | const VERSION = '1.3.0';
|
28 |
| - const MIN_WPFORMS_VERSION = '1.6.9'; |
| 28 | + const MIN_WPFORMS_VERSION = '1.7.7'; |
29 | 29 | const MAX_WPFORMS_VERSION = '1.9.99';
|
30 | 30 | private static $BLACKLISTED_WPFORMS_VERSIONS = array();
|
31 | 31 |
|
@@ -81,8 +81,10 @@ public function plugin_init()
|
81 | 81 | add_filter( 'wpforms_save_form_args', array( $this, 'wpforms_save_form_args' ), 10, 3 );
|
82 | 82 |
|
83 | 83 | add_filter( 'wpforms_smarttags_process_value', array( $this, 'plaintext_smart_tag_value_workaround_filter' ), PHP_INT_MAX, 6 );
|
84 |
| - // fill_pdfs: we can't use wpforms_process_complete (because notifications have already been sent) and wpforms_process because uploaded files haven't been processed yet |
85 |
| - add_filter( 'wpforms_process_after_filter', array( $this, 'fill_pdfs' ), 999999, 3 ); |
| 84 | + // fill_pdfs: we can't use wpforms_process_complete (because notifications have already been sent) |
| 85 | + // and wpforms_process because uploaded files haven't been processed yet |
| 86 | + // we need entry_id as well, which is only provided to wpforms_process_entry_saved |
| 87 | + add_action( 'wpforms_process_entry_saved', array( $this, 'fill_pdfs' ), 99, 4 ); |
86 | 88 | add_action( 'wpforms_process_complete', array( $this, 'remove_tmp_dir' ), 99, 0 );
|
87 | 89 | add_filter( 'wpforms_emails_send_email_data', array( $this, 'attach_files' ), 10, 2 );
|
88 | 90 | add_action( 'wpforms_frontend_confirmation_message', array( $this, 'change_confirmation_message'), 10, 4 );
|
@@ -876,12 +878,10 @@ public function plaintext_smart_tag_value_workaround_filter( $value, $tag_name,
|
876 | 878 | /**
|
877 | 879 | * We need to fill the pdf's document fields and then create attachment file and attach them
|
878 | 880 | */
|
879 |
| - public function fill_pdfs( $wpforms_fields, $entry, $form_data ) |
| 881 | + public function fill_pdfs( $wpforms_fields, $entry, $form_data, $entry_id ) |
880 | 882 | {
|
881 | 883 | try
|
882 | 884 | {
|
883 |
| - $entry_id = $entry["id"]; |
884 |
| - |
885 | 885 | $attachments = array();
|
886 | 886 | $mappings = array();
|
887 | 887 | $embeds = array();
|
@@ -1428,8 +1428,6 @@ public function fill_pdfs( $wpforms_fields, $entry, $form_data )
|
1428 | 1428 | $this->remove_tmp_dir();
|
1429 | 1429 | $this->wpforms_mail_attachments = array();
|
1430 | 1430 | }
|
1431 |
| - |
1432 |
| - return $wpforms_fields; |
1433 | 1431 | }
|
1434 | 1432 |
|
1435 | 1433 | /**
|
|
0 commit comments