• 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_receipt_show_download_files() – Show a download’s files in the purchase receipt

You appear to be a bot. Output may be restricted

Description

Show a download's files in the purchase receipt

Usage

$boolean = edd_receipt_show_download_files( $item_id, $receipt_args, $item );

Parameters

$item_id
( int ) required – The download ID
$receipt_args
( array ) required – Args specified in the [edd_receipt] shortcode
$item
( array ) optional – Cart item array

Returns

boolean

Source

File name: easy-digital-downloads/includes/checkout/template.php


Lines:

1 to 33 of 33
function edd_receipt_show_download_files( $item_id, $receipt_args, $item = array() ) {

  $ret = true;

  /*
	 * If re-download is disabled, set return to false
	 *
	 * When the purchase session is still present AND the receipt being shown is for that purchase,
	 * file download links are still shown. Once session expires, links are disabled
	 */
  if ( edd_no_redownload() ) {

    $key     = isset( $_GET['payment_key'] ) ? sanitize_text_field( $_GET['payment_key'] ) : '';
    $session = edd_get_purchase_session();

    if ( ! empty( $key ) && ! empty( $session ) && $key != $session['purchase_key'] ) {

      // We have session data but the payment key provided is not for this session
      $ret = false;

    } elseif ( empty( $session ) ) {

      // No session data is present but a key has been provided
      $ret = false;

    }


  }

  return apply_filters( 'edd_receipt_show_download_files', $ret, $item_id, $receipt_args, $item );
}
 

 View on GitHub View on Trac

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

Primary Sidebar

Information

Function name: edd_receipt_show_download_files
Plugin ref: Easy Digital Downloads
Version: 2.10.1
Sourcefile: includes/checkout/template.php
File ref: includes/checkout/template.php
Deprecated?: No
API Letters: D,E,F,R,S

Footer

Easy Digital Downloads a2z
Easy Digital Downloads a2z
Easy Digital Downloads a2z
WordPress 5.7
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-2021. All rights reserved.


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

  • Home
  • Blog
  • Sitemap
  • Sites