gfpdf_pdf_middleware

PDF authentication middleware.

Description

apply_filters( 'gfpdf_pdf_middleware', (bool) $false, (unknown) $entry, (unknown) $settings ); 

Default middleware includes middle_public_access,, middle_active, middle_conditional, middle_owner_restriction, middle_logged_out_timeout, middle_auth_logged_out_user, middle_user_capability If WP_Error is returned the PDF won't be parsed

See https://gravitypdf.com/documentation/v4/gfpdf_pdf_middleware/ for more details about this filter

Parameters (3)

0. $false (bool) => false
The false.
1. $entry (unknown)
The entry.
2. $settings (unknown)
The settings.

Usage

To run the hook, copy the example below.
  1. $false = apply_filters( 'gfpdf_pdf_middleware', $false, $entry, $settings ); 
  2.  
  3. if ( !empty( $false ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the gfpdf_pdf_middleware callback 
  2. function filter_gfpdf_pdf_middleware( $false, $entry, $settings ) { 
  3. // make filter magic happen here... 
  4. return $false
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'gfpdf_pdf_middleware', 'filter_gfpdf_pdf_middleware', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'gfpdf_pdf_middleware', 'filter_gfpdf_pdf_middleware', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/src/model/Model_PDF.php  
  1. $middleware = apply_filters( 'gfpdf_pdf_middleware', false, $entry, $settings );