WordPress at a glance

the_author_meta() WP 1.0

Outputs the field from the user's DB object. Defaults to current post's author.

Works based on: get_the_author_meta()
✈ 1 time = 0.000012s = very fast | 50000 times = 0.03s = speed of light | PHP 7.1.2, WP 4.7.3
Hooks from the function
Return

Null. Nothing.

Usage

the_author_meta( $field, $user_id );
$field(string)
Selects the field of the users record. See get_the_author_meta() for the list of possible fields.
Default: ''
$user_id(int/false)
User ID.
Default: false

Notes

  • See: get_the_author_meta()

Changelog

Since 2.8.0 Introduced.

Code of the author meta: wp-includes/author-template.php WP 5.2.4

<?php
function the_author_meta( $field = '', $user_id = false ) {
	$author_meta = get_the_author_meta( $field, $user_id );

	/**
	 * The value of the requested user metadata.
	 *
	 * The filter name is dynamic and depends on the $field parameter of the function.
	 *
	 * @since 2.8.0
	 *
	 * @param string    $author_meta The value of the metadata.
	 * @param int|false $user_id     The user ID.
	 */
	echo apply_filters( "the_author_{$field}", $author_meta, $user_id );
}

Related Functions

From tag: Metadatas (any)

More from Template Tags: Authors

No comments
    Hello, !     Log In . Register