個人用ツール

「Sample」の版間の差分

提供: baserCMS公式ガイド

移動: 案内, 検索
行4: 行4:
 
###見出し3
 
###見出し3
 
####見出し4
 
####見出し4
 +
 +
## リンク
  
 
## リスト
 
## リスト
行81: 行83:
 
     半角スペース4個でも<pre></pre>で囲まれます。
 
     半角スペース4個でも<pre></pre>で囲まれます。
 
     <?php remove_post_type_support( $post_type, $supports ) ?>
 
     <?php remove_post_type_support( $post_type, $supports ) ?>
 +
 +
 +
 +
<div id="Description">
 +
== 説明 ==
 +
</div>
 +
指定された[[投稿タイプ]]について、特定の機能をサポートを削除します。
 +
ある機能のサポートを削除すると、それに対応して[[Writing Posts|投稿の編集]]画面からフィールド(エディターやメタボックスなど)が消去されます。
 +
さらに、'revisions' 機能は投稿タイプが[[Revision Management|リビジョン]]を保存するかどうかを表します。
 +
また 'comments' 機能は[[Comments in WordPress|コメント]]数を投稿の編集画面に表示するかどうかを表します。
 +
通常は、remove_post_type_support() を [[プラグイン API/アクションフック一覧/init|'init']] アクション[[プラグイン API|フック]]から呼び出さなければなりません。
 +
<div id="Usage">
 +
== 使い方 ==
 +
</div>
 +
<?php remove_post_type_support( $post_type, $supports ) ?>
 +
<div id="Parameters">
 +
== パラメータ ==
 +
</div>
 +
{{Parameter|$post_type|文字列|投稿タイプ。(最大 20 文字)}}
 +
{{Parameter|$supports|文字列|削除する機能。}}
 +
:* 'title' (タイトル)
 +
:* 'editor' (内容の編集)
 +
:* 'author' (作成者)
 +
:* 'thumbnail' (アイキャッチ画像)(現在のテーマが [[投稿サムネイル]] をサポートしていること)
 +
:* 'excerpt' (抜粋)
 +
:* 'trackbacks' (トラックバック送信)
 +
:* 'custom-fields' (カスタムフィールド)
 +
:* 'comments' (コメントの他、編集画面にコメント数のバルーンを表示する)
 +
:* 'revisions' (リビジョンを保存する)
 +
:* 'page-attributes' (メニューの順序)(投稿タイプの hierarchical が true であること)
 +
:* 'post-formats' (投稿のフォーマットを削除。[[投稿フォーマット]]を参照)
 +
<div id="Examples">
 +
== 用例 ==
 +
</div>
 +
<div id="Remove_support_for_excerpts">
 +
=== 抜粋のサポートを削除 ===
 +
</div>
 +
この例は投稿(<tt>'post'</tt>)の抜粋のサポートを削除します:
 +
<pre>
 +
add_action( 'init', 'my_custom_init' );
 +
function my_custom_init() {
 +
remove_post_type_support( 'post', 'excerpt' );
 +
}
 +
</pre>
 +
<div id="Remove_support_for_post_formats">
 +
=== 投稿フォーマットのサポートを削除 ===
 +
</div>
 +
この例は投稿(<tt>'post'</tt>)の投稿フォーマットのサポートを削除します:
 +
<pre>
 +
add_action( 'init', 'my_remove_post_type_support', 10 );
 +
function my_remove_post_type_support() {
 +
    remove_post_type_support( 'post', 'post-formats' );
 +
}
 +
</pre>
 +
<div id="Change_Log">
 +
== 変更履歴 ==
 +
</div>
 +
* [[Version 3.0|バージョン 3.0]] にて導入されました。
 +
<div id="Source_File">
 +
== ソースファイル ==
 +
</div>
 +
<tt>remove_post_type_support()</tt> は {{Trac|wp-includes/post.php}} にあります。
 +
<div id="Related">
 +
== 関連資料 ==
 +
</div>
 +
{{Post Type Tags}}
 +
{{Tag Footer}}
 +
{{原文|Function Reference/remove_post_type_support|145063}} <!-- 16:35, 25 July 2014 TimG1 版 -->
 +
{{DEFAULTSORT:Remove_post_type_support}}
 +
[[Category:関数]]
 +
[[en:Function Reference/remove_post_type_support]]
 +
[[it:Riferimento_funzioni/remove_post_type_support]]

2014年11月1日 (土) 18:08時点における版

書き方のサンプルです。

見出し2

見出し3

見出し4

リンク

リスト

箇条リスト

  • リスト
  • リスト
  • リスト

番号リスト

  1. 番号リスト
  2. 番号リスト
  3. 番号リスト

定義リスト

Apple
Pomaceous fruit of plants of the genus Malus in the family Rosaceae.
An American computer company.
Orange
The fruit of an evergreen tree of the genus Citrus.
用語1
用語1の説明
用語1に関する項目1
用語1に関する項目2
テキストが入ります。テキストが入ります。 改行はこうなります。 改行はこうなります。 改行はこうなります。 改行はこうなります。
用語2
用語2の説明
  • リスト
  • リスト
  • リスト

用語3
用語3の説明

  1. first list item
  2. second list item code block.

block quote on two lines.

  1. first list item
  2. second list item

テーブル

列1 列2 列3
This This This
column column column
will will will
be be be
left right center
aligned aligned aligned

コードの書き方

preタグで囲めば確実に表示されます。
<?php remove_post_type_support( $post_type, $supports ) ?>
半角スペース4個でも<pre></pre>で囲まれます。

半角スペース4個でも<pre></pre>で囲まれます。
<?php remove_post_type_support( $post_type, $supports ) ?>

説明

指定された投稿タイプについて、特定の機能をサポートを削除します。 ある機能のサポートを削除すると、それに対応して投稿の編集画面からフィールド(エディターやメタボックスなど)が消去されます。 さらに、'revisions' 機能は投稿タイプがリビジョンを保存するかどうかを表します。 また 'comments' 機能はコメント数を投稿の編集画面に表示するかどうかを表します。 通常は、remove_post_type_support() を 'init' アクションフックから呼び出さなければなりません。

使い方

パラメータ

テンプレート:Parameter テンプレート:Parameter

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

用例

抜粋のサポートを削除

この例は投稿('post')の抜粋のサポートを削除します:

add_action( 'init', 'my_custom_init' );
function my_custom_init() {
    remove_post_type_support( 'post', 'excerpt' );
}

投稿フォーマットのサポートを削除

この例は投稿('post')の投稿フォーマットのサポートを削除します:

add_action( 'init', 'my_remove_post_type_support', 10 );
function my_remove_post_type_support() {
    remove_post_type_support( 'post', 'post-formats' );
}

変更履歴

ソースファイル

remove_post_type_support()テンプレート:Trac にあります。

テンプレート:Post Type Tags テンプレート:Tag Footer テンプレート:原文en:Function Reference/remove_post_type_support it:Riferimento_funzioni/remove_post_type_support