wpseek.com
A WordPress-centric search engine for devs and theme authors



translate_level_to_role › WordPress Function

Since2.0.0
Deprecatedn/a
translate_level_to_role ( $level )
Parameters:
  • (int) $level User level.
    Required: Yes
Returns:
  • (string) User role name.
Defined at:
Codex:

Translate user level to user role name.



Source

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:
		default:
			return 'subscriber';
	}
}