1
0

More than 5 years have passed since last update.

[WordPress]カスタム投稿タイプの投稿画面で特定の項目を非表示にする方法

Last updated at Posted at 2015-08-31

wordpressでカスタムフィールドを多用してゴリゴリとカスタマイズしていると、
投稿画面で不要な入力項目を消したくなってくるはず。

この場合はカスタム投稿タイプだと, register_post_type関数の引数 "support"で表示する項目を1つずつ指定することができる

全オプションは以下

'supports' => array(
    'title',           // タイトル
    'editor',          // 内容の編集
    'author',          // 作成者
    'thumbnail',       // アイキャッチ画像。現在のテーマが post-thumbnails をサポートしていること
    'excerpt',         // 抜粋
    'trackbacks',      // トラックバック送信
    'custom-fields',   // カスタムフィールド
    'comments',        // コメントの他、編集画面にコメント数のバルーンを表示する
    'revisions',       // リビジョンを保存する
    'page-attributes', // メニューの順序。「親〜」オプションを表示するために hierarchical が true であること
    'post-formats',    // 投稿のフォーマットを追加。投稿フォーマットを参照
),

必要な項目だけ指定すればOK

参考

公式マニュアル

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0