KsesAttributes final class
Minn\Support\KsesAttributes · public/minn/src/Minn/Support/KsesAttributes.php · 76 lines
Kses one attribute at a time, for the shortcode pass that runs inside HTML tags: an opening tag cut into its attributes, and one attribute judged as kses judges it on its element. Probe shortcode-run.
Public
| static | elementParts(string $element): ?array# | An opening tag cut as wp_kses_attr_parse cuts it: the start ("<a "), each attribute with the whitespace after it (a shortcode standing as a name counts as one), and the end (">" or "/>"). Null for a closing tag, a comment, CDATA, or anything between the brackets that is not attributes. @return list<string>|null |
| static | parse(string $attributes): ?array# | An attribute string cut into its attributes, each with the whitespace after it (wp_kses_hair_parse): a name (or a shortcode standing as one), then "=" and a quoted or bare value, or nothing. Null when anything in it is not an attribute: leading whitespace, a stray quote, a quoted value that never closes. @return list<string>|null |
| static | oneAttribute(string $attr, string $element, Minn\Support\KsesPolicy $policy): string# | One attribute as written, judged as kses judges it on the element (wp_kses_one_attr): the value escaped for an attribute and kept in its own quotes (a bare one gains double quotes), a URL's bad scheme cut away, style kept to the allowed properties; nothing when the element may not carry it or a quoted value never closes. The whitespace around it stays. |
Nothing matches.