Wp HTML API

Use WordPress' HTML API for structured server-side HTML inspection and mutation instead of regex, fragile string replacement, or DOMDocument. Covers WP_HTML_Tag_Processor, WP_HTML_Processor, set_attribute, remove_attribute, add_class, remove_class, set_modifiable_text, serialize_token, custom data attribute name mapping, WP 6.9 setter escaping, and WP 7.1 HTML processing-instruction recognition/mutation. Use when plugin code modifies rendered HTML, block output, shortcodes, content filters, widget markup, email fragments, or user-provided HTML.

Lonsdale201 Updated

File contents

Lonsdale201/wp-agent-skills/tree/main/wordpress/wp-html-api commit b2d4824a3f

Frequently asked questions

npx skillmds@latest add lonsdale201/wp-html-api