Skip to content
Learnomy

Hooks Reference

Free & Pro

Learnomy fires 355+ hooks across Free and Pro. This page documents the developer-facing extension points added or most used through version 1.7.0. For the full machine-readable inventory of every hook, route, table, and capability, see audit/manifest.json in the plugin repository.

All Free hooks use the learnomy_ prefix. All Pro-only hooks use learnomy_pro_.

Actions

Actions let you react to something that already happened. They do not change the return value.

Hook Args Fires when Since
learnomy_user_blocked $me, $target (int user IDs) A member blocks another member. 1.7.0
learnomy_user_unblocked $me, $target (int user IDs) A member unblocks another member. 1.7.0
learnomy_push_sent $token, $title (string) A push notification is delivered to a device. 1.0.0
learnomy_after_module_enabled $slug (string) A site owner turns a module on in Settings > Modules. 1.0.0
learnomy_after_module_disabled $slug (string) A site owner turns a module off. 1.0.0
learnomy_admin_dashboard_after_stats $stats (array) The wp-admin dashboard stats row renders, before the widget grid. 1.0.0
learnomy_erase_authored_course $course_id, $user_id (int) A GDPR erasure request deletes a course authored by the erased user. 1.0.0
learnomy_erase_app_data $user_id (int) A GDPR erasure request clears app-specific data (devices, tokens) for a user. 1.0.0
learnomy_webhook_deleted $webhook_id (int) An outgoing webhook is deleted in wp-admin. 1.0.0
learnomy_student_enrolled $user_id, $course_id, $source A student is enrolled in a course, any source (free/purchase/membership/manual/webhook). 1.0.0

learnomy_commission_calculated signature note

learnomy_commission_calculated fires from two call sites (direct sale + engagement-based membership split). As of 1.7.0 both fire the same signature:

do_action( 'learnomy_commission_calculated', $transaction_id, $commission_id = 0, $context = [] );

If you have a listener registered with accepted_args of 1, it still works but only sees $transaction_id. Raise accepted_args to 2 or 3 to read the commission row id and context:

add_action( 'learnomy_commission_calculated', function ( $transaction_id, $commission_id, $context ) {
    // $commission_id is 0 on legacy call paths pre-1.7.0 data; check before use.
}, 10, 3 );

Filters

Filters let you change a value before Learnomy uses it. Always return the same type you received.

Hook Default Args Purpose Since
learnomy_live_session_duration 60 $minutes, $lesson Default length (minutes) of a live-session lesson when no duration is set. 1.7.0
learnomy_subscription_grace_days plugin default $days Grace period (days) after a failed subscription payment before access is revoked. 1.0.0
learnomy_notifications_async true $async Whether push/notification fan-out queues via Action Scheduler (true) or sends inline (false). 1.7.0
learnomy_zero_decimal_currencies JPY/KRW/etc set $currencies The set of currencies treated as zero-decimal (no cents) for price formatting. 1.0.0
learnomy_bulk_enroll_max 500 $cap Maximum rows accepted per bulk-enroll admin request. 1.3.1
learnomy_broadcast_max_audience 10000 $max_audience Maximum recipients a single push broadcast/announcement may target. 1.0.0
learnomy_standalone_dark_mode false none Show the Learnomy dark-mode toggle even when the active theme has no dark mode of its own. 1.0.0
learnomy_app_enabled false none Gates whether the mobile app may connect to this site. Free always returns false; Learnomy Pro raises it after a license check. 1.0.0
learnomy_app_config_branding branding defaults $branding Overrides the white-label branding block returned by GET /app/config. 1.0.0
learnomy_app_config_features feature-flag map $features Adds or flips feature flags in the GET /app/config response (one flag per Pro extension). 1.0.0
learnomy_app_config_legal legal-URL block $legal Overrides the legal URLs (privacy policy, terms, guidelines) in GET /app/config. 1.0.0
learnomy_app_min_version '1.0.0' none Minimum app semver this site supports; the app force-upgrades below this floor. 1.0.0
learnomy_privacy_authored_content_erasure 'delete' none GDPR policy for an erased instructor's authored courses ('delete' or 'reassign'). 1.0.0
learnomy_privacy_certificate_erasure 'delete' none GDPR policy for an erased user's issued certificates. 1.0.0
learnomy_privacy_content_reassign_to site admin user ID none Which user ID inherits reassigned content when the erasure policy is 'reassign'. 1.0.0
learnomy_privacy_authored_batch plugin default none Batch size for the GDPR authored-content erasure loop. 1.0.0
learnomy_lesson_unlock_is_valid $valid (bool) $valid, $user_id, $lesson_id, $course_id Final veto gate on a relative-drip lesson unlock; return false to keep a lesson locked. 1.0.0
learnomy_route_no_cache_for_user true $no_cache, $route Whether a logged-in-user-specific route is marked non-cacheable for page-cache plugins. 1.0.0
learnomy_model_where_default_limit 5000 $limit, $table Safety ceiling applied to any Model::where() query with no explicit limit. 1.0.0
learnomy_my_progress_max 20 none Maximum in-progress courses shown in the "My Progress" block/rail before a "view all" link takes over. 1.0.0
learnomy_progress_widget_max 10 none Maximum courses shown in the sidebar course-progress widget. 1.0.0
learnomy_closed_cta rendered HTML $html, $course, $user_id Overrides the call-to-action shown on a closed pricing-model course (external/managed-elsewhere courses). 1.3.1

Example: capping the bulk-enroll request size

add_filter( 'learnomy_bulk_enroll_max', function ( $cap ) {
    return 2000; // Raise the per-request cap for a high-volume onboarding import.
} );

Example: forcing notifications inline (small single-server sites)

add_filter( 'learnomy_notifications_async', '__return_false' );

Pro Filters

🔶 Pro feature. These filters only fire when Learnomy Pro is active.

Hook Default Purpose Since
learnomy_pro_credly_revoke_async true Revoke a Credly badge via a queued Action Scheduler job instead of inline, when a certificate is revoked. 1.7.0
learnomy_pro_credly_sync_async true Sync a Credly badge state via a queued job instead of an inline HTTP request. 1.7.0
learnomy_pro_payouts_async true Process Stripe Connect instructor payouts via a queued job instead of inline during the request. 1.7.0
learnomy_pro_spaces_fanout_batch_size 100 Batch size used when a Space notification fans out to its members. 1.0.0
// Force Credly sync inline for debugging.
add_filter( 'learnomy_pro_credly_sync_async', '__return_false' );

Related