Retrieve the requested data of the author of the current post.
Signature
get_the_author_meta( $field = '', $user_id = false )
- field
- (string) selects the field of the users record.
Default:'' - user_id
- (int) Optional. User ID.
Default:false
Return
(string) The author's field from the current author's DB object.
Source
function get_the_author_meta( $field = '', $user_id = false ) {
if ( ! $user_id ) {
global $authordata;
$user_id = isset( $authordata->ID ) ? $authordata->ID : 0;
} else {
$authordata = get_userdata( $user_id );
}
if ( in_array( $field, array( 'login', 'pass', 'nicename', 'email', 'url', 'registered', 'activation_key', 'status' ) ) )
$field = 'user_' . $field;
$value = isset( $authordata->$field ) ? $authordata->$field : '';
return apply_filters( 'get_the_author_' . $field, $value, $user_id );
}
WP Trac GitHub Bitbucket
Link here
-
URL
http://queryposts.com/function/get_the_author_meta/ -
HTML
<a href='http://queryposts.com/function/get_the_author_meta/'>get_the_author_meta()</a> -
Markdown
[get_the_author_meta()](http://queryposts.com/function/get_the_author_meta/) -
BBCode
[url=http://queryposts.com/function/get_the_author_meta/]get_the_author_meta()[/url]