Advertisements

translate_level_to_role

Definition:
function translate_level_to_role($level) {}

Translate user level to user role name.

Parameters

  • int $level: User level.

Return values

returns:User role name.

Source code

function translate_level_to_role($level) {

	switch ($level) {

	case 10:

	case 9:

	case 8:

		return 'administrator';

	case 7:

	case 6:

	case 5:

		return 'editor';

	case 4:

	case 3:

	case 2:

		return 'author';

	case 1:

		return 'contributor';

	case 0:

		return 'subscriber';

	}

}

3083

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: