Skip to content

Commit

Permalink
Access user roles directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarssanchezz committed Aug 28, 2018
1 parent 105ec3c commit 4757dca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/class-wp-nr-apm.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function set_custom_variables() {
if ( function_exists( 'newrelic_set_user_attributes' ) ) {
if ( is_user_logged_in() ) {
$user = wp_get_current_user();
newrelic_set_user_attributes( $user->ID, '', reset( $user->roles ) );
newrelic_set_user_attributes( $user->ID, '', $user->roles[0] );
} else {
newrelic_set_user_attributes( 'not-logged-in', '', 'no-role' );
}
Expand Down

0 comments on commit 4757dca

Please sign in to comment.