Skip to content

Page builders

A page builder owns its page’s layout, so an edit to the post text can report success and change nothing on the page, or break the layout. The plugin’s general content tools refuse to write to a page a builder owns. Avada and WPBakery Page Builder pages get tools of their own. Since 1.12.0 these pages can be edited element by element, with 18 tools for Avada (five of them from earlier releases) and 12 for WPBakery Page Builder. Each set appears only while its builder is active, and every tool starts off.

How the general content tools treat builder pages

Section titled “How the general content tools treat builder pages”

Before any write, Update post, Update page, Replace in post and the other general content tools check whether a page builder owns the post. For Elementor, Divi, Beaver Builder, Avada, Visual Composer, Oxygen, Breakdance, Brizy, Bricks and WPBakery they refuse the write with an error that names the builder.

One write gets through: an edit that only sets the excerpt is accepted and leaves the stored content as it was. When the plugin can’t tell which builder owns the post, even that edit is refused.

Restore revision works on Avada and WPBakery pages while that builder is active, because both keep the whole layout in the post content. It stays refused on the other eight builders.

Pages built with the other eight builders are still edited in the builder itself. Visual Composer Website Builder, a separate plugin from WPBakery Page Builder, gets no tools of its own; its pages keep the refusal. OptimizePress is not detected.

All of them work only while Avada is active. “Edit access” means the user can edit that post. unfiltered_html is the WordPress capability to post HTML that WordPress would otherwise filter, and manage_options is the capability to change site settings, which administrators have.

Tool Kind Who can call it
Get Avada page content (aafm/avada-get-page-content) read Edit access
Replace text in an Avada page (aafm/avada-replace-text) write Edit access
List Avada elements (aafm/avada-list-elements) read edit_posts
Update an Avada element (aafm/avada-update-element) write Edit access
Insert an Avada element (aafm/avada-insert-element) write Edit access
Move an Avada element (aafm/avada-move-element) write Edit access
Remove an Avada element (aafm/avada-remove-element) destructive Edit access
List the Avada library (aafm/avada-list-library) read edit_posts
Insert an Avada library item (aafm/avada-insert-library-item) write Edit access to the page and the item
Update Avada page CSS (aafm/avada-update-page-css) write Edit access and unfiltered_html
Update Avada page options (aafm/avada-update-page-options) write Edit access
Get Avada Global Options (aafm/avada-get-global-options) read manage_options
Update Avada Global Options (aafm/avada-update-global-options) destructive manage_options
List Avada layouts (aafm/avada-list-layouts) read manage_options
Update an Avada layout (aafm/avada-update-layout) destructive manage_options
Update Avada Slider settings (aafm/avada-update-slider-settings) write manage_options, and Avada Core active
List Avada Studio items (aafm/avada-list-studio-items) read manage_options, and the Studio import switched on
Import an Avada Studio item (aafm/avada-import-studio-item) write manage_options

The element tools also work on Avada’s own library items, forms, off canvas panels and layout sections, though Remove element refuses forms and off canvas panels. Editing a layout section needs manage_options.

All of them work only while WPBakery Page Builder is active.

Tool Kind Who can call it
Get WPBakery page content (aafm/wpbakery-get-page-content) read Edit access
Replace text in a WPBakery page (aafm/wpbakery-replace-text) write Edit access
List WPBakery elements (aafm/wpbakery-list-elements) read edit_posts
Update a WPBakery element (aafm/wpbakery-update-element) write Edit access
Insert a WPBakery element (aafm/wpbakery-insert-element) write Edit access
Move a WPBakery element (aafm/wpbakery-move-element) write Edit access
Remove a WPBakery element (aafm/wpbakery-remove-element) destructive Edit access
List WPBakery templates (aafm/wpbakery-list-templates) read edit_posts
Insert a WPBakery template (aafm/wpbakery-insert-template) write Edit access
Update WPBakery page code (aafm/wpbakery-update-page-code) write Edit access and unfiltered_html
Get WPBakery settings (aafm/wpbakery-get-settings) read manage_options
Update WPBakery settings (aafm/wpbakery-update-settings) destructive manage_options

