テンプレートタグ/the author meta

出典: WordPress Codex 日本語版

このページ「テンプレートタグ/the author meta」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています

the_author_metaテンプレートタグを使えば、あるユーザーが持つメタデータから好きなものを表示することができます。このタグをループの中で使った場合、ユーザーIDを指定する必要はありません。表示されるデータは現在の投稿の作者のものになります。ループの外で使われた場合、ユーザーIDを指定する必要があります。

この情報を戻り値(表示しないPHPの変数)として使用したいならば、get_the_author_meta()/enを使ってください。

注意: the_author_metaVersion 2.8から使用可能になりました。

使用法

<?php the_author_meta( $field, $userID ); ?>

パラメータ

$field 
(string) 表示したいデータのフィールド名。有効な値は...
  • user_login
  • user_pass
  • user_nicename
  • user_email
  • user_url
  • user_registered
  • user_activation_key
  • user_status
  • display_name
  • nickname
  • first_name
  • last_name
  • description
  • jabber
  • aim
  • yim
  • user_level
  • user_firstname
  • user_lastname
  • user_description
  • rich_editing
  • comment_shortcuts
  • admin_color
  • plugins_per_page
  • plugins_last_view
  • ID
$userID 
(integer) これが指定されると、このIDを持つユーザーの情報が表示されます。

投稿作成者のAIMアカウント名を表示する

投稿作成者のAIM (AOL Instant Messengerアカウント)フィールドを表示します。

<p>この著者のAIMアカウントは<?php the_author_meta('aim'); ?>です。</p>

特定のユーザーのメールアドレスを表示する

ユーザーID25のメールアドレスを表示します。

<p>ID25のユーザーのアドレスは<?php the_author_meta('user_email',25); ?>です。</p>

変更履歴

  • 2.8 : 新規テンプレートタグ

Source File

the_author_meta() is located in wp-includes/author-template.php.

the_author, the_author_description, the_author_login, the_author_firstname, the_author_lastname, the_author_nickname, the_author_ID, the_author_email, the_author_url, the_author_link, the_author_icq, the_author_aim, the_author_yim, the_author_msn, the_author_posts, the_author_posts_link, list_authors, wp_list_authors



原文・最新版: WordPress Codex » Template Tags/the_author_meta最新版との差分

他の言語