如何在默认的WordPress注册表单中显示用户元中的字段

时间:2017-06-17 13:55:09

标签: wordpress

我希望在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选项卡中,并在我输入值时更新。

我希望它出现在注册表单中。

1 个答案:

答案 0 :(得分:0)

您需要自定义注册表单。这是Wordpress codex链接。

https://codex.wordpress.org/Customizing_the_Registration_Form