【发布时间】:2015-08-12 01:20:08
【问题描述】:
我想在只读的表单输入字段中显示 wordpress 登录的用户名(显示名称)。
我已经通过Function Reference/wp get current user但没有成功。
查找我尝试过的代码:
public static function getFormHTML($form) {
global $wpdb, $display_name;
get_currentuserinfo();
$html = '<form>';
/*-------Below line in displaying user display name----------------*/
$html .= '<input name="currentusr" value="' . $current_user->display_name. '" type= "text" readonly />';
$html = '</form>';
我无法弄清楚我做错了什么..
请帮我解决...
提前致谢。
【问题讨论】: