gfpdf_signed_url_max_expiration
Description
The signed PDF URL expiration is capped to a maximum of 1 year (from 6.18.0). Use this filter to increase or decrease the cap.
Version
This filter was introduced in Gravity PDF 6.18.0.
Parameters
$max_expiration | string
- The cap, as a relative date accepted by PHP's strtotime(). Default
1 year. An invalid value falls back to1 year.
$url | string
- The PDF URL being signed or checked
$expiration | string
- The requested expiration, like
1 week. Empty when a URL is being checked.
Usage
Lower the cap to 1 month:
add_filter( 'gfpdf_signed_url_max_expiration', function( $max_expiration ) {
return '1 month';
} );
Raise the cap to 2 years:
add_filter( 'gfpdf_signed_url_max_expiration', function( $max_expiration ) {
return '2 years';
} );
Source Code
This filter is located in the Helper_Url_Signer::get_max_expiration() method of /src/Helper/Helper_Url_Signer.php.