Gutenberg

Here are some helpful links for learning more about Gutenberg

Built In Block Editing Components

Inspector Controls

Gutenberg Packages

getEntityRecords

Block Library

Theme.JSON

theme.json docs

Locking Blocks

locking block templates

More Block Data

backend/plugins/gravity-platform-core/src/index.tsx
wp.domReady(() => {
	// wp.blocks.unregisterBlockStyle("core/quote", ["default", "plain", "large"]);
	// THIS CAN SHOW THE BLOCK OBJECTS IN THE CONSOLE OF THE PAGE EDITOR
	wp.blocks.getBlockTypes().forEach((block) => {
	 	console.log("block :", block);
	 });
});

Removing Editor Panels

backend/plugins/gravity-platform-core/src/index.tsx
wp.domReady(() => {
	wp.blocks.unregisterBlockStyle("core/quote", ["default", "plain", "large"]);
	wp.data.dispatch("core/edit-post").removeEditorPanel("discussion-panel");
	wp.data.dispatch("core/edit-post").removeEditorPanel("template");
});

We can use wp.data.dispatch to remove editor panels as shown above.

We can also toggle them open by default as you can see below.

if (!wp.data.select("core/edit-post").isPanelOpened("featured-image")) {
	wp.data
		.dispatch("core/edit-post")
		.toggleEditorPanelOpened("featured-image");
}

Last updated

Was this helpful?