The element and template tools also work on WPBakery Grid Builder templates.

Start with avada-get-page-content or wpbakery-get-page-content. Both return the raw post content exactly as stored, never rendered or stripped. With include_structure they also return an outline of the page’s elements: each element’s tag, nesting depth, attributes, the inner text of an element with no child elements, and a fingerprint, plus a fingerprint for the whole page. A fingerprint is a short hash of what is stored, so a later write can tell when the element or the page has changed since it was read. The outline stops at 2,000 elements.

avada-list-elements and wpbakery-list-elements read the builder’s own element map. With tag they return one element’s settings: kind, label, default, the allowed values of a choice, whether the update tool can write it, and needs, which says when a setting needs unfiltered_html.

The element tools name an element by its index from the outline and its fingerprint:

  • Update changes an element’s settings (set_atts), puts settings back to their default (remove_atts), or replaces the inner text of an element with no children (text).
  • Insert adds an element with its children before or after another element, or as its first or last child. One call adds at most 50 elements, nested at most 6 deep.
  • Move moves an element and everything inside it, byte for byte, to a new place on the same page.
  • Remove removes an element and everything inside it.

Insert, move and remove also need the page_fingerprint from the last read or write, and they return the new one. A changed page, or a stale index or fingerprint, is refused. Each builder’s own nesting rules apply: a WPBakery row takes columns and a column takes content elements or an inner row; an Avada container takes rows, a row takes columns, and a parent element such as tabs takes only its own child element.

For a literal text change between elements, avada-replace-text and wpbakery-replace-text keep every shortcode and attribute as it was and refuse anything that would touch them. On WPBakery, text kept in an element’s settings, such as a heading or a button label, is changed with Update a WPBakery element instead.

Every element write is refused, with nothing saved, if saving the page as your user would change anything else on it, such as an embed the user may not keep.

  • WPBakery templates. wpbakery-list-templates lists the templates saved in WPBakery’s own library, and wpbakery-insert-template copies one into a page byte for byte.
  • Templatera. While the Templatera add-on is active, its templates are listed in place of WPBakery’s saved templates. An agent can copy one into a page, or place it by reference (mode: reference) so the page shows the template’s current content. A Templatera template can be edited like a WPBakery page.
  • Avada Library. avada-list-library lists saved elements, columns, sections, post cards and templates, and avada-insert-library-item places one on a page. An ordinary item is copied byte for byte. A global item is placed as a reference, the way Avada’s builder does it, and placing one needs a user who can edit private posts.
  • Global elements are edited in the Library. A global item is shared, so changing it changes every page that shows it. Its text is edited in the Library item, not on the page that shows it, and Update an Avada element refuses an element that shows a global item. The outline gives such an element’s global_id.
  • WPBakery page code. wpbakery-update-page-code sets a page’s custom CSS, header JS and footer JS. It needs unfiltered_html, and the JS fields are refused when WPBakery’s own Role Manager would not save custom JS for that user.
  • Avada page CSS. avada-update-page-css sets the CSS field of Avada’s builder settings for one page, layout section or library item. It needs unfiltered_html.
  • Avada page options. avada-update-page-options sets or removes options from Avada’s page options panel: layout, title bar, sidebars, slider, header, footer, off canvas, form appearance, SEO and template settings, from a fixed list. It needs the Avada theme active. With Avada Core active it also works on Avada Slider and Elastic Slider slides, once their content type is exposed in the Content sub-tab of the Abilities tab. Form notification, submission and privacy settings and code fields are never reachable.

None of these keeps a revision. Each returns the old values in previous, which is the way back.

These change the whole site at once, and all of them need a user with manage_options.

  • WPBakery settings. wpbakery-get-settings reads a fixed list from WPBakery’s settings screen, and wpbakery-update-settings writes it, each value through WPBakery’s own sanitize callback. The global custom CSS and JS also need unfiltered_html. The license code is never returned.
  • Avada Global Options. avada-get-global-options reads a fixed list of options, such as site width, colors, typography, header, logo and footer, and avada-update-global-options writes them. Maintenance mode stays read only. API keys, passwords, custom CSS and the head and body code fields are never returned. Avada’s compiled CSS is rebuilt after a change, but a page cache plugin keeps serving its cached pages until you purge it.
  • Avada layouts and sections. avada-list-layouts lists Avada Layouts with their sections and conditions, and avada-update-layout assigns a layout’s header, page title bar, content and footer sections and replaces its conditions. A layout is never created or deleted.
  • Avada Slider settings. With Avada Core active, avada-update-slider-settings changes one slider’s settings (not its slides) for every page that shows it.

