# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
|
|
|
|
| 2660 | 2660 | if ( function_exists( 'apply_filters' ) ) { |
| 2661 | 2661 | $function = apply_filters( 'wp_die_handler', '_default_wp_die_handler'); |
| 2662 | 2662 | }else { |
| 2663 | | if(defined('DOING_AJAX') && DOING_AJAX) |
| 2664 | | $function = '_ajax_wp_die_handler'; |
| 2665 | | else |
| 2666 | 2663 | $function = '_default_wp_die_handler'; |
| 2667 | 2664 | } |
| | 2665 | |
| 2668 | 2666 | call_user_func( $function, $message, $title, $args ); |
| 2669 | 2667 | } |
| 2670 | | function _ajax_die_handler_filter() { |
| 2671 | | return '_ajax_wp_die_handler'; |
| 2672 | | } |
| 2673 | | /** |
| 2674 | | * Kill WordPress execution and send AJAX response with error message. |
| 2675 | | * |
| 2676 | | * This is AJAX-version of the default handler for wp_die |
| 2677 | | * |
| 2678 | | * @since 3.0.0 |
| 2679 | | * @access private |
| 2680 | | * |
| 2681 | | * @param string $message Error message. |
| 2682 | | * @param string $title Error title. |
| 2683 | | * @param string|array $args Optional arguements to control behaviour. |
| 2684 | | */ |
| 2685 | | function _ajax_wp_die_handler( $message, $title = '', $args = array() ) { |
| 2686 | 2668 | |
| 2687 | | $defaults = array( 'response' => 500 ); |
| 2688 | | $r = wp_parse_args($args, $defaults); |
| 2689 | | $have_gettext = function_exists('__'); |
| 2690 | | $resp = new WP_Ajax_Response( array( |
| 2691 | | 'what' => 'autosave', |
| 2692 | | 'id' => $message |
| 2693 | | ) ); |
| 2694 | | $resp->send(); |
| 2695 | | die(); |
| 2696 | | } |
| 2697 | | |
| 2698 | 2669 | /** |
| 2699 | 2670 | * Kill WordPress execution and display HTML message with error message. |
| 2700 | 2671 | * |