Wordpress - How to check if user is in back end?
Use is_admin()
. It checks if you're viewing an Admin page, means the backend.
Use is_admin()
to check if the the current page is an administration page. Despite its name this is not a user role check. It returns always FALSE
on front end, no matter what role the user has.