Re-purpose wp_die() for ajax responses.

* Allows unit testing of core ajax actions.
 * wp_die() now has separate filters to choose a handler depending on the context (ajax, XML-RPC, else).
 * wp_die) in ajax context does not need to be called with a string. Conversion takes place before die().
props kurtpayne, see #15327.



git-svn-id: http://svn.automattic.com/wordpress/trunk@19801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin
2012-01-31 22:12:58 +00:00
parent 8bd826e43b
commit acd0f7c375
4 changed files with 25 additions and 20 deletions

View File

@@ -98,9 +98,6 @@ function logIO($io,$msg) {
if ( isset($HTTP_RAW_POST_DATA) )
logIO("I", $HTTP_RAW_POST_DATA);
// Make sure wp_die output is XML
add_filter( 'wp_die_handler', '_xmlrpc_wp_die_filter' );
// Allow for a plugin to insert a different class to handle requests.
$wp_xmlrpc_server_class = apply_filters('wp_xmlrpc_server_class', 'wp_xmlrpc_server');
$wp_xmlrpc_server = new $wp_xmlrpc_server_class;