Version: 5
CAUTION
️Version 5 of Gravity PDF does not have full support for Gravity Forms 2.5 and you should consider upgrading to version 6. If you cannot, version 5 will still function but have a degraded admin experience. Support and bug/security fixes will be provided until 27 April 2023.Gravity PDF API – delete_pdf()
Description
This method will permanently delete an existing PDF's settings. This cannot be undone, so use it carefully.
Version
This method was introduced in Gravity PDF 4.0.
Parameters
$form_id | integer
- The Gravity Form ID
$pdf_id | string
- The PDF internal identifier (found in the
pid
URL parameter when viewing individual PDF settings in the admin area)
Return
boolean
- True on success, false on failure
Usage
The following snippet shows you how to delete an existing PDF:
add_action( 'init', function() {
if ( class_exists( 'GPDFAPI' ) ) {
/* Delete the PDF on form #2 */
if( GPDFAPI::delete_pdf( 2, '56c14c955d989' ) ) {
//PDF deleted successfully
}
}
} );
Source Code
This method is located in api.php
.