We know, that is_admin()
checks if current URL belongs to DASHBOARD (BUT it doenst check whether user is ADMIN).
So, I use this function to detect if administrator is logged in wordpress:
function is_admin_user(){
require_once(ABSPATH.'wp-includes/pluggable.php'); return current_user_can('create_users'); //or 'manage_options'
}
however, that is not ideal solution. Does there exist any built-in function, like wp_is_administrator()
?