get_the_author_meta(参数1<string>,[选填]用户ID<int>)
描述:获取文章作者或用户的信息。
备注:如果在文章的主循环中使用,可以不必指定“用户ID”。
参数1:
admin_color(管理界面配色方案)aimcomment_shortcuts(是否选择了键盘快捷键)description(用户描述 / 个人说明)display_name(默认名称 / 公开显示为)first_name(名字)ID(用户ID)jabberlast_name(姓氏)nickname(昵称)plugins_last_viewplugins_per_pagerich_editing(使用富文本编辑器)syntax_highlighting(在编辑代码时禁用语法高亮)user_activation_keyuser_description(用户描述 / 个人说明)user_email(电子邮箱地址)user_firstname(名字)user_lastname(姓氏)user_level(用户级别)user_login(用户名)user_nicename(用户名)user_pass(用户加密后的密码)user_registered(注册时间)user_status(用户状态)user_url(网站地址)yim
使用方法
<?php
// 获取并显示用户公开显示名称:
echo get_the_author_meta('display_name');
?>
相关函数
the_author_meta()
官方文档地址:
https://developer.wordpress.org/reference/functions/get_the_author_meta/