WordPressのカスタム投稿タイプでブロックエディター(Gutenberg)が利用できない時の対処法を解説します。
チェックリスト
register_post_type
関数の$args
パラメータの引数show_in_rest
でtrue
になっている?register_post_type
関数の$args
パラメータの引数supports
でcustom-fields
が記載されている?
原因と対処法
register_post_type
関数の$args
パラメータの引数show_in_rest
でtrue
になっている?
register_post_type('news', array( ... 'show_in_rest' => true, ... ));
register_post_type
関数の$args
パラメータの引数supports
でcustom-fields
が記載されている?
register_post_type('news', array( ... 'supports' => array('title', 'editor', 'custom-fields'), ... ));
参考:https://make.wordpress.org/core/2018/10/30/block-editor-filters/