Plugin echos text from shortcode function in gutenberg page editor

As Milo noticed, shortcodes should return content instead of echoing it. So change while($query1->have_posts()) : $query1->the_post(); echo ‘<div class=”menu-thumb”>’; the_post_thumbnail( ); echo ‘</div>’; echo ‘<div class=”menu-title”>’; the_title( ); echo ‘</div>’; echo ‘<div class=”menu-content”>’; the_content( ); echo ‘</div>’; endwhile; to while($query1->have_posts()) : $query1->the_post(); $div = ‘<div class=”menu-thumb”>’; $div .= get_the_post_thumbnail( ); $div .= ‘</div>’; $div .= … Read more

Create RangeControl in gutenberg Block

You are creating the MySelectControl component but it is not being used inside the edit function/component. Include it there and it should appear. If you want it to appear in the settings sidebar, rather than in the editor, simply wrap the component inside the inspector-controls component (from the package @wordpress/editor): <InspectorControls> <MySelectControl /> </InspectorControls>

Different css rules for TinyMCE and Gutenberg while using add_editor_style()

SHORT VERSION Using css it’s possible to use of the :not() selector to exclude Tinymce instances, e.g. body:not(.mce-content-body) {…} LONG VERSION Let’s assume we have declared theme support for editor styles and included an editor stylesheet somewhere in our theme (e.g functions.php) like this: add_theme_support( ‘editor-styles’ ); add_editor_style( ‘something/something/css/editor.css’ ); For the sake of this … Read more