Menu
All plugins

Controlled Revisions for Bricks

Edit live Bricks pages safely. With revisions switched on for a post type, changes saved from the Bricks builder go into a separate revision instead of the live post. The revision is reviewed, approved or scheduled, and can be rolled back, all from a panel inside the builder. Visitors see nothing until it is approved.

Version: 0.1.1 · Requires: Bricks 2.x, WordPress 6.4 · See the live demo

Installation

  1. Upload and activate the plugin. Bricks must be active.
  2. Go to Tools → Bricks Revisions.
  3. Tick the post types that should be under revision control and choose a mode.

Only published posts of those types are controlled. Drafts are edited normally. Including Bricks templates puts headers, footers and other templates under review too.

Working with revisions

  1. Start a revision. Open a published post in the builder and press Start a revision in the Revisions panel.
  2. Edit and save as usual. The changes go into the revision. The live post keeps its content.
  3. Submit for approval. A revision with no changes cannot be submitted.
  4. Review. An approver sees what changed, with old and new values, and the history of who did what.
  5. Approve and publish now, or schedule a date and time. Preview shows the post with the revision applied before you decide.
  6. Reject sends it back to its author, who can reopen it. Discard drops a revision for good.

The Revisions panel

A clock button in the builder’s top toolbar opens a drawer on the right. It shows your working revision with Submit for approval, Approve and publish now, Schedule and Preview, the revisions waiting for review, and the history. A number on the button counts revisions waiting for approval.

Modes

  • Optional: edit live as usual, or start a revision from the panel.
  • Required: every builder save on a published post goes into a revision. People with the bypass permission are exempt.

Settings

Setting What it does
Post types under revision control Which published post types use revisions.
Mode Optional or Required.
Self-approval Lets authors approve their own revisions.
Keep finished revisions Days to keep them. 0 keeps them forever. Rollback needs the stored data, so it stops working once a revision has been removed.
Email alerts Emails approvers when a revision is submitted, and the author when it is approved, scheduled, rejected, published, rolled back or blocked.
Also notify Extra addresses for the waiting for approval email, comma separated.

Who can do what

  • Anyone who can edit the post can start a revision and submit it.
  • crb_approve_revisions (administrators and editors by default) can review, approve, schedule, reject and roll back.
  • crb_bypass_workflow (nobody by default) is exempt from Required mode.

Conflicts

If the live post changed after the author started, their changes are merged piece by piece. Only a piece changed on both sides blocks publishing. The revision then shows as a conflict and can be reopened or discarded.

Rolling back

Rolling back undoes only what that revision changed, even if the post was edited elsewhere since. If later edits touched the same places, the rollback is refused and the places are listed.

What goes into a revision

The Bricks content, header, footer and page settings, plus the post title, slug and excerpt. Global classes, components, colour palettes, global queries, variables and style manager changes that the builder writes while saving travel with the revision that made them.

Data and uninstall

Revisions live in their own tables, crb_revisions and crb_events, so WordPress and Bricks revision pruning never touches them. Uninstalling keeps the data unless CRB_REMOVE_DATA is defined as true.

For developers

  • The builder panel talks to a REST API under crb/v1 with cookie authentication.
  • Filters: crb_extra_meta_keys adds post meta to a revision, crb_option_names adds global options, crb_bricks_keys changes the Bricks meta keys.
  • Actions: crb_submitted and crb_scheduled.