WC_REST_Controller::validate_setting_text_field()publicWC 3.0.0

Validate a text value for a text based setting.

Method of the class: WC_REST_Controller{}

No Hooks.

Return

String.

Usage

$WC_REST_Controller = new WC_REST_Controller();
$WC_REST_Controller->validate_setting_text_field( $value, $setting );
$value(string) (required)
Value.
$setting(array) (required)
Setting.

Changelog

Since 3.0.0 Introduced.

WC_REST_Controller::validate_setting_text_field() code WC 8.7.0

public function validate_setting_text_field( $value, $setting ) {
	$value = is_null( $value ) ? '' : $value;
	return wp_kses_post( trim( stripslashes( $value ) ) );
}