- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
「関数リファレンス/get avatar」の版間の差分
提供: WordPress Codex 日本語版
< 関数リファレンス
(en:Function Reference/get_avatar 15:44, 30 November 2009 Otto42 版を翻訳用にコピー) |
(整形・リンク等調整、未翻訳) |
||
1行目: | 1行目: | ||
− | == | + | {{NeedTrans}} |
+ | == 説明 == | ||
Retrieve the avatar for a user who provided a user ID or email address. Most commonly used in the comments section. | Retrieve the avatar for a user who provided a user ID or email address. Most commonly used in the comments section. | ||
− | This function is [[ | + | This function is [[Pluggable Functions|pluggable]]/[[:en:Pluggable Functions|en]], however plugin authors wishing to change the gravatar output should use the get_avatar filter instead, for compatibility purposes. |
− | == | + | == 使い方 ==<!-- Usage --> |
− | + | <?php echo get_avatar( $id_or_email, $size, $default, $alt ); ?> | |
− | == | + | == パラメータ ==<!-- Parameters --> |
− | {{Parameter| | + | {{Parameter|id_or_email|int/string/object|Author’s User ID (an integer or string), an E-mail Address (a string) or the comment object from the comment loop. ''Note: with most comment templates you can use <code>$comment</code> here, in order to display the gravatar of the commenter. In other templates within The Loop (for WordPress 2.7 and lower), you can use <code>get_the_author_id()</code> (deprecated in WordPress 2.8). For WordPress 2.8, please use <code>get_the_author_meta('user_email')</code>.''}} |
− | {{Parameter| | + | {{Parameter|size|integer|Size of Gravatar to return (max is 512).|optional|96}} |
− | {{Parameter| | + | {{Parameter|default|string|url for an image, defaults to the "Mystery Man".|optional}} |
− | {{Parameter| | + | {{Parameter|alt|string|Alternate text for the avatar.|optional}} |
− | == | + | == 用例 ==<!-- Examples --> |
<?php echo get_avatar( $comment, 32 ); ?> | <?php echo get_avatar( $comment, 32 ); ?> | ||
− | == | + | == 変更履歴 ==<!-- Changelog --> |
− | * | + | * [[Version 2.5|2.5.0]] : 新規テンプレートタグ |
− | == | + | == ソースファイル ==<!-- Source File --> |
<tt>get_avatar()</tt> is located in {{Trac|wp-includes/pluggable.php}}. | <tt>get_avatar()</tt> is located in {{Trac|wp-includes/pluggable.php}}. | ||
30行目: | 31行目: | ||
{{原文|Function Reference/get_avatar|80569}}<!-- 15:44, 30 November 2009 Otto42 版 --> | {{原文|Function Reference/get_avatar|80569}}<!-- 15:44, 30 November 2009 Otto42 版 --> | ||
− | == | + | == 関連 ==<!-- Related --> |
{{Copyedit}} | {{Copyedit}} | ||
− | {{Tag Footer}} | + | <!-- {{Tag Footer}} --> |
+ | {{PHP Function Tag Footer}} | ||
− | [[Category: | + | {{DEFAULTSORT:Get_avatar}} |
+ | [[Category:wp2.5]] | ||
[[en:Function Reference/get_avatar]] | [[en:Function Reference/get_avatar]] |
2010年3月3日 (水) 21:44時点における版
このページ「関数リファレンス/get avatar」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています。
説明
Retrieve the avatar for a user who provided a user ID or email address. Most commonly used in the comments section.
This function is pluggable/en, however plugin authors wishing to change the gravatar output should use the get_avatar filter instead, for compatibility purposes.
使い方
<?php echo get_avatar( $id_or_email, $size, $default, $alt ); ?>
パラメータ
- id_or_email
- (int/string/object) (必須) Author’s User ID (an integer or string), an E-mail Address (a string) or the comment object from the comment loop. Note: with most comment templates you can use
$comment
here, in order to display the gravatar of the commenter. In other templates within The Loop (for WordPress 2.7 and lower), you can useget_the_author_id()
(deprecated in WordPress 2.8). For WordPress 2.8, please useget_the_author_meta('user_email')
.- 初期値: なし
- size
- (integer) (optional) Size of Gravatar to return (max is 512).
- 初期値: 96
- default
- (string) (optional) url for an image, defaults to the "Mystery Man".
- 初期値: なし
- alt
- (string) (optional) Alternate text for the avatar.
- 初期値: なし
用例
<?php echo get_avatar( $comment, 32 ); ?>
変更履歴
- 2.5.0 : 新規テンプレートタグ
ソースファイル
get_avatar() is located in wp-includes/pluggable.php
.
最新英語版: WordPress Codex » Function Reference/get_avatar (最新版との差分)
関連
この記事は翻訳時に編集が必要であるとマークされていました。その為Codex原文が大きく編集されている可能性があります。内容を確認される際は原文を参照していただき、可能であれば本項目へ反映させてください。よりよいCodexを作成するためのお手伝いをお願いします。