Gutenberg. How To Register A Custom Block Style For Specific Post Type Only
How can I make this working? Not sure if there’s a better way, but I’d use subscribe() in the @wordpress/data package: const { registerBlockStyle } = wp.blocks; const { subscribe, select } = wp.data; wp.domReady( () => { const unsubscribe = subscribe( () => { const postType = select( ‘core/editor’ ).getCurrentPostType(); // 1. Unsubscribe once … Read more