Contents
The cool thing here is that you can create as much these sidebar “tabs” as you want and each of them can contain a lot of fields. You can deactivate a certain sidebar tab if you click on the star icon.
How to save a block in WordPress Gutenberg?
Then it’s up to us to render setting inputs, such as text inputs, checkboxes or whatnot. Filter the block’s save props. We can adjust the props for save, which is responsible for both saving the block and rendering it in frontend (outside of editor).
Object types are post , term , comment or user, so for Gutenberg sidebars we are going to use post only. type – the type of data, can be string, boolean, integer or number, single equal to true means, that our meta has only one value.
How to filter save props in WordPress Gutenberg?
Filter the block’s save props. We can adjust the props for save, which is responsible for both saving the block and rendering it in frontend (outside of editor). In our case we want to add a class or inline style.
When to use the block sidebar in HTML?
The Settings Sidebar is displayed even when editing a block in HTML mode, so it should only contain block-level settings. The Block Tab is shown in place of the Document Tab when a block is selected.
Is there a way to hide the Gutenberg plugin?
The plugin can be used by developers in their own themes and plugins thanks to some useful hooks. There is an hook to HIDE the plugin option panel so the final user will not see it in WP backend (great feature for the devs that want to include Gutenberg Manager in their projects).
Once you return to the Widgets screen, you should see your new sidebar in the Custom Sidebars area. Now, you should find the widget you want to have displayed and choose the sidebar for it, then hit the Add Widget button. If you have trouble adding a widget in your custom sidebar, refresh the page and try again.
Now, WordPress contains a few widget-ready areas (like your footer area, your header, etc.) that are defined by the WordPress theme you’re using. Usually, however, there is the same blog sidebar that gets displayed on all your pages, posts, categories, and archive pages.