wordpress5.0から導入されたGutenbergの右サイドバーの表示制御をしたい。
function remove_post_support() {
remove_post_type_support('post','excerpt'); // 抜粋
remove_post_type_support('post','trackbacks'); // ディスカッションのトラックバック許可
remove_post_type_support('post','comments'); // ディスカッションのコメント許可
unregister_taxonomy_for_object_type( 'category', 'post' ); // カテゴリ
}
add_action('init','remove_post_support');
調べた方法。
下記、参考にしたサイトよりremove_post_type_support
なるfunctionがあることを知る。
wordpress内でgrepしてfunctionの中身を見ると、$_wp_post_type_feature
というglobal変数に項目を持っているよう。
これをvar_dumpして中身を見てそれっぽいのをremove_post_type_support
の第二引数に入れて挙動を試す。