the_author_meta

函数
the_author_meta ( $field = '', $user_id = false )
参数
  • (string) $field Selects the field of the users record. See get_the_author_meta() for the list of possible fields.
    Required:
    Default: (empty)
  • (int|false) $user_id Optional. User ID.
    Required:
    Default: false
相关
  • get_the_author_meta()
定义位置
相关方法
get_the_author_metathe_author_emailthe_author_msnthe_author_yimthe_author_aim
引入
2.8.0
弃用
-

the_author_meta: 此函数显示当前文章的作者或指定用户的指定元字段。

从用户的DB对象中输出该字段。默认为当前文章的作者。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function the_author_meta( $field = '', $user_id = false ) {
$author_meta = get_the_author_meta( $field, $user_id );
/**
* Filters 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 );
}
function the_author_meta( $field = '', $user_id = false ) { $author_meta = get_the_author_meta( $field, $user_id ); /** * Filters 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 ); }
function the_author_meta( $field = '', $user_id = false ) {
	$author_meta = get_the_author_meta( $field, $user_id );

	/**
	 * Filters 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 );
}

常见问题

FAQs
查看更多 >