- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
「テンプレートタグ/comment author」の版間の差分
細 (要更新: パラメータ追加) |
(en:Function Reference/comment_author 03:56, 8 February 2013 Bcworkz 版を反映して残りを和訳。) |
||
1行目: | 1行目: | ||
− | + | <div id="Description"> | |
− | + | == 説明 == | |
+ | </div> | ||
− | + | コメントの作成者の名前(コメントした人が入力した名前)を表示します。名前がなければ([[管理画面/ディスカッション設定#Other_comment_settings|ディスカッション設定]]の「名前とメールアドレスの入力を必須にする」がイネーブルでないときに限られます)、WordPress がコメント作成者を「匿名」にします。<!-- This tag must be within [[The Loop]], or a comment loop. --> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | 表示する代わりに値として取得するには [[関数リファレンス/get_comment_author|get_comment_author()]]/[[:en:Function Reference/get_comment_author|en]] を使ってください。 | ||
+ | |||
+ | <div id="Usage"> | ||
+ | == 使い方 == | ||
+ | </div> | ||
+ | |||
+ | <?php comment_author( $comment_ID ); ?> | ||
+ | |||
+ | <div id="Parameters"> | ||
+ | == パラメータ == | ||
+ | </div> | ||
+ | |||
+ | {{Parameter|$comment_ID|整数|作成者を表示するコメントの ID|オプション|0 (現在のコメント)}} | ||
+ | |||
+ | == 戻り値 == | ||
+ | |||
+ | このテンプレートタグは値を返しません。 | ||
+ | |||
+ | <div id="Example"> | ||
+ | == 用例 == | ||
+ | </div> | ||
+ | |||
+ | <pre><div><?php comment_author(); ?> によるコメント:</div></pre> | ||
+ | |||
+ | <div id=""> | ||
+ | == フィルター == | ||
+ | </div> | ||
+ | |||
+ | コメントの作成者を表示する前に [[関数リファレンス/apply_filters|apply_filters()]] を使って <code>'comment_author'</code> を呼び出します。 | ||
+ | |||
+ | <div id="Changelog"> | ||
== 変更履歴 == | == 変更履歴 == | ||
+ | </div> | ||
− | * ? : | + | <!-- * ? : Added the 'comment_ID' parameter. --> |
+ | * 0.71 : 新規導入。 | ||
− | == | + | <div id="Source_Code"> |
+ | == ソースコード == | ||
+ | </div> | ||
+ | |||
+ | <code>comment_author()</code> は {{Trac|wp-includes/comment-template.php}} にあります。 | ||
+ | |||
+ | <div id="Related"> | ||
+ | == 関連資料 == | ||
+ | </div> | ||
{{Tag Comments Tags}} | {{Tag Comments Tags}} | ||
− | {{ | + | {{Tag Footer}} |
+ | |||
+ | {{原文|Function Reference/comment_author|126887}} <!-- 03:56, 8 February 2013 Bcworkz 版 --> | ||
− | {{DEFAULTSORT:Comment_author}} | + | {{DEFAULTSORT:Comment_author}} |
− | [[Category: | + | [[Category:テンプレートタグ]] |
− | [[en: | + | [[en:Function Reference/comment_author]] |
2014年9月10日 (水) 00:33時点における版
コメントの作成者の名前(コメントした人が入力した名前)を表示します。名前がなければ(ディスカッション設定の「名前とメールアドレスの入力を必須にする」がイネーブルでないときに限られます)、WordPress がコメント作成者を「匿名」にします。
表示する代わりに値として取得するには get_comment_author()/en を使ってください。
使い方
<?php comment_author( $comment_ID ); ?>
パラメータ
- $comment_ID
- (整数) (オプション) 作成者を表示するコメントの ID
- 初期値: 0 (現在のコメント)
戻り値
このテンプレートタグは値を返しません。
用例
<div><?php comment_author(); ?> によるコメント:</div>
フィルター
コメントの作成者を表示する前に apply_filters() を使って 'comment_author'
を呼び出します。
変更履歴
- 0.71 : 新規導入。
ソースコード
comment_author()
は wp-includes/comment-template.php
にあります。
関連資料
コメント関数: cancel_comment_reply_link(), comment_author(), comment_author_email(), comment_author_email_link(), comment_author_IP(), comment_author_link(), comment_author_rss(), comment_author_url(), comment_author_url_link(), comment_class(), comment_date(), comment_excerpt(), comment_form_title(), comment_form(), comment_ID(), comment_id_fields() / en, comment_reply_link(), comment_text(), comment_text_rss(), comment_time(), comment_type(), comments_link, comments_number(), comments_open(), comments_popup_link(), comments_popup_script(), comments_rss_link(), get_avatar(), next_comments_link(), paginate_comments_links(), permalink_comments_rss(), previous_comments_link(), wp_list_comments()
最新英語版: WordPress Codex » Function Reference/comment_author (最新版との差分)