0
我正在使用插件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
这是否保存用户输入的细节?另外,是否可以添加一个下拉菜单或任何其他类型的输入? – Rob
是的,它会保存用户在用户自定义字段中输入的数据 – Sudar
是否可以添加任何其他类型的输入,如下拉菜单? – Rob