Black Friday: 79% off every plugin Shop the sale →

Hooks & Filters

Actions#

HookArgumentsFired when
license_cart_license_created$license (object), $customer_email (string), $product (object)A webhook issues a new license. Runs before the purchase email.
license_cart_license_renewed$license, $customer_email, $productA recurring subscription payment extends an existing license.

Filters#

FilterDefaultPurpose
license_cart_skip_license_emailfalseReturn true to suppress the purchase and renewal emails (for example when you send your own from the actions above).
license_cart_redirect_customers_from_admintrue when a customer record existsReceives $redirect, $user, $customer. Return false to let customers into wp-admin.
license_cart_checkout_token_ttl6 * HOUR_IN_SECONDSHow long a pending checkout auto-login token stays valid.
license_cart_max_release_size100 * MB_IN_BYTESMaximum accepted release ZIP size.
license_cart_skip_webhook_verificationfalseReturn true to accept unsigned webhooks only when no secret is configured. For local development only.
license_cart_storeengine_product_idplugin defaultStoreEngine product ID License Cart itself is licensed against. 0 disables licensing of License Cart.
license_cart_storeengine_store_urlhttps://technoleet.devStore used for License Cart’s own license checks and updates.
license_cart_store_dashboard_urlhttps://technoleet.dev/dashboard/license-keys/Link shown on the License screen.
license_cart_storeengine_allow_localtrueWhether local/.test sites may activate a License Cart key.

Constants LICENSE_CART_STOREENGINE_PRODUCT_ID and LICENSE_CART_STOREENGINE_STORE_URL override the two StoreEngine filters when defined in wp-config.php.

Examples#

Send the key to a CRM when a license is issued:

add_action( 'license_cart_license_created', function ( $license, $customer_email, $product ) {
    wp_remote_post( 'https://crm.example.com/hooks/license', array(
        'body' => array(
            'email'   => $customer_email,
            'product' => $product->slug,
            'key'     => $license->license_key,
            'expires' => $license->expires_at,
        ),
    ) );
}, 10, 3 );

Let customers use wp-admin (for example when they also have a membership):

add_filter( 'license_cart_redirect_customers_from_admin', '__return_false' );

Allow larger release uploads:

add_filter( 'license_cart_max_release_size', function () {
    return 250 * MB_IN_BYTES;
} );
Was this article helpful?