Skip to main content

PDF for GravityView Hooks – gfpdf_gv_bulk_export_ttl

Description​

Use this filter to change how long the Download ZIP link from a Download PDFs bulk export works. Change it if users report the link has expired.

GravityView only keeps the message containing the link for one day, so a longer value only helps users who copied the link. The ZIP file is deleted an hour after the link expires, so a download started just before then can finish.

The ZIP contains a copy of every selected entry's PDF until it's deleted. Keep the value as short as your users need.

Related hooks: gfpdf_gv_bulk_export_capability and gfpdf_gv_bulk_export_filename.

Version​

This hook was introduced in PDF for GravityView 2.0.

Arguments​

The following arguments are passed to functions that use this hook:

$ttl | int​

  • How long the ZIP can be downloaded after the export finishes, in seconds.
  • Values below 60 are treated as 60 (one minute).
  • The default value is 86400 (one day).

Usage​

Keep exports for a week, for users who save the link:

add_filter( 'gfpdf_gv_bulk_export_ttl', function( $ttl ) {
return WEEK_IN_SECONDS;
} );

Delete exports after an hour:

add_filter( 'gfpdf_gv_bulk_export_ttl', function( $ttl ) {
return HOUR_IN_SECONDS;
} );

Source Code​

This filter is located in src/GravityView/BulkExport.php of the PDF for GravityView extension.