Description
The gravityflowpdf_file_path filter allows the file path to be modified.
Parameters
Parameter | Type | Details |
---|---|---|
$path | String | Path of the PDF file |
$entry_id | Integer | The id of the current entry |
$form_id | Integer | The id of the current form. |
Examples
Returns the path of the PDF file.
The example uploads the PDF on the folder ‘upload_pdf’ that has already been created at the root of the site.
add_filter( 'gravityflowpdf_file_path', 'sh_gravityflowpdf_file_path', 10, 3 );
function sh_gravityflowpdf_file_path( $path, $entry_id,$form_id ) {
$path = $_SERVER['DOCUMENT_ROOT'].'/upload_pdf/'.$form_id.$entry_id.'.pdf';
return $path;
}
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?