• 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 to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

    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.