Returns a string containing the decoded value of a given HTML attribute.
Description
Text found inside an HTML attribute has different parsing rules than for text found inside other markup, or DATA segments. Use this function to read the decoded value of an HTML string inside a quoted attribute.
Example:
'“😄”' === WP_HTML_Decode::decode_attribute( '😄”' );
Parameters
$text
stringrequired- Text containing raw and non-decoded attribute value to decode.
Source
public static function decode_attribute( $text ): string {
return static::decode( 'attribute', $text );
}
Changelog
Version | Description |
---|---|
6.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.