Repository navigation
Api Generation Contract
DesignSetGo exposes the installed block schema, known styling targets and stored markup serialization for native block generators. These APIs support both a structured-first authoring tree and an HTML/CSS compiler that produces the same native tree. HTML parsing, CSS adaptation and generation orchestration belong in the caller.
For responsive composition, fluid sizing, Grid areas/placement and layering,
see Layout flexibility. Discovery advertises the
applicable dsgoLayout properties for each installed block.
Call designsetgo/get-design-context for resolved theme settings, styles, fonts
and registered block styles. Call designsetgo/list-blocks with detail: "full"
and the block names you intend to use for complete installed attribute schemas.
Both responses include generationContract:
{
"version": 1,
"pluginVersion": "<installed plugin version>",
"wordpressVersion": "<installed WordPress version>",
"breakpoints": { "mobileMax": 767, "tabletMax": 1024 }
}Cache discovery against the installed versions and contract version. Schema attributes include defaults; omitted values in saved comments do not mean that an attribute has no value. Read the installed schema before emitting attributes.
Each block in list-blocks also reports:
-
selectors: WordPress's registered block selectors, including a visual root when the visible element differs from the positioning wrapper. -
blockStyles: installed style names, labels and default flags. SetclassName: "is-style-<name>"to select a registered style. -
generation.serialization.supported: whether the installed PHP serializers can produce stored markup. Unsupported static blocks include areason. -
generation.serialization.mode:staticmeans stored save markup;dynamicmeans a comment-only stored form. Hybrid blocks that render in PHP but still save a wrapper reportstatic. This field describes storage, not rendering. -
generation.targetsandgeneration.styleOwnership, where explicitly declared. Missing targets mean there is no published target contract for that block. They do not imply that every internal element is a supported API.
Targets are block-scoped selectors. For instance, Grid's layout lives on
.wp-block-designsetgo-grid > .dsgo-grid__inner, while its background and border
live on the outer wrapper. Icon Button's visual root is the inner button/link;
justification belongs to its outer wrapper. Scope residual CSS to an individual
block with the custom CSS selector placeholder.
Prefer native WordPress supports for color, gradient, typography, spacing,
border and shadow. For Grid, style.spacing.blockGap owns gaps and takes
precedence over rowGap and columnGap, including the block's default gap.
Supply the owning native attribute instead of competing CSS declarations.
Invoke designsetgo/serialize-blocks with the same definitions as add-blocks:
{
"blocks": [{
"block_name": "designsetgo/grid",
"attributes": {
"columnTemplate": "minmax(0, 3fr) minmax(0, 2fr)",
"tabletColumnTemplate": "minmax(0, 2fr) minmax(0, 1fr)",
"mobileColumnTemplate": "minmax(0, 1fr)",
"style": { "spacing": { "blockGap": "2rem" } }
},
"inner_blocks": [{
"name": "core/paragraph",
"attributes": { "content": "Editable <strong>native</strong> content" }
}]
}]
}Top-level definitions use block_name and inner_blocks; nested definitions use
name and innerBlocks (nested inner_blocks is also accepted). Successful
responses contain success: true, content (stored block markup) and
block_count (top-level count). There is a maximum of 50 top-level definitions.
Supply stable block-specific IDs when repeatable markup is required; some
serializers generate missing IDs.
This ability requires edit_posts. It uses the insertion path's preparation,
sanitization, serializers and structural checks, without post writes or dynamic
render callbacks. Semantic refusals return success: false, error_code and
message, with block_index and nested paths when applicable. Refusals contain
no partial content. Transport-level schema/authentication errors may instead
be WordPress errors. Structural checks do not execute JavaScript save() or
prove visual equivalence: validate representative trees in the installed editor.
The result is suitable for the normal WordPress content write API. Preview, revision handling and conditional publication remain the caller's responsibility.
tabletColumnTemplate and mobileColumnTemplate override their device column
counts. Empty values retain existing count behavior. The tablet range is
768–1024px and mobile is at most 767px; desktop columnTemplate applies above
1024px. Controls are available in Grid's Settings inspector and can be reset.
Templates are stored as optional variables on the inner grid. Existing content with empty templates keeps the same saved markup. Nested grids resolve their own values, and responsive spans clamp to rendered tracks without changing the authored span. Do not append markup repair CSS for these layouts.
Use designsetgo/configure-custom-css for decoration that native supports cannot
express. It writes the registered dsgoCustomCSS string and synchronizes the
saved selector class. Dynamic blocks receive the selector at render time. The
ability requires edit_posts, edit_css and access to the target post; excluded
blocks such as core/html and core/code are refused before mutation.
{
"post_id": 123,
"block_name": "designsetgo/grid",
"css": {
"desktop": "selector::before { transform: rotate(-3deg); }",
"tablet": "selector::before { transform: rotate(-2deg); }",
"mobile": "selector::before { transform: none; }"
}
}Desktop rules are the base at every width. Tablet rules apply up to 1024px and
mobile rules up to 767px, in that order. Supplied rules replace that section;
omitted sections are preserved separately for each matching block. Empty strings
clear a supplied section. enabled: false clears all CSS; enabling again does
not restore cleared rules. update_all uses the normal first/all matching rules.
Responsive sections carry reserved dsgo-css boundary comments in the single
editor field. Keep those comments for later per-breakpoint updates. If an author
removes them, those rules become ordinary base CSS and a desktop update replaces
them. No separate dsgoCustomCss* attributes are written.
Auto-generated from
docs/api/GENERATION-CONTRACT.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