Replace truthy check with isset when setting default checkout field value (#48031)
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
This commit is contained in:
parent
d2046b1573
commit
506dac269e
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Fix a bug with the woocommerce_get_default_value_for_{key} filter that was preventing setting a falsey value on a checkbox (i.e. to uncheck it dynamically)
|
|
@ -1187,7 +1187,7 @@ class CheckoutFields {
|
||||||
*/
|
*/
|
||||||
$value = apply_filters( "woocommerce_get_default_value_for_{$missing_field}", null, $group, $wc_object );
|
$value = apply_filters( "woocommerce_get_default_value_for_{$missing_field}", null, $group, $wc_object );
|
||||||
|
|
||||||
if ( $value ) {
|
if ( isset( $value ) ) {
|
||||||
$meta_data[ $missing_field ] = $value;
|
$meta_data[ $missing_field ] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue