Title: class-wp-roles.php error
Last modified: January 4, 2019

---

# class-wp-roles.php error

 *  [crossroads](https://wordpress.org/support/users/crossroads/)
 * (@crossroads)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/class-wp-roles-php-error/)
 * In the last week the below errors are showing up on my site, I assume this has
   something to do with a recent automatic update. I’m not sure how to fix it.
 * Warning: Illegal string offset ‘capabilities’ in …/igym/wp-includes/class-wp-
   roles.php on line 279
 * Warning: Illegal string offset ‘name’ in …/igym/wp-includes/class-wp-roles.php
   on line 280
 * It also seems to interfere with me logging into the wordpress dashboard also.
   I get these errors underneath when I try to log in.
 * Warning: Cannot modify header information – headers already sent by (output started
   at …/igym/wp-includes/class-wp-roles.php:279) in /homepages/17/d324508979/htdocs/
   igym/wp-login.php on line 423
 * Warning: Cannot modify header information – headers already sent by (output started
   at …/igym/wp-includes/class-wp-roles.php:279) in /homepages/17/d324508979/htdocs/
   igym/wp-login.php on line 436
 * Warning: Cannot modify header information – headers already sent by (output started
   at …/igym/wp-includes/class-wp-roles.php:279) in /homepages/17/d324508979/htdocs/
   igym/wp-includes/pluggable.php on line 920
 * Warning: Cannot modify header information – headers already sent by (output started
   at …/igym/wp-includes/class-wp-roles.php:279) in /homepages/17/d324508979/htdocs/
   igym/wp-includes/pluggable.php on line 921
 * Warning: Cannot modify header information – headers already sent by (output started
   at …/igym/wp-includes/class-wp-roles.php:279) in /homepages/17/d324508979/htdocs/
   igym/wp-includes/pluggable.php on line 922
 * any help would be most appreciated.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fclass-wp-roles-php-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/class-wp-roles-php-error/#post-11052577)
 * You need to turn off `display_errors`. So if you have anything in your wp-config.
   php file that turns on DEBUG_x then turn it off. Or if you have a plugin that
   turns it on, turn it off.
 * This is the code in question:
 *     ```
       /**
        * Initializes all of the available roles.
        *
        * @since 4.9.0
        */
       public function init_roles() {
       	if ( empty( $this->roles ) ) {
       		return;
       	}
   
       	$this->role_objects = array();
       	$this->role_names =  array();
       	foreach ( array_keys( $this->roles ) as $role ) {
       		$this->role_objects[ $role ] = new WP_Role( $role, $this->roles[ $role ]['capabilities'] );
       		$this->role_names[ $role ] = $this->roles[ $role ]['name'];
       	}
   
       	/**
       	 * After the roles have been initialized, allow plugins to add their own roles.
       	 *
       	 * @since 4.7.0
       	 *
       	 * @param WP_Roles $this A reference to the WP_Roles object.
       	 */
       	do_action( 'wp_roles_init', $this );
       }
       ```
   
 * It is working for most people, so it must be something that one of your plugins
   has updated, something to do with the user roles.
 *  [caylah77](https://wordpress.org/support/users/caylah77/)
 * (@caylah77)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/class-wp-roles-php-error/#post-11115004)
 * I have the same problem – I have disabled all the plugins and it hasn’t helped.
 * (ps. Ive turned the error messages on on purpose to see what the problem is –
   turning those off won’t get rid of the problem)
 * HELP!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘class-wp-roles.php error’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [caylah77](https://wordpress.org/support/users/caylah77/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/class-wp-roles-php-error/#post-11115004)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
