update multicurrencies functionality on global level

This commit is contained in:
dwindown
2025-08-25 19:55:38 +07:00
parent 38b6b5cddb
commit ccb2b1aea1
21 changed files with 1240 additions and 476 deletions

View File

@@ -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;
}