benecaster_addon_is_active()
Returns true when a specific add-on is installed, active, and licensed.
Access: Free (can be called from any context)
Since: Batch 2
Signature
benecaster_addon_is_active( string $addon_slug ): bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$addon_slug |
string |
The add-on slug to check (e.g. 'migration-wizard', 'email-editor') |
Return Value
true when all three conditions are met:
- The add-on plugin is installed and active in WordPress
- The add-on slug is present in the license’s
active_addonsarray (from the last validation response) — OR the site is on a Studio plan (which includes all add-ons) - The core Benecaster license is in an active or grace-period state
false when any condition is not met.
Add-on Slugs
| Slug | Add-on |
|---|---|
'migration-wizard' |
Migration Wizard |
'email-editor' |
Email Editor |
'analytics-dashboard' |
Analytics Dashboard |
'blocks-library' |
Blocks & Widgets Library (free add-on) |
'chapter-markers' |
Chapter Markers |
'transcription' |
Transcription Service |
'guest-manager' |
Guest Manager |
'paypal-gateway' |
PayPal Gateway |
Usage
// Conditionally load cross-add-on integration code
if ( benecaster_addon_is_active( 'email-editor' ) ) {
require_once __DIR__ . '/integrations/email-editor.php';
}
// Gate a cross-add-on recipe behind both add-ons
if (
benecaster_addon_is_active( 'migration-wizard' ) &&
benecaster_addon_is_active( 'email-editor' )
) {
// Send branded welcome email to migrated subscribers
}
Notes
- Studio plan sites pass this check for all add-on slugs regardless of whether the add-on plugin is explicitly in the
active_addonsarray — Studio includes all add-ons by entitlement. - The Blocks & Widgets Library add-on (
'blocks-library') is free and does not require a paid license; it only requires the plugin to be installed and activated. - Reads from locally cached license data — no HTTP call. Safe to call on every request.
Related
benecaster_is_premium()— check if any paid plan is activebenecaster_get_license_plan()— returns the current plan slug