Hello @1jd123
Please make sure the user role has the required access to edit or delete users. If you have this issue with a custom user role created using UM, you can change Capabilities from wp-admin > ultimate member > User roles > (edit role) > WP Capabilities section
https://prnt.sc/K5-J_1UPXjqB
https://prnt.sc/_Fu_VO-JhmZT
Thread Starter
1jd123
(@1jd123)
Hello,
As mentioned it worked before and I double checked everything from permissions to settings. It is all set like it should. Also the users can edit and delete other users but only the first one in the list.
Hi @1jd123
Have you made any customization with UM hooks? If so, could you please try disabling it and see if the issue still occurs?
Thread Starter
1jd123
(@1jd123)
Hello,
this seems to cause the error but i really need to hide these column headers because i dont want the users to see them.
#Hide Rows in Users.php
add_filter('manage_users_columns','remove_users_columns',10, 4);
function remove_users_columns($column_headers) {
$roles = array('administrator');
foreach($roles as $role) {
if (!current_user_can($role)) {
unset($column_headers['role']);
unset($column_headers['posts']);
unset($column_headers['E-Mail']);
unset($column_headers['registerdate']);
unset($column_headers['wfls_last_login']);
unset($column_headers['wfls_2fa_status']);
unset($column_headers['account_status']);
break;
}
}
return $column_headers;
}
-
This reply was modified 3 years, 10 months ago by
1jd123.
Hi @1jd123
Sorry for the late response. Please try this modified code snippet and see if the issue still occurs:
add_filter('manage_users_columns','remove_users_columns',10, 1);
function remove_users_columns($column_headers) {
$roles = array('manage_options','adminsitrator');
foreach($roles as $role) {
if (!current_user_can($role)) {
unset($column_headers['role']);
unset($column_headers['posts']);
unset($column_headers['E-Mail']);
unset($column_headers['registerdate']);
unset($column_headers['wfls_last_login']);
unset($column_headers['wfls_2fa_status']);
unset($column_headers['account_status']);
break;
}
}
return $column_headers;
}