Skip to content

Commit

Permalink
Avoid calling on undefined index for capabilities
Browse files Browse the repository at this point in the history
#fix
  • Loading branch information
aduth committed May 27, 2017
1 parent 2dbd9fe commit 079d9e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inc/endpoints/class-wp-rest-dones-users-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public function get_items( $request ) {
$roles = wp_roles()->roles;
$editable_roles = array();
foreach ( $roles as $role ) {
if ( $role['capabilities']['edit_posts'] ) {
if ( isset( $role['capabilities']['edit_posts'] ) &&
$role['capabilities']['edit_posts'] ) {
$editable_roles[] = $role['name'];
}
}
Expand Down

0 comments on commit 079d9e5

Please sign in to comment.