Block Editing
Block Registration
For a block to show up in the WP editor, it needs to be registered properly.
{
"apiVersion": 2,
"name": "gravity-platform-core/card",
"version": "0.1.0",
"title": "Card",
"category": "gravity-platform",
"icon": "building",
"description": "Card",
"supports": {
"html": false
},
"textdomain": "gravity-platform-core",
"editorScript": "file:../../../build/index.js",
"editorStyle": "file:../../../build/main.css",
"style": "file:../../../build/style-main.css"
}In block.json
And in index.tsx
Adding Block Controls
Block Editor Control Reference
Updating Block Attributes

Add attributes to index.tsx in: backend/plugins/gravity-platform-core/src/blocks/promotions/index.tsx
Updating With apiFetch
for the ACF API we have to add the fields attribute before we can get to the actual field attribute
Above is an example of the wp-json endpoint for ACF
Last updated
Was this helpful?
