• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Easy Digital Downloads a2z

Easy Digital Downloads a2z

Easy Digital Downloads a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / EDD_Discount::is_expired() – Check if the discount has expired.

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 );
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 13th March 2021

Primary Sidebar

Information

Function name: EDD_Discount::is_expired
Class ref: EDD_Discount
Plugin ref: Easy Digital Downloads
Version: 2.11.6
Sourcefile: includes/class-edd-discount.php
File ref: includes/class-edd-discount.php
Deprecated?: No
API Letters: D,E,I

Footer

Easy Digital Downloads a2z
Easy Digital Downloads a2z
Easy Digital Downloads a2z
WordPress 5.9.3
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  edd.wp-a2z.org
© Copyright Easy Digital Downloads a2z 2014-2022. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites