Flipset for developers: hooks, events and WP-CLI
Filters, actions, browser events and WP-CLI commands for extending Flipset.
On this page
Flipset exposes public WordPress filters and actions so add-ons and themes can extend the viewer without changing the plugin. The full list, with parameters and copy-paste examples, is in docs/HOOKS.md on GitHub.
Common hooks
| Hook | Use it to |
|---|---|
flipset/viewer_atts |
Change the resolved shortcode or block attributes, such as the file, view or theme. |
flipset/viewer_file_url |
Change the file address the viewer loads, for signed or proxied addresses. |
flipset/download_url |
Change the address of the toolbar Download button. |
flipset/viewer_html |
Change the viewer’s HTML. |
flipset/schema_digital_document |
Change the structured data. |
flipset/og_image |
Change the Open Graph image. |
flipset/extracted_text |
Change the text stored for PDF search. |
flipset/pdf_tagged |
Override the accessibility tag check. |
Example
add_filter( 'flipset/viewer_atts', function ( $atts ) {
if ( function_exists( 'pll_current_language' ) && 'fr' === pll_current_language() ) {
$atts['file'] = 'https://example.com/docs/guide-fr.pdf';
}
return $atts;
} );
Browser events
The viewer fires DOM events such as flipset:ready and flipset:pagechange that your own JavaScript can listen for.
WP-CLI
wp flipset status
wp flipset reindex
wp flipset clear_cache