Merge pull request #18186 from woocommerce/fix/no-strict-array-select-settings
Option value comparison when saving select settings
This commit is contained in:
commit
7c029d18e9
|
@ -727,7 +727,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'select':
|
case 'select':
|
||||||
$allowed_values = empty( $option['options'] ) ? array() : array_keys( $option['options'] );
|
$allowed_values = empty( $option['options'] ) ? array() : array_map( 'strval', array_keys( $option['options'] ) );
|
||||||
if ( empty( $option['default'] ) && empty( $allowed_values ) ) {
|
if ( empty( $option['default'] ) && empty( $allowed_values ) ) {
|
||||||
$value = null;
|
$value = null;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue