Network admin throwing error when I try to add/edit a user
-
About two weeks ago I changed my WP install to a network site, but ever since I’ve been plagued with issues in the admin area.
While I have been able to figure most of it out, one issue is still defeating me. While this post lists 2x errors (as below), they are actually caused by the same single issue.
Error 1 –
On the Users page (anyblog/wp-admin/users.php) I’m shown the following error –
Warning: array_keys() expects parameter 1 to be array, boolean given
Error 2 –
On the Edit User page I’m shown the following error –
Warning: array_reverse() expects parameter 1 to be array, boolean given
Why the errors are occuring –
Bothe of these errors are caused by
get_editable_roles()
returningfalse
, as opposed to an array of roles like it is supposed to.Tracing that function back I can see it looks like this –
function get_editable_roles() { global $wp_roles; $all_roles = $wp_roles->roles; $editable_roles = apply_filters( 'editable_roles', $all_roles ); return $editable_roles; }
When I check the contents of the global
$wp_roles
I see that$wp_roles->roles
is empty, whereas the rest of the object is populatd correctly.The trouble is, because
$wp_roles
is a global there is a dissconnect and I have no idea where it is actually created/populated, meaning I’m a bit stuck for ideas with regards to tracing the error further.Any hints or tips (or the answer, if you know it!) would be apprciated.
Thanks,
DavidP.s. For the sack of full disclosure, this question is also on the WordPress Stack Exchange site, although it is unanswered.
- The topic ‘Network admin throwing error when I try to add/edit a user’ is closed to new replies.