WP_HTML_Decoder::decode_text_node │ public static │ WP 6.6.0

Returns a string containing the decoded value of a given HTML text node.

Text nodes appear in HTML DATA sections, which are the text segments inside and around tags, excepting SCRIPT and STYLE elements (and some others), whose inner text is not decoded. Use this function to read the decoded value of such a text span in an HTML document.

Example:

'“😄”' === WP_HTML_Decoder::decode_text_node( '“😄”' );

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

Хуков нет.

Возвращает

string. Decoded UTF-8 value of given text node.

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

$result = WP_HTML_Decoder::decode_text_node( $text ): string;
$text(строка) (обязательный)
Text containing raw and non-decoded text node to decode.

Список изменений

С версии 6.6.0 Введена.

Код WP_HTML_Decoder::decode_text_node() WP 7.1.4

public static function decode_text_node( $text ): string {
	return static::decode( 'data', $text );
}