WC_Settings_API::validate_price_field( string $key, string $value )
Validate Price Field.
Description Description
Make sure the data is escaped correctly, etc.
Parameters Parameters
- $key
-
(Required) Field key.
- $value
-
(Required) Posted Value.
Return Return
(string)
Source Source
File: includes/abstracts/abstract-wc-settings-api.php
public function validate_price_field( $key, $value ) { $value = is_null( $value ) ? '' : $value; return ( '' === $value ) ? '' : wc_format_decimal( trim( stripslashes( $value ) ) ); }