Fixes PHP 5.2 compatibility issues

This commit is contained in:
Jonathan Belcher 2018-10-23 12:47:51 -04:00
parent 03c8e42364
commit b58043380e
1 changed files with 4 additions and 4 deletions

View File

@ -23,8 +23,6 @@ defined( 'ABSPATH' ) || exit;
*/
class WC_Admin_Reports_Products_Query extends WC_Admin_Reports_Query {
const REPORT_NAME = 'report-products';
/**
* Valid fields for Products report.
*
@ -40,8 +38,10 @@ class WC_Admin_Reports_Products_Query extends WC_Admin_Reports_Query {
* @return array
*/
public function get_data() {
$args = apply_filters( 'woocommerce_reports_products_query_args', $this->get_query_vars() );
$results = WC_Data_Store::load( $this::REPORT_NAME )->get_data( $args );
$args = apply_filters( 'woocommerce_reports_products_query_args', $this->get_query_vars() );
$data_store = WC_Data_Store::load( 'report-products' );
$results = $data_store->get_data( $args );
return apply_filters( 'woocommerce_reports_products_select_query', $results, $args );
}