Skip to content
Pro Requires Foliora Pro

Foliora Pro hooks and events

Actions, filters, DOM events and JavaScript entry points added by Foliora Pro.

1 min read Updated

On this page

PHP#

HookTypeParametersWhen
foliora_pro/protectedaction$attachment_idA file was put in Secure Mode.
foliora_pro/unprotectedaction$attachment_idA file left Secure Mode.
foliora_pro/lead_capturedaction$leadA reader submitted the lead form.
foliora_pro/user_has_accessfilter$ok, $user_id, $attachment_id, $rulesDecide whether a user reads the full document.
foliora_pro/membership_optionsfilter$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_loaded and defines FOLIORA_PRO_VERSION on plugins_loaded priority 5.
  • Answers foliora/feature_enabled for licensing and foliora/show_branding for branding removal.
  • Uses foliora/pre_render_viewer to render EPUBs, foliora/before_viewer for the reader controls, and foliora/viewer_html for wrappers such as the lightbox.

DOM events#

EventDetail
foliora:leadFired 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 ) and container.__folioraGetLocation() — move to or read the EPUB position.

Data#

WhereWhat
Tables {prefix}foliora_pro_docs, _sessions, _pages, _searches, _leads, _clicksAnalytics and leads
Attachment meta _foliora_pro_accessAccess rules
Attachment meta _foliora_pro_hotspotsHotspots (percent of the page)
User meta foliora_reading_progress, foliora_bookmarksProgress and bookmarks
Taxonomy foliora_doc_catDocument categories