You appear to be a bot. Output may be restricted
Description
Check if the discount has expired.
Usage
$bool = EDD_Discount::is_expired( $update );
Parameters
- $update
- ( bool ) optional default: 1 – Update the discount to expired if an one is found but has an active status
Returns
bool Has the discount expired?
Source
File name: easy-digital-downloads/includes/class-edd-discount.php
Lines:
1 to 27 of 27
public function is_expired( $update = true ) { $return = false; if ( empty( $this->expiration ) ) { return $return; } $expiration = strtotime( $this->expiration ); if ( $expiration < time() ) { if ( $update ) { $this->update_status( 'inactive' ); $this->update_meta( 'status', 'expired' ); } $return = true; } /** * Filters if the discount has expired or not. * * @since 2.7 * * @param bool $return Has the discount expired or not. * @param int $ID Discount ID. */ return apply_filters( 'edd_is_discount_expired', $return, $this->ID ); }