【发布时间】:2012-11-22 10:00:15
【问题描述】:
我正在使用插件theme-my-login 和theme my profile 来创建前端登录/注册过程。
当用户在网站上注册时,他们会被重定向到他们的个人资料页面。虽然我的登录主题带有向注册表单添加额外字段的功能,但我如何向个人资料表单添加额外字段?
要显示和更新配置文件,我有短代码[theme-my-profile],它在前端显示用户配置文件。
【问题讨论】:
我正在使用插件theme-my-login 和theme my profile 来创建前端登录/注册过程。
当用户在网站上注册时,他们会被重定向到他们的个人资料页面。虽然我的登录主题带有向注册表单添加额外字段的功能,但我如何向个人资料表单添加额外字段?
要显示和更新配置文件,我有短代码[theme-my-profile],它在前端显示用户配置文件。
【问题讨论】:
试试这个代码
add_filter('user_contactmethods', array(&$this, 'add_contactmethods'), 10, 1);
/**
* Add another contact field to the user profile page
*
* @param array $contactmethods
* @return array
*/
function add_contactmethods( $contactmethods ) {
// Add Twitter
$contactmethods['twitter'] = __('Twitter Username', 'twitter-avatar-reloaded');
return $contactmethods;
}
PS:我从Twitter Avatar Reloaded WordPress Plugin复制了这段代码
【讨论】: