Merge pull request #16168 from webspecnick/add-filter-to-export-product-args

Add a filter to arguments passed to wc_get_products during prepare_data_to_export()
This commit is contained in:
Mike Jolley 2017-07-27 15:58:39 +01:00 committed by GitHub
commit decda1edf6
1 changed files with 2 additions and 1 deletions

View File

@ -124,7 +124,7 @@ class WC_Product_CSV_Exporter extends WC_CSV_Batch_Exporter {
*/
public function prepare_data_to_export() {
$columns = $this->get_column_names();
$products = wc_get_products( array(
$args = apply_filters( "woocommerce_product_export_{$this->export_type}_query_args", array(
'status' => array( 'private', 'publish' ),
'type' => $this->product_types_to_export,
'limit' => $this->get_limit(),
@ -135,6 +135,7 @@ class WC_Product_CSV_Exporter extends WC_CSV_Batch_Exporter {
'return' => 'objects',
'paginate' => true,
) );
$products = wc_get_products( $args );
$this->total_rows = $products->total;
$this->row_data = array();