get_the_author_posts

Definition:
function get_the_author_posts() {}

Retrieve the number of posts by the author of the current post.

Return values

returns:The number of posts by the author.

Source code

function get_the_author_posts() {

	global $post;

	return count_user_posts($post->post_author);

}

1809

get_the_author_nickname

Definition:
function get_the_author_nickname() {}

Retrieve the nickname of the author of the current post.

Return values

returns:The author’s nickname.

Source code

function get_the_author_nickname() {

	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'nickname\')' );

	return get_the_author_meta('nickname');

}

1807

get_the_author_msn

Definition:
function get_the_author_msn() {}

Retrieve the MSN address of the author of the current post.

Return values

returns:The author’s MSN address.

Source code

function get_the_author_msn() {

	_deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'msn\')' );

	return get_the_author_meta('msn');

}

1805

get_the_author_meta

Definition:
function get_the_author_meta($field = '', $user_id = false) {}

Retrieve the requested data of the author of the current post.

Parameters

  • string $field: selects the field of the users record.
  • int $user_id: Optional. User ID.

Return values

returns:The author’s field from the current author’s DB object.

Defined filters

  • get_the_author_$field
    apply_filters('get_the_author_' . $field, $value, $user_id)

Source code

function get_the_author_meta($field = '', $user_id = false) {

	if ( ! $user_id )

		global $authordata;

	else

		$authordata = get_userdata( $user_id );



	// Keys used as object vars cannot have dashes.

	$field = str_replace('-', '', $field);

	$field = strtolower($field);

	$user_field = "user_$field";



	if ( 'id' == $field )

		$value = isset($authordata->ID) ? (int)$authordata->ID : 0;

	elseif ( isset($authordata->$user_field) )

		$value = $authordata->$user_field;

	else

		$value = isset($authordata->$field) ? $authordata->$field : '';



	return apply_filters('get_the_author_' . $field, $value, $user_id);

}

1803