Accargar class de rol al body en wordpress

add_filter( 'body_class', function( $classes ){
    foreach( (array) wp_get_current_user()->roles as $role ){
        $classes[] = "role-$role";
    }
    return $classes;
});
Horrible Hedgehog