Home / Files / templates/emails/plain/email-downloads.php


Lines: 1 to 52 of 52

<?php

/**
 * Email Downloads.
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-downloads.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see https://docs.woocommerce.com/document/template-structure/
 * @package WooCommerce/Templates
 * @version 3.4.0
 */

defined( 'ABSPATH' ) || exit;

echo esc_html( wc_strtoupper( __( 'Downloads', 'woocommerce' ) ) ) . "\n\n";

foreach ( $downloads as $download ) {
  foreach ( $columns as $column_id => $column_name ) {
    echo wp_kses_post( $column_name ) . ': ';

    if ( has_action( 'woocommerce_email_downloads_column_' . $column_id ) ) {
      do_action( 'woocommerce_email_downloads_column_' . $column_id, $download, $plain_text );
    } else {
      switch ( $column_id ) {
        case 'download-product':
          echo esc_html( $download['product_name'] );
          break;
        case 'download-file':
          echo esc_html( $download['download_name'] ) . ' - ' . esc_url( $download['download_url'] );
          break;
        case 'download-expires':
          if ( ! empty( $download['access_expires'] ) ) {
            echo esc_html( date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ) );
          } else {
            esc_html_e( 'Never', 'woocommerce' );
          }
          break;
      }
    }
    echo "\n";
  }
  echo "\n";
}
echo '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=';
echo "\n\n";
 

 View on GitHub View on Trac

Called by

    Invoked by

      Calls

      1 to 10 of 10

      • __() – Retrieve the translation of $text.
      • date_i18n() – Retrieve the date in localized format, based on timestamp.
      • do_action() – Execute functions hooked on a specific action hook.
      • esc_html_e() – Display translated text that has been escaped for safe use in HTML output.
      • esc_html() – Escaping for HTML blocks.
      • esc_url() – Checks and cleans a URL.
      • get_option() – Retrieves an option value based on an option name.
      • has_action() – Check if any action has been registered for a hook.
      • wc_strtoupper() – Wrapper for mb_strtoupper which see’s if supported first.
      • wp_kses_post() – Sanitize content for allowed HTML tags for post content.

      Call hooks

      1 to 1 of 1

      • woocommerce_email_downloads_column_$column_id – action
      File name: templates/emails/plain/email-downloads.php
      Plugin ref: WooCommerce
      Version: 3.6.0-dev
      Deprecated?: No
      API Letters: D,E,P,T

      Published: 6th August 2017 | Last updated: 27th May 2018

      Information

      File name: templates/emails/plain/email-downloads.php
      Plugin ref: WooCommerce
      Version: 3.6.0-dev
      Deprecated?: No
      API Letters: D,E,P,T

      templates/emails/plain
      • Plugins
      • Themes
      • Shortcodes
      • APIs
      • Files
      • Hooks
      • Classes
      • Sites
      • Sitemap
      • Blog
      WooCommerce a2z WooCommerce a2z
      WooCommerce

      Site:  woocommerce.wp-a2z.org
      © Copyright WooCommerce a2z 2014-2019. All rights reserved.


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