Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function edd_sl_check_for_expired_licenses() {
- $args = array(
- 'number' => -1,
- 'parent' => 0, // Child keys get expired during set_license_status()
- 'expiration' => array(
- 'start' => strtotime( '-1 Month' ),
- 'end' => current_time( 'timestamp' ),
- ),
- 'status' => array( 'active', 'inactive', 'disabled' ),
- );
- $args = apply_filters( 'edd_sl_expired_licenses_args', $args );
- $licenses = edd_software_licensing()->licenses_db->get_licenses( $args );
- if( ! $licenses ) {
- return; // no expiring keys found
- }
- foreach( $licenses as $license ) {
- $license->status = 'expired';
- }
- }
- add_action( 'edd_daily_scheduled_events', 'edd_sl_check_for_expired_licenses' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement