From 30ba25d53561b9ce9387ce26d5e0f13f88dfa506 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 18 Apr 2018 11:24:07 +0100 Subject: [PATCH] Remove defaults --- .../settings/class-wc-settings-accounts.php | 15 +++------------ includes/class-wc-privacy.php | 17 ++++------------- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/includes/admin/settings/class-wc-settings-accounts.php b/includes/admin/settings/class-wc-settings-accounts.php index ab92c7ca834..d82684cbed8 100644 --- a/includes/admin/settings/class-wc-settings-accounts.php +++ b/includes/admin/settings/class-wc-settings-accounts.php @@ -105,10 +105,7 @@ class WC_Settings_Accounts extends WC_Settings_Page { 'id' => 'woocommerce_trash_pending_orders', 'type' => 'relative_date_selector', 'placeholder' => __( 'N/A', 'woocommerce' ), - 'default' => array( - 'number' => 30, - 'unit' => 'days', - ), + 'default' => '', 'autoload' => false, ), array( @@ -117,10 +114,7 @@ class WC_Settings_Accounts extends WC_Settings_Page { 'id' => 'woocommerce_trash_failed_orders', 'type' => 'relative_date_selector', 'placeholder' => __( 'N/A', 'woocommerce' ), - 'default' => array( - 'number' => 30, - 'unit' => 'days', - ), + 'default' => '', 'autoload' => false, ), array( @@ -129,10 +123,7 @@ class WC_Settings_Accounts extends WC_Settings_Page { 'id' => 'woocommerce_trash_cancelled_orders', 'type' => 'relative_date_selector', 'placeholder' => __( 'N/A', 'woocommerce' ), - 'default' => array( - 'number' => 30, - 'unit' => 'days', - ), + 'default' => '', 'autoload' => false, ), array( diff --git a/includes/class-wc-privacy.php b/includes/class-wc-privacy.php index 6b41f8a8d7f..dbff0f260df 100644 --- a/includes/class-wc-privacy.php +++ b/includes/class-wc-privacy.php @@ -89,7 +89,7 @@ class WC_Privacy { self::$background_process->push_to_queue( array( 'task' => 'trash_pending_orders' ) ); self::$background_process->push_to_queue( array( 'task' => 'trash_failed_orders' ) ); self::$background_process->push_to_queue( array( 'task' => 'trash_cancelled_orders' ) ); - //self::$background_process->push_to_queue( array( 'task' => 'anonymize_completed_orders' ) ); + // self::$background_process->push_to_queue( array( 'task' => 'anonymize_completed_orders' ) );. self::$background_process->save()->dispatch(); } @@ -101,10 +101,7 @@ class WC_Privacy { * @return int Number of orders processed. */ public static function trash_pending_orders( $limit = 20 ) { - $option = wc_parse_relative_date_option( get_option( 'woocommerce_trash_pending_orders', array( - 'number' => 30, - 'unit' => 'days', - ) ) ); + $option = wc_parse_relative_date_option( get_option( 'woocommerce_trash_pending_orders' ) ); if ( empty( $option['number'] ) ) { return 0; @@ -125,10 +122,7 @@ class WC_Privacy { * @return int Number of orders processed. */ public static function trash_failed_orders( $limit = 20 ) { - $option = wc_parse_relative_date_option( get_option( 'woocommerce_trash_failed_orders', array( - 'number' => 30, - 'unit' => 'days', - ) ) ); + $option = wc_parse_relative_date_option( get_option( 'woocommerce_trash_failed_orders' ) ); if ( empty( $option['number'] ) ) { return 0; @@ -149,10 +143,7 @@ class WC_Privacy { * @return int Number of orders processed. */ public static function trash_cancelled_orders( $limit = 20 ) { - $option = wc_parse_relative_date_option( get_option( 'woocommerce_trash_cancelled_orders', array( - 'number' => 30, - 'unit' => 'days', - ) ) ); + $option = wc_parse_relative_date_option( get_option( 'woocommerce_trash_cancelled_orders' ) ); if ( empty( $option['number'] ) ) { return 0;