Advertisements

akismet_get_user_roles

Definition:
function akismet_get_user_roles($user_id ) {}

Parameters

  • $user_id

Source code

function akismet_get_user_roles($user_id ) {

	$roles = false;

	

	if ( !class_exists('WP_User') )

		return false;

	

	if ( $user_id > 0 ) {

		$comment_user = new WP_User($user_id);

		if ( isset($comment_user->roles) )

			$roles = join(',', $comment_user->roles);

	}



	if ( is_multisite() && is_super_admin( $user_id ) ) {

		if ( empty( $roles ) ) {

			$roles = 'super_admin';

		} else {

			$comment_user->roles[] = 'super_admin';

			$roles = join( ',', $comment_user->roles );

		}

	}



	return $roles;

}

455

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: