How to add editor panel with wp data dispatch?

After studying documenation and this documentation and this stackoverflow question I came up with a solution. We could use wp.data.select(‘core/editor’).getCurrentPost().categories instead of wp.data.select(‘core/editor’).getEditedPostAttribute(‘categories’). Both should work. /** * Show tags panel only for certain category using ID */ const { select, dispatch, subscribe } = wp.data; window.onload = (() => { const categoryId = 9; … Read more

Include Block Variation Within InnerBlocks

Block variations are not block types, you need to add a group block, and give it the necessary attributes. As for what those attributes are, you’re the one who chose them when you registered the block, and it looks like there’s even a function that checks for it: attributes: { tagName: ‘dialog’, className: ‘carousel-modal’, namespace: … Read more