[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 09:11:04 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:
  westi-likes 3.6-early                          |
-------------------------------------------------+-------------------------
Changes (by westi):

 * keywords:  has-patch dev-feedback 2nd-opinion => has-patch dev-feedback
     2nd-opinion westi-likes 3.6-early


Comment:

 Replying to [comment:34 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';
 > }}}


 I'm beginning to think that we should have the frontend-ajax.php live in
 wp-includes.

 We can update the secure cookie setting to also set the cookie for this
 path / folder.

 It's more obvious that it isn't an admin request.

 It shouldn't accidentally trigger a bad plugin test for admin requests
 that looks at the url.

 We should talk about this for 3.6

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


More information about the wp-trac mailing list