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.
‘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_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.
‘waterwoo_settings_array’ – filter to allow for manipulation of main watermarking settings (possibly to add settings)
‘wwpdf_font_decode’ – see above
‘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_barcode’ – opens up opportunity to add a barcode to the watermark via TCPDF write1DBarcode() or write2DBarcode(). More on PDF barcodes here.
‘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_barcode’ – see above
‘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
add_filter( 'wwpdf_overwrite_producer', '__return_true' );
in your functions.php file.