Hooks & Filters
Actions#
| Hook | Arguments | Fired 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, $product | A recurring subscription payment extends an existing license. |
Filters#
| Filter | Default | Purpose |
|---|---|---|
license_cart_skip_license_email | false | Return true to suppress the purchase and renewal emails (for example when you send your own from the actions above). |
license_cart_redirect_customers_from_admin | true when a customer record exists | Receives $redirect, $user, $customer. Return false to let customers into wp-admin. |
license_cart_checkout_token_ttl | 6 * HOUR_IN_SECONDS | How long a pending checkout auto-login token stays valid. |
license_cart_max_release_size | 100 * MB_IN_BYTES | Maximum accepted release ZIP size. |
license_cart_skip_webhook_verification | false | Return true to accept unsigned webhooks only when no secret is configured. For local development only. |
license_cart_storeengine_product_id | plugin default | StoreEngine product ID License Cart itself is licensed against. 0 disables licensing of License Cart. |
license_cart_storeengine_store_url | https://technoleet.dev | Store used for License Cart’s own license checks and updates. |
license_cart_store_dashboard_url | https://technoleet.dev/dashboard/license-keys/ | Link shown on the License screen. |
license_cart_storeengine_allow_local | true | Whether 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?
Tell us what was missing
