WC_Settings_API::validate_text_field
Validate Text Field.
Make sure the data is escaped correctly, etc.
Method of the class: WC_Settings_API{}
No Hooks.
Returns
String
.
Usage
$WC_Settings_API = new WC_Settings_API(); $WC_Settings_API->validate_text_field( $key, $value );
- $key(string) (required)
- Field key.
- $value(string) (required)
- Posted Value.
WC_Settings_API::validate_text_field() WC Settings API::validate text field code WC 9.9.5
public function validate_text_field( $key, $value ) { $value = is_null( $value ) ? '' : $value; return wp_kses_post( trim( stripslashes( $value ) ) ); }