- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
テンプレートタグ/comment author url link
現在のコメントについて、作成者のウェブサイト URL をリンク付きで表示します。このテンプレートタグはループ、またはコメントループの中で使わなければなりません。
表示する代わりに値として取得するには get_comment_author_url_link() を使ってください。
使い方
<?php comment_author_url_link( $linktext, $before, $after ); ?>
パラメータ
- $linktext
- (文字列) コメント作成者のウェブサイトリンクのラベルテキスト。デフォルト値はコメント投稿者のウェブサイト URL。
- $before
- (文字列) リンクの直前に出力するコードやテキスト。デフォルト値は空。
- $after
- (文字列) リンクの直後に出力するコードやテキスト。デフォルト値は空。
戻り値
このテンプレートタグは値を返しません。
用例
デフォルトの使い方
ウェブサイト: <?php comment_author_url_link(); ?><br />
リンクのテキストとスタイル付け
コメント作成者のウェブサイト URL をこのコメント作成者のサイトを見るという文字列として表示します。さらに前後に中黒(ドット)を付けて目立つようにします。
<?php comment_author_url_link('このコメント作成者のサイトを見る', ' • ', ' • '); ?>
変更履歴
- 0.71 : 新規導入。
ソースコード
comment_author_url_link()
は 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_url_link (最新版との差分)