最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - How to check if user is in back end?

programmeradmin0浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论