Settings API empty value only used if set. In turn fixes blank values in flat rate shipping.
This commit is contained in:
parent
042af6051f
commit
6079c8f0e3
|
@ -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 ];
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue