apply_filters( 'DevOwl/RealProductManager/License/Programmatic/$slug', $activation, $blogId, $siteUrlHostname ) → {array|false}
Activate a license programmatically.
Parameters:
Name | Type | Description |
---|---|---|
$activation |
array | false | The activation for this blog and host, |
$blogId |
int | Blog ID within a multisite installation, for non-multisite installation this is always 1 |
$siteUrlHostname |
string | The hostname of your WordPress installation (including subdomain, without path and protocol) |
- Since:
- 1.11.0
Returns:
- Type
- array | false
Example
add_filter(
'DevOwl/RealProductManager/License/Programmatic/real-cookie-banner-pro',
function ($activation, $blogId, $siteUrlHostname) {
if (
// Check if there is already a programmatic activation so we do not overwrite
$activation === false &&
// Check the blog ID within a multisite installation, for non-multisite installation this is always 1
$blogId === 1 &&
// The hostname of your WordPress installation (including subdomain, without path and protocol)
$siteUrlHostname === 'example.your-host.com'
) {
return [
// You must pass `true` for the activation to work; you thereby agree to privacy policies of the plugin to be activated
'optInPrivacyPolicy' => true,
'key' => 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
'environment' => 'production', // optional, default: production, can also be `development`
'telemetry' => true // optional
];
}
return $activation;
},
10,
3
);