[wp-trac] [WordPress Trac] #12400: Add a wp_loaded hook, an ob_start hook, and an front end ajax hook

WordPress Trac noreply at wordpress.org
Thu Dec 6 06:37:37 UTC 2012


#12400: Add a wp_loaded hook, an ob_start hook, and an front end ajax hook
------------------------------------------------+--------------------------
 Reporter:  Denis-de-Bernardy                   |       Owner:
     Type:  feature request                     |      Status:  reopened
 Priority:  normal                              |   Milestone:  Future
Component:  General                             |  Release
 Severity:  normal                              |     Version:  3.0
 Keywords:  has-patch dev-feedback 2nd-opinion  |  Resolution:
------------------------------------------------+--------------------------

Comment (by johnjamesjacoby):

 Other reasons why there should be a dedicated theme-side AJAX handler:

 * admin-ajax.php sets WP_ADMIN to true, causing plugins that use
 is_admin() to load admin code for theme-side requests.
 * admin-ajax.php fires the 'admin_init' action, executing code hooked to
 it from inside the above mentioned included files.

 Theoretically, the only way to avoid loading admin code for theme-side
 AJAX requests is to explicitly check for DOING_AJAX before loading
 anything. This pollutes plugin code with a lame constant check that is
 likely to go away eventually, given the move away from constant usage in
 recent !WordPress versions.

 I'd settle for a front-ajax.php inside of /wp-admin/ that didn't set
 WP_ADMIN and didn't fire the 'admin_init' action. I'd even go for a $_GET
 hack to bypass those two issues:

 {{{
 var ajaxurl = 'http://bbp.com/wp-admin/admin-ajax.php?admin=false
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12400#comment:34>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list