Find if widget block is active

One could e.g. get the widget blocks data with: $widget_blocks = get_option( ‘widget_block’ ); and then loop through the array and run has_block() on the contant part, e.g. like (untested): function is_active_block_widget_wpse( $blockname ) $widget_blocks = get_option( ‘widget_block’ ); foreach( (array) $widget_blocks as $widget_block ) { if ( ! empty( $widget_block[‘content’] ) && has_block( $blockname, … Read more

Gutenberg Modify core taxonomy panel element via wp.hooks.addFilter

Because your plugin handles both hierarchical and non-hierarchical taxonomies, then I think it might be a better option to copy the HierarchicalTermSelector component, and return the copy from the CustomizeTaxonomySelector function. And you can see how I did it here — Updated to use the JavaScript Build Setup which makes things like transpilation super easy. … Read more

Changing Gutenberg / WP block editor width only on pages, not posts or other taxonomies

Because the WordPress hook add_theme_support( ‘editor-styles’ ); adds the css in the style-editor.css and appends the class .editor-styles-wrapper before my .wp-block, the usage of the body classes for page vs. post styles fails. Instead I use the answer from here, from David Walsh, to add the styles independently to the wp admin area: // Update … Read more