WC_Settings_API::validate_safe_text_field()publicWC 1.0

Sanitize 'Safe Text' fields.

These fields are similar to regular text fields, but a much smaller set of HTML tags are allowed. By default, this means <br>, <img>, <p> and <span> tags.

Note: this is a sanitization method, rather than a validation method (the name is due to some historic naming choices).

Метод класса: WC_Settings_API{}

Хуков нет.

Возвращает

Строку.

Использование

$WC_Settings_API = new WC_Settings_API();
$WC_Settings_API->validate_safe_text_field( $key, ?string $value ): string;
$key(строка) (обязательный)
Field key (currently unused).
?string $value (обязательный)
-

Код WC_Settings_API::validate_safe_text_field() WC 8.7.0

public function validate_safe_text_field( string $key, ?string $value ): string {
	return wc_get_container()->get( HtmlSanitizer::class )->sanitize( (string) $value, HtmlSanitizer::LOW_HTML_BALANCED_TAGS_NO_LINKS );
}