- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
「テンプレートタグ/get bookmark」の版間の差分
提供: WordPress Codex 日本語版
< テンプレートタグ
(英語版をコピペ。) |
(見出しを翻訳。) |
||
1行目: | 1行目: | ||
− | = | + | <div id="Description"> |
+ | == 説明 == | ||
+ | </div> | ||
Retrieve Bookmark data based on bookmark link ID. | Retrieve Bookmark data based on bookmark link ID. | ||
− | = | + | <div id="Usage"> |
− | + | == 使い方 == | |
+ | </div> | ||
+ | <?php get_bookmark( $bookmark, $output, $filter ) ?> | ||
− | = | + | <div id="Parameters"> |
+ | == パラメータ == | ||
+ | </div> | ||
{{Parameter|$bookmark|integer|object|Bookmark link ID or Bookmark object.}} | {{Parameter|$bookmark|integer|object|Bookmark link ID or Bookmark object.}} | ||
{{Parameter|$output|string|Either OBJECT, ARRAY_N, or ARRAY_A constant|optional|OBJECT}} | {{Parameter|$output|string|Either OBJECT, ARRAY_N, or ARRAY_A constant|optional|OBJECT}} | ||
{{Parameter|$filter|string|default is '<tt>raw</tt>'.|optional|'raw'}} | {{Parameter|$filter|string|default is '<tt>raw</tt>'.|optional|'raw'}} | ||
− | == | + | <div id="Returns"> |
+ | == 戻り値 == | ||
+ | </div> | ||
; (array|object) : Type returned depends on <tt>$output</tt> value. | ; (array|object) : Type returned depends on <tt>$output</tt> value. | ||
− | = | + | <div id="Examples"> |
+ | == 使用例 == | ||
+ | </div> | ||
<!-- Need creative examples. Feel free to link to external examples. --> | <!-- Need creative examples. Feel free to link to external examples. --> | ||
− | = | + | |
+ | <div id="Display Bookmark Name"> | ||
+ | === ブックマーク名の表示 === | ||
+ | </div> | ||
<pre><?php | <pre><?php | ||
$bookmark = get_bookmark(5); | $bookmark = get_bookmark(5); | ||
24行目: | 37行目: | ||
<?php echo get_bookmark(5)->link_name; ?> | <?php echo get_bookmark(5)->link_name; ?> | ||
− | = | + | <div id="Display Bookmark as a Link"> |
+ | === ブックマークをリンクとして表示 === | ||
+ | </div> | ||
<pre><?php | <pre><?php | ||
$bookmark = get_bookmark(5); | $bookmark = get_bookmark(5); | ||
30行目: | 45行目: | ||
?></pre> | ?></pre> | ||
+ | <div id="Notes"> | ||
== Notes == | == Notes == | ||
+ | </div> | ||
* Uses global: (<tt>object</tt>) [[Class Reference/wpdb|<tt>$wpdb</tt>]] Database Object | * Uses global: (<tt>object</tt>) [[Class Reference/wpdb|<tt>$wpdb</tt>]] Database Object | ||
− | = | + | <div id="Change Log"> |
− | + | == 改訂履歴 == | |
+ | </div> | ||
+ | [[Version 2.1]] にて導入されました。 | ||
− | = | + | <div id="Source File"> |
+ | == ソースファイル == | ||
+ | </div> | ||
<!-- Need links to current source code files --> | <!-- Need links to current source code files --> | ||
− | <tt>get_bookmark()</tt> | + | <tt>get_bookmark()</tt> は {{Trac|wp-includes/bookmark.php}} にあります。 |
− | + | ||
− | + | ||
+ | <div id="Related"> | ||
+ | == 関連項目 == | ||
+ | </div> | ||
{{原文| Function Reference/get bookmark |141286}}<!-- 19:53, February 15, 2014 Djkaz 版 --> | {{原文| Function Reference/get bookmark |141286}}<!-- 19:53, February 15, 2014 Djkaz 版 --> | ||
2014年2月15日 (土) 20:37時点における版
目次
説明
Retrieve Bookmark data based on bookmark link ID.
使い方
<?php get_bookmark( $bookmark, $output, $filter ) ?>
パラメータ
- $bookmark
- (integer|object) (必須) Bookmark link ID or Bookmark object.
- 初期値: なし
- $output
- (string) (optional) Either OBJECT, ARRAY_N, or ARRAY_A constant
- 初期値: OBJECT
- $filter
- (string) (optional) default is 'raw'.
- 初期値: 'raw'
戻り値
- (array|object)
- Type returned depends on $output value.
使用例
ブックマーク名の表示
<?php $bookmark = get_bookmark(5); echo $bookmark->link_name; ?>
or:
<?php echo get_bookmark(5)->link_name; ?>
ブックマークをリンクとして表示
<?php $bookmark = get_bookmark(5); echo '<a href="'.$bookmark->link_url.'">'.$bookmark->link_name.'</a>'; ?>
Notes
- Uses global: (object) $wpdb Database Object
改訂履歴
Version 2.1 にて導入されました。
ソースファイル
get_bookmark() は wp-includes/bookmark.php
にあります。
関連項目
最新英語版: WordPress Codex » Function Reference/get bookmark (最新版との差分)
ブックマークタグ: wp_list_bookmarks, get_bookmarks, get_bookmark get_bookmark_field
関数リファレンス、テンプレートタグ目次もご覧ください。