The tools check the WordPress user the agent connects as:

To do this The user needs
Change text, links, images and ordinary element settings Edit access to that page
Write code blocks, raw HTML and JS, Design Options, page CSS and JS, and settings that can carry script unfiltered_html
Put square brackets, percent-encoded brackets or data-* attributes in body text unfiltered_html
Use the site-wide tools and both Avada Studio tools, or edit an Avada layout section manage_options

Neither builder’s Role Manager sets what the agent may do: the agent gets what its WordPress user can do, and no more. WPBakery is consulted in two places. Custom JS is refused when its Role Manager would not save it for that user, and an insert into an empty post needs WPBakery’s editor to be on for that post type for that user. WPBakery’s own save filter still runs.

All of these tools start off. The writes are in no access preset except Custom, and the Read only preset reaches the reads.

Avada Studio is Avada’s own library of ready-made templates, sections, elements, icons, forms and off canvas panels.

  • Import an Avada Studio item brings one item into Avada’s Library on your site through Avada’s own importer. With media import, the default, Avada also brings its images and what the item depends on, such as forms, menus and icons. Nothing is placed on a page; place the item with Insert an Avada library item.
  • List Avada Studio items lists the catalogue.

Both start off, and the import has its own switch. No Enable all button ticks it, so you switch it on by itself on the Abilities tab. Until the import is on, the list tool is refused and left out of the agent’s tool list. Both need a user with manage_options.

When an agent uses them, Avada downloads the catalogue and the items from avada.studio under your site’s own Avada registration. This plugin sends nothing in that exchange and never reads the registration; it only checks with Avada that Studio is available. Avada’s terms and privacy policy apply.

None of these tools is recorded in the plugin’s change history, so the Changes tab and Undo change cannot revert them. Most of them give you their own way back instead:

  • Element, template and Library edits. When WordPress keeps a revision, the response returns restore_revision_id. Pass it to Restore revision (aafm/restore-revision) to bring the page back. When there is no restore point, reversible_reason says why, for example because the site keeps no revisions.
  • Replace text in a WPBakery page keeps the WordPress revision when revisions are on, but does not return its id. Find it with List revisions and pass it to Restore revision.
  • Remove element is refused when no revision could bring the element back: revisions are off, the site keeps only one revision per post, or the target is an Avada form or off canvas panel (or a WPBakery Grid Builder template), which keep no revisions.
  • Settings, page code and CSS, page options, layouts and sliders. These keep no revision. The response returns the old values in previous; send them back with the same tool to undo the change.
  • An imported Avada Studio item is removed by deleting it in Avada’s Library.

Restore revision on a builder page is refused when saving the revision as your user would change it or the current page, and for a revision made with the other builder. After a WPBakery restore the page’s generated CSS is rebuilt.

  • WPBakery flexbox and grid containers. Adding an element to a flexbox or grid container item, or moving one into it, isn’t supported yet. Elements already inside one can be reordered, updated and removed.
  • Element types. An element type the builder’s own element map doesn’t list is refused.
  • Avada text settings. A double quote, a square bracket, two spaces in a row or a non-breaking space in a text setting is refused, because Avada’s builder drops or changes it on its next save.
  • CSS the builder would rewrite. Avada page CSS refuses markup, a < and a percent-encoded sequence such as %20, which Avada rewrites or removes when it prints page CSS. WPBakery page and global CSS refuse markup and a < followed by another character, where WPBakery cuts the CSS off. Other CSS is stored exactly as sent.
  • Settings that cannot be written. Avada typography and dynamic data settings on an element are listed but not writable, and Avada page options stored as several sub-values are not writable either.