mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 20:58:55 +00:00
New wp_die_app_handler context in wp_die() for APP requests. Introduces _scalar_wp_die_handler() as a generic handler that wraps die(), for use by plugins. Move deprecated function to the end of the wp-app.php file (same as xmlrpc.php). see #20042.
git-svn-id: https://develop.svn.wordpress.org/trunk@20063 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1976,6 +1976,8 @@ function wp_die( $message = '', $title = '', $args = array() ) {
|
||||
$function = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' );
|
||||
elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST )
|
||||
$function = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' );
|
||||
elseif ( defined( 'APP_REQUEST' ) && APP_REQUEST )
|
||||
$function = apply_filters( 'wp_die_app_bandler', '_scalar_wp_die_handler' );
|
||||
else
|
||||
$function = apply_filters( 'wp_die_handler', '_default_wp_die_handler' );
|
||||
|
||||
@@ -2181,6 +2183,22 @@ function _ajax_wp_die_handler( $message = '' ) {
|
||||
die( '0' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Kill WordPress execution.
|
||||
*
|
||||
* This is the handler for wp_die when processing APP requests.
|
||||
*
|
||||
* @since 3.4.0
|
||||
* @access private
|
||||
*
|
||||
* @param string $message Optional. Response to print.
|
||||
*/
|
||||
function _scalar_wp_die_handler( $message = '' ) {
|
||||
if ( is_scalar( $message ) )
|
||||
die( (string) $message );
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the WordPress home page URL.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user