admin管理员组文章数量:1296330
I'm getting the following error message when I try to update my user account settings: Your Nickname must be different than your login name. Please choose a different Nickname. But there's no Nickname field, so I'm not sure what's happening. I remember that there used to be a Nickname field on other sites I've developed
I'm getting the following error message when I try to update my user account settings: Your Nickname must be different than your login name. Please choose a different Nickname. But there's no Nickname field, so I'm not sure what's happening. I remember that there used to be a Nickname field on other sites I've developed
Share Improve this question asked Apr 5, 2021 at 17:13 Laura SageLaura Sage 2255 silver badges11 bronze badges 1- the error might be related to a plugin? possibly core.trac.wordpress/ticket/29873#comment:1 are you logged in as a – Michael Commented Apr 5, 2021 at 18:30
1 Answer
Reset to default 1When you display All Users, it will display values from users table. You will not see Nickname column, because Nickname value is in usermeta table. Put the following code to your child theme's functions.php
file. First filter manage_users_columns
will add custom column Nickname to All Users view. Second filter manage_users_custom_column
will retrieve values from usermeta table for Nickname column.
function wpse_add_to_user_table($column) {
$column['nickname'] = 'Nickname';
return $column;
}
add_filter('manage_users_columns', 'wpse_add_to_user_table');
function wpse_disply_in_user_table_row($value, $column_name, $user_id) {
switch ($column_name) {
case 'nickname' :
return get_user_meta($user_id, 'nickname', true);
default:
}
return $value;
}
add_filter('manage_users_custom_column', 'wpse_disply_in_user_table_row', 10, 3);
Please note that Nickname field is always present when you Edit user.
本文标签: usersNickname field isn39t appearing in Admin
版权声明:本文标题:users - Nickname field isn't appearing in Admin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741633072a2389480.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论