• 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_Batch_Earnings_Report_Export::print_csv_cols() – Output the CSV columns.

You appear to be a bot. Output may be restricted

Description

Output the CSV columns.

We make use of this function to set up the header of the earnings report.

Usage

$array = EDD_Batch_Earnings_Report_Export::print_csv_cols();

Parameters

Returns

array $cols CSV header.

Source

File name: easy-digital-downloads/includes/admin/reporting/export/class-batch-export-earnings-report.php
Lines:

1 to 38 of 38
  public function print_csv_cols() {
    $cols         = $this->get_csv_cols();
    $col_data     = '';
    $column_count = count( $cols );
    for ( $i = 0; $i < $column_count; $i++ ) {
      $col_data .= $cols[ $i ];

      // We don't need an extra space after the first column
      if ( $i == 0 ) {
        $col_data .= ',';
        continue;
      }

      if ( $i == ( $column_count - 1 ) ) {
        $col_data .= "\r\n";
      } else {
        $col_data .= ",,";
      }
    }

    $statuses    = $this->get_supported_statuses();
    $number_cols = count( $statuses ) + 2;

    $col_data .= ',';
    for ( $i = 1; $i <= $number_cols; $i++ ) {
      $col_data .= __( 'Order Count', 'easy-digital-downloads' ) . ',';
      $col_data .= __( 'Gross Amount', 'easy-digital-downloads' );

      if ( $number_cols !== $i ) {
        $col_data .= ',';
      }
    }
    $col_data .= "\r\n";

    $this->stash_step_data( $col_data );

    return $col_data;
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 26th January 2022

Primary Sidebar

Information

Function name: EDD_Batch_Earnings_Report_Export::print_csv_cols
Class ref: EDD_Batch_Earnings_Report_Export
Plugin ref: Easy Digital Downloads
Version: 2.11.6
Sourcefile: includes/admin/reporting/export/class-batch-export-earnings-report.php
File ref: includes/admin/reporting/export/class-batch-export-earnings-report.php
Deprecated?: No
API Letters: B,E,R

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