diff --git a/classes/abstracts/abstract-wc-settings-api.php b/classes/abstracts/abstract-wc-settings-api.php index d76a2e74665..a9b7fb6d103 100644 --- a/classes/abstracts/abstract-wc-settings-api.php +++ b/classes/abstracts/abstract-wc-settings-api.php @@ -137,7 +137,7 @@ abstract class WC_Settings_API { * @param mixed $empty_value * @return void */ - public function get_option( $key, $empty_value = '' ) { + public function get_option( $key, $empty_value = null ) { if ( empty( $this->settings ) ) $this->init_settings(); @@ -147,7 +147,7 @@ abstract class WC_Settings_API { $this->settings[ $key ] = isset( $this->form_fields[ $key ]['default'] ) ? $this->form_fields[ $key ]['default'] : ''; } - if ( empty( $this->settings[ $key ] ) ) + if ( ! is_null( $empty_value ) && empty( $this->settings[ $key ] ) ) $this->settings[ $key ] = $empty_value; return $this->settings[ $key ]; diff --git a/readme.txt b/readme.txt index 1be5e6b696d..25d57f000dc 100644 --- a/readme.txt +++ b/readme.txt @@ -176,6 +176,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc * Fix - Fix the download method when force SSL is on. * Fix - Put back sandbox pending fix. Aparently still needed for some accounts. * Fix - Do not sanitize old attribute name to not mess up comparing +* Fix - Settings API empty value only used if set. In turn fixes blank values in flat rate shipping. * Tweak - UX - Placeholder fades out on focus * Tweak - UX - Only display validation result on required fields * Localisation - NZ States