Are you using Easy Digital Downloads Software Licensing and looking for a hook after the license is inserted/updated or changed in any way? If yes, the hook is edd_sl_db_updated, and here’s the example usage:

add_action( 'edd_sl_db_updated', 'cb_update' );
function cb_update( $license_id ) {
      // Do something.
}

The $license_id parameter can be used to get the license details. Below are the examples of details you can get:

$key        = edd_software_licensing()->get_license_key( $license_id );
$status     = edd_software_licensing()->get_license_status( $license_id );
$expiration = edd_software_licensing()->get_license_expiration( $license_id );
$price_id   = edd_software_licensing()->get_price_id( $license_id );

Hook after the license is deleted

Similarly, edd_sl_license_deleted hook can be used after the license is deleted, the $license_id parameter is also available. However, note that the license details aren’t available since the details are already deleted from the database.

I hope it’s helpful!

EDD hook after the license is updated in the database
Tagged on:

Sanjeev Aryal

Don't bury your thoughts, put your vision into reality ~ Bob Marley.

Leave a Reply

Your email address will not be published. Required fields are marked *

× WhatsApp