Opened 8 years ago
Last modified 8 years ago
#43884 new enhancement
new is_front() function
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | |
| Focuses: | Cc: |
Description
When we need to check if we doing something in front-end, we do it like this:
if( ! is_admin() ){}
But this not convenient and not so clear because of !. And maybe not full, because we don't check other admin functions like: is_blog_admin(), is_network_admin(), is_user_admin().
We have so many functions in WordPress, but haven't this simple but useful function, why?
Maybe its a good idea to add is_front() function in /wp-includes/load.php file?
function is_front(){
return ! is_admin();
}
Change History (2)
#1
in reply to:
↑ description
@
8 years ago
Note: See
TracTickets for help on using
tickets.
Replying to Tkama:
If any of them is true,
is_admin()should also return true.