AddonHostAdapter.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WhatsappScoped\YayCommerce\AdminShell\Contracts; |
| 4 | |
| 5 | /** |
| 6 | * Optional interface for plugins that host licensed addons. |
| 7 | * |
| 8 | * When a plugin adapter implements this alongside PluginMenuAdapter, |
| 9 | * AdminShell creates an AddonBridge that reads the declared filter, |
| 10 | * registers addon entries in the LicenseRegistry, and renders |
| 11 | * license cards for them on the Licenses page. |
| 12 | * |
| 13 | * Example: YayMail Lite's adapter implements both PluginMenuAdapter |
| 14 | * and AddonHostAdapter, returning 'yaymail_available_licensing_plugins'. |
| 15 | * All existing addons continue using that filter unchanged. |
| 16 | * @internal |
| 17 | */ |
| 18 | interface AddonHostAdapter |
| 19 | { |
| 20 | /** |
| 21 | * WordPress filter name that addons use to register their licensing data. |
| 22 | * |
| 23 | * The filter must return an array of entries, each with: |
| 24 | * [ 'slug', 'name', 'basename', 'file', 'url', 'item_id' ] |
| 25 | * |
| 26 | * Same format as yaycommerce_licensing_plugins. |
| 27 | */ |
| 28 | public function get_addon_licensing_filter() : string; |
| 29 | } |
| 30 |