Wordpress 隐藏gutenberg中的短代码预览

Wordpress 隐藏gutenberg中的短代码预览,wordpress,wordpress-gutenberg,Wordpress,Wordpress Gutenberg,我创建了一个自定义短代码,它从模板文件中呈现一些html/css/javascript function jsd_waitlist_hero_shortcode() { include dirname( __FILE__ ) . '/jsd-templates/' . 'jsd-waitlist-hero.php'; return null; } add_shortcode('jsd_waitlist_hero', 'jsd_waitlist_hero_shortcode'); 这很好

我创建了一个自定义短代码,它从模板文件中呈现一些html/css/javascript

function jsd_waitlist_hero_shortcode() {
  include dirname( __FILE__ ) . '/jsd-templates/' . 'jsd-waitlist-hero.php';
  return null;
}
add_shortcode('jsd_waitlist_hero', 'jsd_waitlist_hero_shortcode');
这很好,但是,当我把它包括在页面中时

内容显示在编辑器中

我不希望这种情况发生,因为css最终会崩溃,而且看起来很奇怪


有没有办法告诉古腾堡不要在编辑器中显示短代码,但在直播时仍然显示它?

运行
包括
内部
ob\u start
ob\u get\u clean
做到了这一点

function jsd_waitlist_hero_shortcode() {
  ob_start();
  include dirname( __FILE__ ) . '/jsd-templates/' . 'jsd-waitlist-hero.php';
  $content = ob_get_clean();
  return $content;
}