update multicurrencies functionality on global level
This commit is contained in:
8
vendor/wpcfto/metaboxes/metabox.php
vendored
8
vendor/wpcfto/metaboxes/metabox.php
vendored
@@ -162,11 +162,13 @@ class STM_Metaboxes {
|
||||
}
|
||||
|
||||
public function wpcfto_save_number( $value ) {
|
||||
$value = floatval( $value );
|
||||
if ( 0 === $value ) {
|
||||
// Preserve zero as a valid value; do not coerce to empty string.
|
||||
// This aligns server-side with client-side required validation.
|
||||
if ($value === '' || $value === null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Allow string "0", numeric 0, or any float.
|
||||
$value = is_numeric($value) ? $value + 0 : $value;
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user