[wp-trac] [WordPress Trac] #43884: new is_front() function

WordPress Trac noreply at wordpress.org
Fri Apr 27 20:24:39 UTC 2018


#43884: new is_front() function
-------------------------+-----------------------------
 Reporter:  Tkama        |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 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();
 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43884>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list