WaterWoo Action & Filter Hooks, listed

WaterWoo PDF Premium comes with many built-in hooks that will allow someone familiar with PHP (and Wordpress hooks) to further customize the plugin functioning. Note, these hooks are not stated functions of the plugin and therefore are NOT included in plugin support other than to correct mistakes on our end or perhaps add in new hooks if you need them.

They are listed here by appearance in various plugin files, with a little information about what each can do. You might find code examples for these hooks here.

class-wwpdf-file-handler.php

‘wwpdf_do_cleanup’ – filter to maybe prevent cleanup of files served via forced or xsendfile download. Added in version 2.2
‘wwpdf_file_cleanup’ – action to clean up residual files on the server if using Redirect download method.
‘wwpdf_font_decode’ – decode watermarking output differently than the default, in case of special character use
‘wwpdf_out_charset’ – use a different font encoding with html_entity_decode()
‘waterwoo_overlay_filter’ – filters to allow for manipulation of watermarks. Added in version 2.2
‘waterwoo_footer_filter’ – same as ‘waterwoo_overlay_filter’
‘wwpdf_filter_overlay’ – filters to allow for manipulation of watermarks were added in version 2.5 and fire after the previously mentioned watermark filters. With these hooks you can possibly add in your own shortcodes for custom checkout fields.
‘wwpdf_filter_footer’ – same as ‘wwpdf_filter_overlay’
‘wwpdf_download_file_name’ – You’ll know it when you need it…
‘wwpdf_watermark_use_uploads_dir’ – filter to choose where temporary files are stored
‘wwpdf_temp_dir’
‘wwpdf_timeout_extend’ – (integer) WaterWoo sets the HTTP request (via wp_remote_get()) timeout for remote files to 20 seconds. Default WP setting is 5 seconds. You can set it even higher using this hook.

class-wwpdf-settings-tab.php

‘waterwoo_settings_array’ – filter to allow for manipulation of main watermarking settings (possibly to add settings)

class-wwpdf-test.php

‘wwpdf_font_decode’ – see above
‘wwpdf_out_charset’

class-wwpdf-watermark-test.php

‘wwpdf_set_zoom_mode’ – filter for setting PDF viewing preferences via TCPDF. Added in version 2.2
‘wwpdf_set_layout_mode’ – filter for setting PDF viewing preferences via TCPDF. Added in version 2.2
‘wwpdf_set_display_mode’ – filter for setting PDF viewing preferences via TCPDF. Added in version 2.2
‘wwpdf_set_viewer_preferences’ – filter for setting PDF viewing preferences via TCPDF. Added in version 2.2
‘wwpdf_add_custom_font’
‘wwpdf_add_barcode’ – opens up opportunity to add a barcode to the watermark via TCPDF write1DBarcode() or write2DBarcode(). More on PDF barcodes here.

class-wwpdf-watermark.php

‘wwpdf_do_cleanup’ (boolean)
‘wwpdf_set_password’ – maybe set the password as something other than the customer’s email. Like this. The Order ID object is an argument, so you’ve got lots to work with.
‘wwpdf_set_zoom_mode’ – see above
‘wwpdf_set_layout_mode’ – see above
‘wwpdf_set_display_mode’ – see above
‘wwpdf_set_viewer_preferences’ – see above
‘wwpdf_add_custom_font’
‘wwpdf_add_barcode’ – see above

TCPDI

‘wwpdf_overwrite_producer’ (boolean) – if you want the PDF metadata producer to be the last known instead of written as TCPDF by Waterwoo, override/overwrite this! You can just put this line of code


add_filter( 'wwpdf_overwrite_producer', '__return_true' );

in your WordPress child theme functions.php file.


(advertisement)