wp_apply_style
Apply ONE style to MANY elements in a single call. Use this whenever several elements should look the same — the cards in a row, every kicker, all the headings in a section. Styling them one at a time is how six cards end up with three different accent colours: each edit is a fresh chance to typo a hex or forget a radius, and nothing ties them together afterwards. One payload cannot drift from itself. Same style vocabulary as wp_patch_page (wp_style_keys lists it), same per-element verification: the response reports effective for each node, so you can see if any element ignored the write. dry_run previews.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| style | Yes | JSON style object applied to every id, e.g. {"bg":"#FFFFFF","radius":16,"padding":28}. Keys from wp_style_keys. | |
| dry_run | No | Preview the diff without writing. | |
| post_id | Yes | Page/post numeric id | |
| site_id | Yes | WordPress site id | |
| node_ids | Yes | JSON array of element ids, e.g. ["a1b2c3","d4e5f6"] (from wp_get_page outline). |