@mvanboordt google-analyticator.php is not a core file. It is part of Google Analyticator plugin.
@edi Goetschel
I guess Noah has better things to do with his time and this plugin doesn’t bring in referrals to his main business – SumoMe. That would be a good reason for not spending time on this plugin.
I’ve added the fix in a way that doesn’t break in older WordPress versions. However, that is not necessary, because wp_get_current_user function was added in WordPress 2.0.3.
Some parts of the original plugin code are not needed, because wp_get_current_user creates complete WP_User object with roles. So the function code for WP >= 2.0.3 would be:
/**
* Determines if a specific user fits a role
**/
function ga_current_user_is($roles)
{
if ( !$roles ) return false;
$user = wp_get_current_user();
if ( !$user->ID ) {
return false;
}
foreach ( $roles as $role )
if ( in_array($role, $user->roles) ) return true;
return false;
}