benecaster_installed_addons
Filters the list of add-on slugs Benecaster considers loaded on this site. Add-on plugins hook it at benecaster_boot to declare themselves, which moves their card on the Add-ons screen from ‘Ready to install’ into ‘Installed’.
This filter does not grant entitlement, and cannot be used to unlock a paid add-on. Benecaster tracks two separate things: whether you are entitled to an add-on, which comes from your licence and is what benecaster_addon_is_active() reports, and whether the add-on is actually loaded on this install, which is what this filter declares. Adding a slug here changes which section a card renders in; it does not change what you are licensed for.
Tell the Add-ons screen that this add-on plugin is loaded
Benecaster fires benecaster_installed_addons during admin bootstrapping to build the list of loaded add-ons. Each add-on plugin should hook this filter inside its benecaster_boot callback and append its fully-qualified slug. Without this hook, a purchased-and-activated add-on renders as “Ready to install” because the Add-ons screen has no other way to distinguish entitled from actually loaded. The registry deduplicates.
Also declare the add-on in its plugin header. A deactivated plugin runs no code, so the filter cannot report it. Benecaster recognises a deactivated add-on by a Benecaster Add-on header in its main plugin file instead, whose value is the same slug:
<?php
/**
* Plugin Name: Benecaster Guest Manager
* Version: 1.0.0
* Benecaster Add-on: benecaster-addon-guest-manager
*/
The folder name does not matter, so a renamed folder still counts. A plugin without the header is never treated as an add-on while it is deactivated, whatever it is called, and does not appear in the deactivated_addons figure that opted-in sites report.
<?php
add_action( 'benecaster_boot', function (): void {
add_filter( 'benecaster_installed_addons', static function ( array $slugs ): array {
$slugs[] = 'benecaster-addon-guest-manager';
return $slugs;
} );
} );
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$slugs |
array |
— | Array of installed add-on slug strings (e.g. 'benecaster-addon-guest-manager') |
Returns:
array
Affects
- Add-ons screen — installed vs. ready-to-install card state
Need this built rather than just documented? See our services →