CODEMemorandum

【WordPress】ブロックエディタ(Gutenberg)用のCSSを読み込む

editor-style.css をテーマの直下に置く場合は以下のとおり。
自動的に .editor-styles-wrapper が付与されるので、通常どおりにCSSを書けばOKです。

add_action( 'after_setup_theme', function(){
  add_theme_support( 'editor-styles' );
  add_editor_style();
});

editor-style.css をテーマの直下以外に置く場合は、add_editor_style() にファイルのパスを指定します。

add_action( 'after_setup_theme', function(){
  add_theme_support( 'editor-styles' );
  add_editor_style( '/css/editor-style.css' );
});