[wp-trac] [WordPress Trac] #15327: Strip down admin-ajax.php to be a bare bones ajax handler.

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 22 23:33:32 UTC 2012


#15327: Strip down admin-ajax.php to be a bare bones ajax handler.
------------------------------------------------+------------------------
 Reporter:  westi                               |       Owner:  kurtpayne
     Type:  enhancement                         |      Status:  accepted
 Priority:  normal                              |   Milestone:  3.4
Component:  Administration                      |     Version:  3.1
 Severity:  normal                              |  Resolution:
 Keywords:  westi-likes has-patch dev-feedback  |
------------------------------------------------+------------------------

Comment (by azaozz):

 Still not sure why are we doing this:

 {{{
 We should move all of the handlers we have hardcoded in admin-ajax.php off
 onto action hooks.
 }}}

 Not a good idea (as noted in the comments above). If we do that it would
 let plugins remove and/or replace default core AJAX handlers which is not
 desirable.

 {{{
 That way they become much more self contained and easier to review.
 }}}

 Perhaps a little bit easier to review: long list of functions instead of a
 long `switch{}`. I don't mind the long switch{} but that's a personal
 opinion. Don't see how that makes them more self-contained. It seems to
 only bring scope issues as noted above.

 {{{
 Also the file becomes much more obvious on how a plugin can hook into it
 as we have loads of good examples :-)
 }}}

 More obvious than the codex page describing it and the many examples in
 working plugins? Not sure about this reason :)

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


More information about the wp-trac mailing list