WP_HTML_Decoder::decode_attribute
Returns a string containing the decoded value of a given HTML attribute.
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_Decoder::decode_attribute( '😄' );
Метод класса: WP_HTML_Decoder{}
Хуков нет.
Возвращает
string. Decoded UTF-8 value of given attribute value.
Использование
$result = WP_HTML_Decoder::decode_attribute( $text ): string;
- $text(строка) (обязательный)
- Text containing raw and non-decoded attribute value to decode.
Список изменений
| С версии 6.6.0 | Введена. |
Код WP_HTML_Decoder::decode_attribute() WP HTML Decoder::decode attribute WP 7.1.4
public static function decode_attribute( $text ): string {
return static::decode( 'attribute', $text );
}