mircobabini
11/20/2014 - 3:35 PM

function.wordpress.user_is.php

<?php
/* base function */
function user_is( $role ){
	$user = wp_get_current_user();
	if( ! $user ){
		return false;
	}

	return( in_array( $role, $user->roles ) );
}
/* commodities */
function is_administrator(){ return user_is( 'administrator' ); }
function is_editor(){ return user_is( 'editor' ); }