我希望在WordPress默认注册表单中显示字段office_name
。
到目前为止我做了什么:我使用以下代码创建了一个名为'office_name'的字段:
function my_show_extra_profile_fields() {
$user_contact_method['office_name'] = 'name of your office';
$user_contact_method['office_location'] = 'location of your office';
return $user_contact_method;
}
add_filter( 'user_contactmethods', 'my_show_extra_profile_fields' );
office_name
字段出现在后端的USERS选项卡中,并在我输入值时更新。
我希望它出现在注册表单中。
答案 0 :(得分:0)
您需要自定义注册表单。这是Wordpress codex链接。
https://codex.wordpress.org/Customizing_the_Registration_Form