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