Pro Requires Foliora Pro
Foliora Pro hooks and events
Actions, filters, DOM events and JavaScript entry points added by Foliora Pro.
On this page
PHP#
| Hook | Type | Parameters | When |
|---|---|---|---|
foliora_pro/protected | action | $attachment_id | A file was put in Secure Mode. |
foliora_pro/unprotected | action | $attachment_id | A file left Secure Mode. |
foliora_pro/lead_captured | action | $lead | A reader submitted the lead form. |
foliora_pro/user_has_access | filter | $ok, $user_id, $attachment_id, $rules | Decide whether a user reads the full document. |
foliora_pro/membership_options | filter | $plans (key ⇒ label) | Plans listed on the Access screen. |
add_action( 'foliora_pro/lead_captured', function ( $lead ) {
wp_remote_post( 'https://crm.example.com/api/leads', array(
'body' => wp_json_encode( $lead ),
'headers' => array( 'Content-Type' => 'application/json' ),
) );
} );
How Pro plugs into the free viewer#
- Fires
foliora/pro_loadedand definesFOLIORA_PRO_VERSIONonplugins_loadedpriority 5. - Answers
foliora/feature_enabledfor licensing andfoliora/show_brandingfor branding removal. - Uses
foliora/pre_render_viewerto render EPUBs,foliora/before_viewerfor the reader controls, andfoliora/viewer_htmlfor wrappers such as the lightbox.
DOM events#
| Event | Detail |
|---|---|
foliora:lead | Fired on the viewer when a lead is captured. |
foliora:ready (EPUB) | The EPUB reader is ready. |
foliora:relocated | { cfi, percentage, label } — the EPUB position changed. |
JavaScript#
FolioraProEpub.bind( element )— start an EPUB reader added after load.container.__folioraGoToCfi( cfi )andcontainer.__folioraGetLocation()— move to or read the EPUB position.
Data#
| Where | What |
|---|---|
Tables {prefix}foliora_pro_docs, _sessions, _pages, _searches, _leads, _clicks | Analytics and leads |
Attachment meta _foliora_pro_access | Access rules |
Attachment meta _foliora_pro_hotspots | Hotspots (percent of the page) |
User meta foliora_reading_progress, foliora_bookmarks | Progress and bookmarks |
Taxonomy foliora_doc_cat | Document categories |