[2.4] Default value should not apply if value of option is 0

Fixes #9270 @claudiosmweb
This commit is contained in:
Mike Jolley 2015-10-05 15:07:46 +01:00
parent 84f83e0bf4
commit 1ec3cb0ef6
1 changed files with 1 additions and 1 deletions

View File

@ -185,7 +185,7 @@ abstract class WC_Settings_API {
$this->settings[ $key ] = isset( $form_fields[ $key ]['default'] ) ? $form_fields[ $key ]['default'] : '';
}
if ( ! is_null( $empty_value ) && empty( $this->settings[ $key ] ) ) {
if ( ! is_null( $empty_value ) && empty( $this->settings[ $key ] ) && '' === $this->settings[ $key ] ) {
$this->settings[ $key ] = $empty_value;
}