[wp-trac] [WordPress Trac] #25669: Introduce helper function for AJAX checks

WordPress Trac noreply at wordpress.org
Wed Oct 23 12:20:19 UTC 2013


#25669: Introduce helper function for AJAX checks
-------------------------+-----------------------------
 Reporter:  toscho       |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  normal       |   Keywords:
-------------------------+-----------------------------
 Currently, we have to duplicate AJAX checks over and over in our code, so
 a shorthand function would be nice.

 Something like this:

 {{{
 function is_wp_ajax() {
         return defined( 'DOING_AJAX' ) && DOING_AJAX;
 }
 }}}

 `is_wp_ajax()` is easier to type, it would reduce code duplication a
 little bit, and it would be less error prone, because an IDE would help
 with auto-completion.

 Con: one function more.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25669>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list