WordPress 获取用户资料信息
1 2 3 4 5 6 7 8 9 | <?php global $current_user; get_currentuserinfo(); echo '用户名: ' . $current_user->user_login . "\n"; echo '用户邮箱: ' . $current_user->user_email . "\n"; echo '名字: ' . $current_user->user_firstname . "\n"; echo '姓氏: ' . $current_user->user_lastname . "\n"; echo '公开显示名: ' . $current_user->display_name . "\n"; echo '用户 ID:' . $current_user->ID . "\n"; ?> |
1 2 3 4 5 | $user = get_user_by( 'login', 'admin8' );//获取用户admin8所有信息数组 $tellphone =$user->tellphone;//用户电话 $qqhao =$user->qqhao;//QQ号 $weixinhao =$user->weixinhao;//微信号 $dailititle =$user->dailititle;//代理网站名 |