[wp-trac] [WordPress Trac] #12400: Add a wp_loaded hook, an ob_start hook, and an front end ajax hook
WordPress Trac
wp-trac at lists.automattic.com
Sun Apr 24 17:21:53 UTC 2011
#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:
------------------------------------------------+--------------------------
Changes (by sivel):
* keywords: has-patch => has-patch dev-feedback 2nd-opinion
Comment:
Reopening this because I believe there may be a way to accomplish this in
a way that doesn't duplicate a lot of code and cause security
vulnerabilities and be backwards compatible, and add no new ajax hooks.
I think we can make wp-ajax.php the primary ajax handler, at least from
the standpoint that the actions are fired in this file, separate out the
functionality in the switch statements in admin-ajax.php into actual
functions, have admin-ajax.php hook into the wp_ajax_ and wp_ajax_nopriv_
actions, and include wp-ajax.php
This is just a thought, with a proof of concept patch.
Let me know what your thoughts are, if it is deemed that this still isn't
a good scenario then we can close the ticket.
I still believe we can do without this patch as long as we keep pushing
education as the answer. One of the biggest points of confusion I see is
surrounding the fact that admin-ajax.php lives in wp-admin, and people
assume that it should not be used for frontend ajax. We also see
scenarios where the security put in place on wp-admin causes issues. I
offered a suggestion in a previous comment for this as well.
This patch should be backwards compatible, and would allow both admin-
ajax.php and wp-ajax.php to be used as ajax endpoints. It moves a lot of
code that should have probably been in separated functions to begin with,
and utilizes the WP API for hooking in, rather than huge switch
statements.
In any case, I figured I had some free time, an idea and thought we could
give this another go.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12400#comment:32>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list