Repository navigation
Extensions Draft Mode
Creates a private draft copy of any published page so changes can be edited and previewed without touching the live content. When the draft is ready, publishing it copies the draft's content back to the original page and deletes the draft.
Draft Mode applies to pages only (post_type = page). It is editor-only in the sense that the panel appears in the block editor sidebar; the underlying mechanism uses standard WordPress drafts accessible via the REST API.
A Draft Mode panel appears in the document settings sidebar of any page. The panel has four states:
- Can create draft — the page is published and has no active draft. A Create Draft button is shown.
- Has draft — a draft copy exists. A link to open the draft in the editor is shown.
- Is a draft — the current post is itself a draft of another page. Publish changes and Discard draft buttons are shown, along with a link back to the original page.
- Unavailable — the page is not published (feature not applicable).
Creating a draft captures the current editor state (including unsaved title, content, and excerpt) and passes it to the REST endpoint. All block content is sanitized through an extended wp_kses filter that preserves legitimate block HTML, CSS custom properties, SVG elements, and block comment delimiters while stripping script tags, event handlers, and javascript: URIs.
The Draft Mode panel is registered as a PluginDocumentSettingPanel (document sidebar, not per-block). Confirmation modals appear before creating, publishing, or discarding a draft to prevent accidental changes.
Draft Mode can be enabled or disabled globally in DesignSetGo Settings → Draft Mode.
All write endpoints require publish_pages capability plus a valid X-WP-Nonce header (nonce verification added in 2.1.0 security hardening).
| Method | Route | Description |
|---|---|---|
POST |
designsetgo/v1/draft-mode/create |
Create a draft of a published page |
POST |
designsetgo/v1/draft-mode/{id}/publish |
Publish draft — copies content to original |
DELETE |
designsetgo/v1/draft-mode/{id} |
Discard draft |
GET |
designsetgo/v1/draft-mode/status/{post_id} |
Get draft status for a post |
The GET status endpoint requires edit_pages capability. All write endpoints additionally verify object-level capability for the specific post (edit_post, delete_post, publish_post).
Draft Mode includes an optional frontend preview: logged-in administrators can view draft content on the live URL before publishing. This can be disabled in plugin settings.
- Draft Mode was added in 1.4.0. Nonce verification on REST routes was hardened in 2.1.0.
- Only one draft per page is supported. Creating a new draft while one already exists is not permitted until the existing draft is published or discarded.
- The original page remains live and unaffected while a draft is in progress.
- Draft metadata is stored as post meta:
_dsgo_draft_of(on the draft, pointing to original),_dsgo_has_draft(on the original, pointing to draft), and_dsgo_draft_created(timestamp).
Auto-generated from
docs/extensions/DRAFT-MODE.md. To update, edit the source file and changes will sync on next push to main.
- Accordion
- Advanced Heading
- Blobs
- Breadcrumbs
- Card
- Chart
- Comparison Table
- Countdown Timer
- Counter Group
- Divider
- Dynamic Image
- Fifty Fifty
- Flip Card
- Form Builder
- Grid
- Hotspot
- Icon
- Icon Button
- Icon List
- Image Accordion
- Map
- Modal
- Modal Api Reference
- Modal Auto Triggers
- Modal Fse Compatibility
- Modal Gallery Navigation
- Modal Trigger
- Pill
- Product Categories Grid
- Product Showcase Hero
- Progress Bar
- Query
- Query Filter
- Query Group Header
- Query No Results
- Query Pagination
- Query Results
- Row
- Scroll Accordion
- Scroll Marquee
- Scroll Slides
- Section
- Section Divider
- Slider
- Star Rating
- Sticky Sections
- Table Of Contents
- Tabs
- Text Path
- Timeline
- Background Video
- Block Animations
- Clickable Group
- Conditional Visibility
- Custom Css
- Draft Mode
- Dynamic Tags
- Expanding Background
- Grid Mobile Order
- Grid Span
- Hover Effects
- Max Width
- Responsive Visibility
- Reveal Control
- Scroll Parallax
- Sticky Header
- Style Binding
- Svg Patterns
- Text Alignment Inheritance
- Text Reveal
- Abilities Api
- Abilities Api Guide
- Block Bindings
- Draft Mode Api
- Form Webhooks
- Generation Contract
- Interactive Blocks
- Layout Flexibility
- Markdown Content Negotiation
- Rest Api Reference
- Wp Cli Reference
- Ai Assisted Development
- Best Practices Summary
- Block Controls Organization
- Block Development Best Practices Comprehensive
- Block Exclusion Guide
- Deploying To Wordpress Org
- Design System
- 2026 04 16 Blocks Editor Ux Design
- 2026 04 17 Theme 3 Inspector Ia
- 2026 04 21 Query Block Onboarding
- 2026 04 21 Query Capable Layout Blocks Design
- 2026 04 27 Block Roadmap Ideas
- 2026 07 01 Shape Divider Theme Inheritance
- 2026 07 02 Icon Block Dynamic Render Pilot
- 2026 07 06 Section Divider Block Design
- 2026 07 06 Section Style Variations Fse Design
- 2026 07 06 Section Styles Editor Preview
- 2026 07 07 Row Grid Overlay Hover Parity Design
- 2026 07 21 Conditional And Dup Label Sourcing
- 2026 07 23 Theme Block Type Animation Defaults
- 2026 08 16 Chart Block
- 2026 08 16 Greenshift Gap Roadmap
- 2026 08 17 Woocommerce Surface
- 2026 08 24 Loop Carousel
- 2026 08 24 Star Rating Block
- 2026 09 17 Abilities Drift Prevention
- 2026 09 17 Abilities Drift Prevention Implementation
- 2026 09 29 Existing User Regression Fixes
- 2026 09 29 Release Preflight Fixes
- Readme
- 2026 07 02 Block Authorability Audit
- 2026 09 29 Regression Fixes
- 2026 09 29 Release 2.9.0
- 2026 09 29 Release Fixes
- 2026 10 19 Bug Hunt
- 2026 10 20 Bug Hunt Round 2