Add WC Product CSV Exporter limit filter

with tons of products is nice to have an way to change the limit for the exporter (now is set to 50)

'''php
function wc_exporter_set_limit($limit) {
  return 1000;
}
add_filter( 'woocommerce_product_export_product_default_limit', 'wc_exporter_set_limit');
'''
This commit is contained in:
Luciano Amodio 2017-12-16 13:49:21 +01:00 committed by GitHub
parent 906efe1ffc
commit 27dd962be7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -50,6 +50,7 @@ class WC_Product_CSV_Exporter extends WC_CSV_Batch_Exporter {
*/
public function __construct() {
parent::__construct();
$this->set_limit(apply_filters( "woocommerce_product_export_{$this->export_type}_default_limit", $this->limit));
$this->set_product_types_to_export( array_merge( array_keys( wc_get_product_types() ), array( 'variation' ) ) );
}