remove_post_type_support

Sponsored Link

取得する投稿タイプの為に特定の機能のサポートを削除します。全ての機能は、そのような編集画面やメタボックスなどの編集画面の機能エリアに直接関連付けられています。更に、’リビジョン’機能は、投稿タイプがリビジョンを保存するかどうかを指示し、’コメント’機能は編集画面にコメント数を表示するかどうかを指示します。

Sponsored Link

一般的にremove_post_type_support()は’init’アクションフックに接続する必要があります。

Remove support of certain features for a given post type (s). All features are directly associated with a functional area of the edit screen, such as the editor or a meta box. Additionally, the ‘revisions’ feature dictates whether the post type will store revisions, and the ‘comments’ feature dictates whether the comments count will show on the edit screen.

Typically remove_post_type_support() should be attached to the ‘init’ action hook.

remove_post_type_supportのファンクションタグ使用方法

<?php remove_post_type_support( $post_type, $supports ) ?>

remove_post_type_supportのパラメーター

$post_type

(string) (required)投稿タイプ(最大20文字)
デフォルト:なし

(string) (required) Post type. (max. 20 characters)
Default: None

$supports

(string) (required)削除する機能。
デフォルト:なし

(string) (required) Feature to remove.
Default: None

  • ‘title’
  • ‘editor’ (content)
  • ‘author’
  • ‘thumbnail’ (アイキャッチ画像) (現在のテーマで投稿サムネイルをサポートしていなくてはなりません)
  • ‘excerpt’
  • ‘trackbacks’
  • ‘custom-fields’
  • ‘comments’ (編集画面上でコメントカウントバルーンが表示されます)
  • ‘revisions’ (リビジョンを保存します)
  • ‘page-attributes’ (テンプレートとメニューの順序) (階層はtrueでなければなりません)
  • ‘title’
  • ‘editor’ (content)
  • ‘author’
  • ‘thumbnail’ (featured image) (current theme must also support Post Thumbnails)
  • ‘excerpt’
  • ‘trackbacks’
  • ‘custom-fields’
  • ‘comments’ (also will see comment count balloon on edit screen)
  • ‘revisions’ (will store revisions)
  • ‘page-attributes’ (template and menu order) (hierarchical must be true)

この例では、記事で抜粋のためのサポートを削除します。

This example removes support for excerpts in posts:

<?php
	add_action('init', 'my_custom_init');

	function my_custom_init() {
		remove_post_type_support( 'post', 'excerpt' );
	}
?>

変更ログ

Since 3.0

ソースファイル

remove_post_type_support()は、wp-includes/post.php内に位置しています。

remove_post_type_support() is located in wp-includes/post.php.

関連ファンクションタグ

Post Types: register_post_type(), add_post_type_support(), remove_post_type_support(), post_type_supports(), post_type_exists(), set_post_type(), get_post_type(), get_post_types(), get_post_type_object(), get_post_type_capabilities(), get_post_type_labels(), is_post_type_hierarchical(), is_post_type_archive(), post_type_archive_title()

Sponsored Link