[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
Fri Jan 20 20:26:10 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:  Future
Component:  Administration                      |  Release
 Severity:  normal                              |     Version:  3.1
 Keywords:  westi-likes has-patch dev-feedback  |  Resolution:
------------------------------------------------+--------------------------

Comment (by ryan):

 We were split on whether use pure actions or a whitelist of core action
 that would be directly called.  This patch is something of a compromise.
 The core actions are added from a list after admin_init. This means the
 core actions cannot be removed easily using remove_action(). The core
 actions are added with priority 1. For a plugin to override they would
 have to explicitly use priority 0. These couple of hoops might at least
 make plugin authors a bit wary of overriding core ajax actions.

 This approach could easily be converted from using add_action() to
 directly calling the core actions.

 I think removing the add_action() calls from ajax-actions.php and instead
 using a list in admin-ajax.php is a good thing either way.  We have one
 easy to read canonical list, it is a bit more DRY, and ajax-actions.php
 becomes a pure include file (something I wish we were more diligent
 about).

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


More information about the wp-trac mailing list