Returns a string containing the decoded value of a given HTML text node.
Description
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_Decode::decode_text_node( '😄”' );
Parameters
$text
stringrequired- Text containing raw and non-decoded text node to decode.
Source
public static function decode_text_node( $text ): string {
return static::decode( 'data', $text );
}
Changelog
Version | Description |
---|---|
6.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.