Description
By default, the PDF generated by the Gravity Flow PDF Generator Extension is deleted immediately after sending by email – this helps to ensure that unauthorized users don’t see fields values later on in the workflow. The gravityflowpdf_delete_post_send filter can be used to prevent the PDF file from being deleted when it is sent by email.
Parameters
Parameter | Type | Details |
---|---|---|
$delete_pdf | Boolean | Whether to delete the PDF after sending by email. |
$form | Array | The form array |
$entry | Array | The entry array |
$step | Step | The PDF step. |
Examples
Retain the PDF on the server after sending by email only for form ID 1.
1 2 3 4 5 6 7 | add_filter( 'gravityflowpdf_delete_post_send' , function ( $delete_pdf , $form , $entry , $step ) { if ( $form [ 'id' ] == 1 ) { $delete_pdf = false; } return $delete_pdf ; } ); |
Always retain the PDF file on the server after sending by email regardless of the form or step.
1 | add_filter( 'gravityflowpdf_delete_post_send' , '__return_false' ); |
Since
This filter was added in version 1.3.
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?