admin管理员组

文章数量:1332339

In my application, i have one form. Now if user is in front end i want to display the title but if he is in back end i do not want to display it.

I do not want to check it based on user role.

In my application, i have one form. Now if user is in front end i want to display the title but if he is in back end i do not want to display it.

I do not want to check it based on user role.

Share Improve this question asked Mar 13, 2012 at 5:27 Ajay PatelAjay Patel 6584 gold badges16 silver badges27 bronze badges 1
  • This answer seems to address your question: wordpress.stackexchange/a/343592/43252 – MastaBaba Commented Mar 5, 2023 at 18:03
Add a comment  | 

2 Answers 2

Reset to default 36

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.

本文标签: pluginsHow to check if user is in back end