← All changes
|
includes/_shared-ui-catalog/class-wpbc-ui-catalog-inline-field-schema.php
+9
-1
11.6
→
11.9
View file →
| @@ -97,11 +97,19 @@ | ||
| 97 | 97 | if ( isset( $raw_field[ $property_name ] ) && is_scalar( $raw_field[ $property_name ] ) ) { |
| 98 | 98 | $normalized_field[ $property_name ] = wp_strip_all_tags( (string) $raw_field[ $property_name ] ); |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | - foreach ( array( 'min', 'max', 'step', 'maxlength', 'default_value', 'slider_min', 'slider_max', 'slider_step' ) as $property_name ) { | |
| 101 | + foreach ( array( 'min', 'max', 'maxlength', 'default_value', 'slider_min', 'slider_max', 'slider_step' ) as $property_name ) { | |
| 102 | 102 | if ( isset( $raw_field[ $property_name ] ) && is_numeric( $raw_field[ $property_name ] ) ) { |
| 103 | 103 | $normalized_field[ $property_name ] = (float) $raw_field[ $property_name ]; |
| 104 | + } | |
| 105 | + } | |
| 106 | + if ( isset( $raw_field['step'] ) && is_scalar( $raw_field['step'] ) ) { | |
| 107 | + $raw_step = strtolower( trim( (string) $raw_field['step'] ) ); | |
| 108 | + if ( 'any' === $raw_step ) { | |
| 109 | + $normalized_field['step'] = 'any'; | |
| 110 | + } elseif ( is_numeric( $raw_step ) ) { | |
| 111 | + $normalized_field['step'] = (float) $raw_step; | |
| 104 | 112 | } |
| 105 | 113 | } |
| 106 | 114 | if ( isset( $raw_field['operations'] ) ) { |
| 107 | 115 | $normalized_field['operations'] = self::normalize_choices( $raw_field['operations'], 'id' ); |