get_tag

Sponsored Link

タグIDやタグオブジェクトで投稿タグを取得します。

Sponsored Link

$tag パラメーターオブジェクトを渡した場合、タグロウオブジェクトがデータベースを検索するものになるとみなします。タグデータキャッシュします。

$tagIDの整数の$tagを渡した場合、タグはデータベースから取得され、既にキャッシュされていない場合は、戻して渡します。

get_term()を見る場合、両方のタイプが幾つかのフィルターを通過して、最終的に$filterパラメーターの値に基づいて削除します。

Retrieve post tag by tag ID or tag object.

If you pass the $tag parameter an object, which is assumed to be the tag row object retrieved the database. It will cache the tag data.

If you pass $tag an integer of the tag ID, then that tag will be retrieved from the database, if it isn’t already cached, and pass it back.

If you look at get_term(), then both types will be passed through several filters and finally sanitized based on the $filter parameter value.

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

<?php &amp;get_tag( $tag, $output, $filter ) ?>

get_tagのパラメーター

$tag

(integer|object) (required)
デフォルト:なし

(integer|object) (required)
Default: None

$output

(string) (optional)コンスタントOBJECT, ARRAY_A, あるいは ARRAY_N
デフォルト:OBJECT

(string) (optional) Constant OBJECT, ARRAY_A, or ARRAY_N
Default: OBJECT

$filter

(string) (optional)デフォルトはrawあるいはWordPressに定義されたフィルタが適用されません。
デフォルト:’raw’

(string) (optional) Default is raw or no WordPress defined filter will applied.
Default: ‘raw’

戻り値

(object|array) $outputの値に基づいたタイプを返します。

(object|array)
Return type based on $output value.

注意

用途:get_term()はタクソノミーからタグデータを取得するために使用します。

Uses: get_term() Used to get the tag data from the taxonomy.

変更ログ

Since: 2.3.0

ソースファイル

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

get_tag() is located in wp-includes/category.php.

Sponsored Link