Function Reference

lmfwc_add_license()

[php]
function lmfwc_add_license(string $licenseKey, array $licenseData)
[/php]

DESCRIPTION

Adds a new license to the database.

PARAMETERS

$licenseKey (string) (Required)
The license key being added.

$licenseData (array) (Optional)
Key/value pairs. The keys must match the license table columns names.

RETURN VALUE

(bool|LicenseManagerForWooCommerce\Models\Resources\License)
License model on success, false on failure.

SOURCE CODE

/includes/functions/lmfwc-license-functions.php#24

lmfwc_get_license()

[php]function lmfwc_get_license(string $licenseKey)[/php]

DESCRIPTION

Retrieves an existing license from the database.

PARAMETERS

$licenseKey (string) (Required)
The license key to retrieve.

RETURN VALUE

(bool|LicenseManagerForWooCommerce\Models\Resources\License)
License model on success, false on failure.

SOURCE CODE

/includes/functions/lmfwc-license-functions.php#113

lmfwc_get_licenses()

[php]function lmfwc_get_licenses(array $query)[/php]

DESCRIPTION

Retrieves multiple existing licenses from the database.

PARAMETERS

$query (array) (Required)
Key/value pairs. The keys will be used to match the license table columns names, and the values will be used to match the values of those columns.

RETURN VALUE

(bool|LicenseManagerForWooCommerce\Models\Resources\License[])
License model array on success, false on failure.

SOURCE CODE

/includes/functions/lmfwc-license-functions.php#136

lmfwc_update_license()

[php]function lmfwc_update_license(string $licenseKey, array $licenseData)[/php]

DESCRIPTION

Updates an existing license.

PARAMETERS

$licenseKey (string) (Required)
The license key is being updated.

$licenseData (array) (Optional)
Key/value pairs. The keys must match the license table columns names.

RETURN VALUE

(bool|LicenseManagerForWooCommerce\Models\Resources\License)
License model on success, false on failure.

SOURCE CODE

/includes/functions/lmfwc-license-functions.php#155

lmfwc_delete_license()

[php]function lmfwc_delete_license(string $licenseKey)[/php]

DESCRIPTION

Deletes a license from the database.

PARAMETERS

$licenseKey (string) (Required)
The license key to delete.

RETURN VALUE

(bool)
True on success, false on failure.

SOURCE CODE

/includes/functions/lmfwc-license-functions.php#304

lmfwc_activate_license()

[php]function lmfwc_activate_license(string $licenseKey, array $args = [])[/php]

DESCRIPTION

Activates a license if it has not already reached its maximum activation count.

PARAMETERS

$licenseKey (string) (Required)
The license key to activate.

$args (array) (Optional)
Optional arguments for activation.

-token (string) (Optional)
Token for reactivation.

-source (string) (Optional)
Activation source.

-label (string) (Optional)
Custom label for activation.

-meta_data (array) (Optional)
Additional metadata.

RETURN VALUE

(bool|LicenseManagerForWooCommerce\Models\Resources\License)
License model on success, false on failure.

SOURCE CODE

/includes/functions/lmfwc-license-functions.php#343

lmfwc_reactivate_license()

[php]function lmfwc_reactivate_license(string $activation_token
)[/php]

DESCRIPTION

Activates a license if it has not already reached its maximum activation count.

PARAMETERS

$activation_token(string) (Required)
Activation token to reactivate

RETURN VALUE

(bool|LicenseManagerForWooCommerce\Models\Resources\License)
License model on success, false on failure.

SOURCE CODE

/includes/functions/lmfwc-license-functions.php#693

lmfwc_deactivate_license()

[php]function lmfwc_deactivate_license($licenseKey, $args)[/php]

DESCRIPTION

Deactivates a license if it has not already reached 0 activations.

PARAMETERS

$licenseKey (string) (Required)
The license key to deactivate.

$args (array) (Required)
The specific activation token to deactivate

RETURN VALUE

(bool|LicenseManagerForWooCommerce\Models\Resources\License)
License model on success, false on failure.

SOURCE CODE

/includes/functions/lmfwc-license-functions.php#399

lmfwc_add_license_meta()

[php]function lmfwc_add_license_meta(int $licenseId, string $metaKey, mixed $metaValue)[/php]

DESCRIPTION

Adds a new meta entry to a license, if it already exists a new row in the database table will be added.

PARAMETERS

$licenseId (string) (Required)
The ID of the license key.

$metaKey (string) (Required)
Name of the meta entry.

$metaValue (mixed) (Required)
Value of the meta entry.

RETURN VALUE

(mixed|bool)
Meta value on success, false on failure.

SOURCE CODE

/includes/functions/lmfwc-meta-functions.php#24

lmfwc_get_license_meta()

[php]function lmfwc_get_license_meta(int $licenseId, string $metaKey, bool $single = false)[/php]

DESCRIPTION

Retrieves single or multiple license meta entries.

PARAMETERS

$licenseId (string) (Required)
The ID of the license key.

$metaKey (string) (Required)
Name of the meta entry.

$single (bool) (Optional)
If multiple meta entries exist, setting this parameter to true will retrieve all of them.

RETURN VALUE

(mixed|mixed[]|bool)
Meta value on success, false on failure.

SOURCE CODE

/includes/functions/lmfwc-meta-functions.php#57

lmfwc_update_license_meta()

[php]function lmfwc_update_license_meta(int $licenseId, string $metaKey, mixed $metaValue, mixed $previousValue = null)[/php]

DESCRIPTION

Updates an existing license meta entry. If the meta key doesn’t already exist, a new row in the database table will be added. If the $previousValue parameter is passed, the meta entry with that value will be updated.

PARAMETERS

$licenseId (string) (Required)
The ID of the license key.

$metaKey (string) (Required)
Name of the meta entry.

$metaValue (mixed) (Required)
Value of the meta entry.

$previousValue (mixed) (Optional)
The previous value of the meta entry.

RETURN VALUE

(bool)
True on success, false on failure.

SOURCE CODE

/includes/functions/lmfwc-meta-functions.php#107

lmfwc_delete_license_meta()

[php]function lmfwc_delete_license_meta(int $licenseId, string $metaKey, mixed $metaValue = null)[/php]

DESCRIQPTION

Deletes a license meta entry. If the $metaValue parameter is passed, the function will look for the meta entry with a matching value to delete.

PARAMETERS

$licenseId (string) (Required)
The ID of the license key.

$metaKey (string) (Required)
Name of the meta entry.

$metaValue (mixed) (Optional)
Value of the meta entry.

RETURN VALUE

(bool)
True on success, false on failure.

SOURCE CODE

/includes/functions/lmfwc-meta-functions.php#158

On this page

    Scroll to Top
    license Manager For WooCommerce

    Privacy Overview

    This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.