You appear to be a bot. Output may be restricted
Description
Return the calculated completion percentage
Usage
$int = EDD_Batch_Sales_Export::get_percentage_complete();
Parameters
Returns
int
Source
File name: easy-digital-downloads/includes/admin/reporting/export/class-batch-export-sales.php
Lines:
1 to 39 of 39
public function get_percentage_complete() { global $edd_logs; $args = array( 'post_type' => 'edd_log', 'posts_per_page' => -1, 'post_status' => 'publish', 'fields' => 'ids', 'post_parent' => $this->download_id, 'tax_query' => array( array( 'taxonomy' => 'edd_log_type', 'field' => 'slug', 'terms' => 'sale' ) ), 'date_query' => array( array( 'after' => date( 'Y-n-d H:i:s', strtotime( $this->start ) ), 'before' => date( 'Y-n-d H:i:s', strtotime( $this->end ) ), 'inclusive' => true ) ) ); $logs = new WP_Query( $args ); $total = (int) $logs->post_count; $percentage = 100; if ( $total > 0 ) { $percentage = ( ( 30 * $this->step ) / $total ) * 100; } if ( $percentage > 100 ) { $percentage = 100; } return $percentage; }