- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
テンプレートタグ/get author posts url
提供: WordPress Codex 日本語版
投稿の作成者を ID で指定して、作成者アーカイブページの URL を取得します。
使い方
<?php get_author_posts_url( $author_id, $author_nicename ); ?>
パラメータ
- $author_id
- (整数) (必須) URL を取得する作成者の ID
- 初期値: なし
- $author_nicename
- (文字列) (オプション) ユーザーのスラッグ。
- 初期値: 空文字列
戻り値
- (文字列)
- 作成者アーカイブページの URL
用例
現在の投稿の作成者について、作成者アーカイブページのリンクを表示します。
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a>
参考
URL を返す前に 'author_link' フィルターを適用します。
更新履歴
バージョン 2.1.0 にて導入されました。
ソースファイル
get_author_posts_url() は wp-includes/author-template.php
にあります。
関連資料
作成者タグ:
the_author(),
get_the_author(),
the_author_link(),
get_the_author_link(),
the_author_meta(),
get_the_author_meta(),
the_author_posts(),
get_the_author_posts(),
the_author_posts_link(),
get_author_posts_url(),
get_the_modified_author(),
the_modified_author(),
wp_dropdown_users(),
wp_list_authors()
関数リファレンス、テンプレートタグ目次もご覧ください。
最新英語版: WordPress Codex » Function_Reference/get_author_posts_url (最新版との差分)