Update Bricks Element Styles
Changes the style settings of one Bricks element and nothing else: sets or clears Bricks style controls (keys starting with an underscore, such as _typography, _background, _padding, _margin, _width, optionally per breakpoint or state, for example _padding:mobile_portrait or _typography:hover) and adds or removes global classes. Saved to the live page at once, with the same backup, lossless check, conflict check and read-back as the content ability. Custom CSS, attributes, conditions, interactions and visibility are refused. Use mosmcp/bricks-get-element to see the current style keys and values, and mosmcp/bricks-list-global-classes for class IDs. The Bricks Builder access role setting is not checked; WordPress edit_post is (plus the Bricks builder-access check, when Bricks provides one at runtime).
Also known as: Bricks styling, change colour, font size, spacing, add CSS class.
| Property | Value |
|---|---|
| Ability slug | mosmcp/bricks-update-element-styles |
| Wire tool name | mosmcp__bricks-update-element-styles |
| Category | Bricks Builder (mosmcp-bricks) |
| Plan | Pro |
Required access
| Requirement | Value |
|---|---|
| Capability | edit_post (checked against the specific post) |
| Minimum default role | Contributor |
| Annotations | readOnly: false · destructive: false · idempotent: true · openWorld: false |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| post_id | integer (min 1) | Yes | — | ID of the page, post or Bricks template. |
| area | string (one of content, header, footer) |
— | Which Bricks area of the post: content (default), or the header or footer stored on it. Header and footer templates default to their own area. | |
| element_id | string (min length 1) | Yes | — | The element ID, six letters and digits (see mosmcp/bricks-read-page-structure). |
| set | object | — | Style settings to set: key => value in Bricks' own format, for example {"_typography": {"color": {"hex": "#1e73be"}, "font-size": "20px"}, "_padding:mobile_portrait": {"top": "10px"}}. A value replaces the whole stored value of that key. | |
| remove | string[] | — | Style setting keys to clear. | |
| add_global_classes | string[] | — | Global class IDs to add to the element. | |
| remove_global_classes | string[] | — | Global class IDs to remove from the element. | |
| expected_hash | string | Yes | — | Required. The layout_hash from your last read of this area. The change is refused if the layout changed since, so an edit made meanwhile in the Bricks builder is never overwritten. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| post_id | integer | Yes | |
| title | string | ||
| post_type | string | ||
| view_url | string | ||
| builder_url | string | Opens the post in the Bricks builder. | |
| area | string | Yes | |
| element_id | string | Yes | The changed element, or the new copy. |
| element | object | The element as now stored, in the shape mosmcp/bricks-get-element returns. | |
| changes | object[] | Yes | What changed, as read back after saving. |
| changes[].field | string | ||
| changes[].previous | string | number | integer | boolean | array | object | null | ||
| changes[].current | string | number | integer | boolean | array | object | null | ||
| layout_hash | string | Yes | The new layout_hash, for a following edit. |
| previous_layout_hash | string | ||
| backup | object | Yes | |
| backup.meta_key | string | ||
| backup.meta_id | integer | ||
| notes | string[] | ||
| warnings | object[] | Non-fatal issues encountered while running. | |
| warnings[].code | string | ||
| warnings[].message | string | ||
| warnings[].context | string |
| << Previous | Next >> |
|---|---|
| Update Bricks Element Content |
For more information about the Secure MCP Server for WordPress plugin, explore the following resources:
Product Overview | Pricing | Try for Free | Documentation
If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.