Default Gutenberg CSS on frontend

You can’t. There’s no stylesheet that exists that can be loaded on the front-end to make it match the editor exactly. Any such stylesheet would need to be created independently of the styles used in the actual editor, because the styles that are used in the editor are written to share scope with the default … Read more

Gutenberg running code only available in front end within shortcode

Use it like this, this defined(‘REST_REQUEST’) will help you to disable running on the backend gutenberg block editor function generate_new_member_form() { if(defined(‘REST_REQUEST’)) return; ob_start(); ?> // a form // to generate this form there is some code that uses objects or functions // only available in the front end <?php return ob_get_clean(); } add_shortcode(‘new-member-form’, ‘generate_new_member_form’);

Block that renders html saved in a php file

If you are working on a WordPress Theme you can use the function: get_template_part( string $slug, string $name = null ) Wich loads a template part into a php template. get_template_part() will do a PHP require() for the first file that exists… So effectively it will work as if you were requiring another php file. … Read more

Block editor: Sandbox iframe shows outdated HTML

The WordPress (Gutenberg) block editor requests data from an oembed proxy endpoint, and that endpoint retrieves data using the Transients API. It seems that clearing all oembed caches doesn’t also clear oembed transient caches. The following database query to clear your oembed caches from the postmeta table is NOT sufficient: global $wpdb; $meta_key_1 = “|_oembed|_%%”; … Read more