gfpdf_mpdf_init_class

Allow $mpdf object class to be modified Note: in some circumstances using WriteHTML() during this filter will break headers/footers.

Description

apply_filters( 'gfpdf_mpdf_init_class', (unknown) $this_mpdf, (unknown) $this_form, (unknown) $this_entry, (unknown) $this_settings, (unknown) $instance ); 

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

Parameters (5)

0. $this_mpdf (unknown)
The this mpdf.
1. $this_form (unknown)
The this form.
2. $this_entry (unknown)
The this entry.
3. $this_settings (unknown)
The this settings.
4. $instance (unknown)
The instance.

Usage

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

Defined (1)

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

/src/helper/Helper_PDF.php  
  1. $this->mpdf = apply_filters( 'gfpdf_mpdf_init_class', $this->mpdf, $this->form, $this->entry, $this->settings, $this );