Changeset 19801 for trunk/wp-includes/functions.php
- Timestamp:
- 01/31/2012 10:12:58 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r19777 r19801 2044 2044 * @param string|array $args Optional arguments to control behavior. 2045 2045 */ 2046 function wp_die( $message , $title = '', $args = array() ) {2046 function wp_die( $message = '', $title = '', $args = array() ) { 2047 2047 if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) 2048 die('-1'); 2049 2050 if ( function_exists( 'apply_filters' ) ) { 2051 $function = apply_filters( 'wp_die_handler', '_default_wp_die_handler'); 2052 } else { 2053 $function = '_default_wp_die_handler'; 2054 } 2048 $function = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' ); 2049 elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) 2050 $function = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' ); 2051 else 2052 $function = apply_filters( 'wp_die_handler', '_default_wp_die_handler' ); 2055 2053 2056 2054 call_user_func( $function, $message, $title, $args ); … … 2103 2101 } 2104 2102 2105 if ( ! function_exists( 'did_action' ) || !did_action( 'admin_head' ) ) :2103 if ( ! did_action( 'admin_head' ) ) : 2106 2104 if ( !headers_sent() ) { 2107 2105 status_header( $r['response'] ); … … 2207 2205 </head> 2208 2206 <body id="error-page"> 2209 <?php endif; // ! function_exists( 'did_action' ) || !did_action( 'admin_head' ) ?>2207 <?php endif; // ! did_action( 'admin_head' ) ?> 2210 2208 <?php echo $message; ?> 2211 2209 </body> … … 2241 2239 2242 2240 /** 2243 * Filter to enable special wp_die handler for xmlrpc requests. 2244 * 2245 * @since 3.2.0 2241 * Kill WordPress ajax execution. 2242 * 2243 * This is the handler for wp_die when processing Ajax requests. 2244 * 2245 * @since 3.4.0 2246 2246 * @access private 2247 */ 2248 function _xmlrpc_wp_die_filter() { 2249 return '_xmlrpc_wp_die_handler'; 2247 * 2248 * @param string $message Optional. Response to print. 2249 */ 2250 function _ajax_wp_die_handler( $message = '' ) { 2251 if ( is_scalar( $message ) ) 2252 die( (string) $message ); 2253 die( '0' ); 2250 2254 } 2251 2255
Note: See TracChangeset
for help on using the changeset viewer.