Insert Oxygen Element
Adds an element to an Oxygen page by copying one that is already on it (with everything inside it), giving the copy new IDs, and placing it after the original or at a chosen position in a chosen container. Copying is how new elements are made here because Oxygen's full default settings for a brand-new element are not published; a copy is guaranteed to have a structure Oxygen accepts. Optionally sets the copy's text. Elements bound to signed dynamic data, inner-content and tab elements, and elements whose ID is referenced in custom CSS or code are not copied. Changes the live page; reversible: the previous layout is saved as a backup first. Needs layout_hash from mosmcp/oxygen-read-page-structure.
Also known as: add Oxygen element, duplicate section, add another button, copy heading.
| Property | Value |
|---|---|
| Ability slug | mosmcp/oxygen-insert-element |
| Wire tool name | mosmcp__oxygen-insert-element |
| Category | Oxygen Builder (mosmcp-oxygen) |
| Plan | Pro |
Required access
| Requirement | Value |
|---|---|
| Capability | manage_options |
| Minimum default role | Administrator |
| Annotations | readOnly: false · destructive: false · idempotent: false · openWorld: false |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| post_id | integer (min 1) | Yes | — | The page, post or template to add to. |
| source_element_id | integer (min 1) | Yes | — | The element to copy, from mosmcp/oxygen-read-page-structure. |
| layout_hash | string | Yes | — | The layout_hash from mosmcp/oxygen-read-page-structure. The change is refused if the layout changed since. |
| target_parent_id | integer (min 0) | — | Optional. The container to put the copy in (0 for the top level of the page). Omit to put it right after the original. | |
| position | integer (min 0) | — | Optional. Zero-based position among the container's elements; omit to put it after the original (same container) or last. | |
| text | string | — | Optional. Text for the copy, when the copied element holds text and has nothing inside it. | |
| dry_run | boolean | false |
If true, checks the change and returns what would change without saving anything. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| post | object | Yes | |
| post.id | integer | ||
| post.title | string | ||
| post.type | string | ||
| post.status | string | ||
| post.edit_url | string | ||
| post.builder_url | string | Opens the page in Oxygen. | |
| element | object | ||
| element.id | integer | ||
| element.type | string | ||
| element.label | string | ||
| changes | object[] | Yes | What changed (or, on a dry run, would change). null means not set. |
| changes[].element_id | integer | ||
| changes[].field | string | ||
| changes[].previous | string | null | ||
| changes[].current | string | null | ||
| inserted_ids | integer[] | IDs of the new elements, the copy first. | |
| parent_id | integer | ||
| position | integer | ||
| dry_run | boolean | Yes | |
| layout_hash | string | Yes | The layout's hash now, for the next change. |
| backup | object | ||
| backup.key | string | The post meta the backup is stored in. | |
| backup.meta_id | integer | ||
| backup.restore | string | How to put the previous layout back. | |
| css_cache | string | "regenerated", "not_available", "failed" or "not_needed" (dry run). | |
| notes | string[] |
| << Previous | Next >> |
|---|---|
| List Oxygen Templates |
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.