Ticket #12400: 12400.4.diff
File 12400.4.diff, 17.7 KB (added by , 14 years ago) |
---|
-
wp-ajax.php
1 <?php 2 /** 3 * WordPress Primary AJAX Process Execution. 4 * 5 * @package WordPress 6 */ 7 8 /** 9 * Executing AJAX process. 10 * 11 * @since 2.1.0 12 */ 13 define( 'DOING_AJAX', true ); 14 15 if ( ! isset( $_REQUEST['action'] ) ) 16 die( '-1' ); 17 18 if ( ! defined( 'ABSPATH' ) ) 19 require_once( dirname( __FILE__ ) . '/wp-load.php' ); 20 21 if ( defined( 'WP_ADMIN' ) && WP_ADMIN ) 22 require_once( ABSPATH . 'wp-admin/includes/admin.php' ); 23 24 @header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) ); 25 send_nosniff_header(); 26 27 if ( defined( 'WP_ADMIN' ) && WP_ADMIN ) 28 do_action( 'admin_init' ); 29 30 if ( ! is_user_logged_in() ) { 31 if ( !empty( $_REQUEST['action'] ) ) 32 do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); 33 die('-1'); 34 } 35 36 if ( isset( $_REQUEST['action'] ) ) { 37 do_action( 'wp_ajax_' . $_REQUEST['action'] ); 38 die( '0' ); 39 } else { 40 die( '1' ); 41 } 42 ?> -
wp-admin/admin-ajax.php
1 1 <?php 2 2 /** 3 * WordPress AJAX Process Execution .3 * WordPress AJAX Process Execution for admin. 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Administration 7 7 */ 8 9 /**10 * Executing AJAX process.11 *12 * @since 2.1.013 */14 define('DOING_AJAX', true);15 8 define('WP_ADMIN', true); 16 9 17 if ( ! isset( $_REQUEST['action']) )18 die('-1');10 if ( ! defined( 'ABSPATH' ) ) 11 require_once( '../wp-load.php' ); 19 12 20 require_once('../wp-load.php');21 22 require_once('./includes/admin.php');23 @header('Content-Type: text/html; charset=' . get_option('blog_charset'));24 send_nosniff_header();25 26 do_action('admin_init');27 28 13 if ( ! is_user_logged_in() ) { 14 if ( isset( $_POST['action'] ) ) 15 add_action( 'wp_ajax_nopriv_autosave', 'ajax_logged_out_autosave' ); 16 } else { 17 if ( isset( $_GET['action'] ) ) { 18 add_action( 'wp_ajax_fetch-list', 'ajax_fetch_list' ); 19 add_action( 'wp_ajax_ajax-tag-search', 'ajax_tag_search' ); 20 add_action( 'wp_ajax_wp-compression-test', 'ajax_wp_compression_test' ); 21 add_action( 'wp_ajax_imgedit-preview', 'ajax_imgedit_preview' ); 22 add_action( 'wp_ajax_menu-quick-search', 'ajax_menu_quick_search' ); 23 add_action( 'wp_ajax_oembed-cache', 'ajax_oembed_cache' ); 24 } else if ( isset( $_POST['action'] ) ) { 25 add_action( 'wp_ajax_delete-comment', 'ajax_delete_comment' ); 26 add_action( 'wp_ajax_delete-tag', 'ajax_delete_tag' ); 27 add_action( 'wp_ajax_delete-link', 'ajax_delete_link' ); 28 add_action( 'wp_ajax_delete-meta', 'ajax_delete_meta' ); 29 add_action( 'wp_ajax_delete-post', 'ajax_delete_post' ); 30 add_action( 'wp_ajax_trash-post', 'ajax_trash_untrash_post' ); 31 add_action( 'wp_ajax_untrash-post', 'ajax_trash_untrash_post' ); 32 add_action( 'wp_ajax_delete-page', 'ajax_delete_page' ); 33 add_action( 'wp_ajax_dim-comment', 'ajax_dim_comment' ); 34 add_action( 'wp_ajax_add-link-category', 'ajax_add_link_category' ); 35 add_action( 'wp_ajax_add-tag', 'ajax_add_tag' ); 36 add_action( 'wp_ajax_get-tagcloud', 'ajax_get_tagcloud' ); 37 add_action( 'wp_ajax_get-comments', 'ajax_get_comments' ); 38 add_action( 'wp_ajax_replyto-comment', 'ajax_replyto_comment' ); 39 add_action( 'wp_ajax_edit-comment', 'ajax_edit_comment' ); 40 add_action( 'wp_ajax_add-menu-item', 'ajax_add_menu_item' ); 41 add_action( 'wp_ajax_add-meta', 'ajax_add_meta' ); 42 add_action( 'wp_ajax_add-user', 'ajax_add_user' ); 43 add_action( 'wp_ajax_autosave', 'ajax_autosave' ); 44 add_action( 'wp_ajax_closed-postboxes', 'ajax_closed_postboxes' ); 45 add_action( 'wp_ajax_hidden-columns', 'ajax_hidden_columns' ); 46 add_action( 'wp_ajax_menu-get-metabox', 'ajax_menu_get_metabox' ); 47 add_action( 'wp_ajax_menu-quick-search', 'ajax_menu_quick_search' ); 48 add_action( 'wp_ajax_wp-link-ajax', 'ajax_wp_link_ajax' ); 49 add_action( 'wp_ajax_menu-locations-save', 'ajax_menu_locations_save' ); 50 add_action( 'wp_ajax_meta-box-order', 'ajax_meta_box_order' ); 51 add_action( 'wp_ajax_get-permalink', 'ajax_get_permalink' ); 52 add_action( 'wp_ajax_sample-permalink', 'ajax_sample_permalink' ); 53 add_action( 'wp_ajax_inline-save', 'ajax_inline_save' ); 54 add_action( 'wp_ajax_inline-save-tax', 'ajax_inline_save_tax' ); 55 add_action( 'wp_ajax_find_posts', 'ajax_find_posts' ); 56 add_action( 'wp_ajax_widgets-order', 'ajax_widgets_order' ); 57 add_action( 'wp_ajax_save-widget', 'ajax_save_widget' ); 58 add_action( 'wp_ajax_image-editor', 'ajax_image_editor' ); 59 add_action( 'wp_ajax_set-post-thumbnail', 'ajax_set_post_thumbnail' ); 60 add_action( 'wp_ajax_date_format', 'ajax_date_format' ); 61 add_action( 'wp_ajax_time_format', 'ajax_time_format' ); 62 add_action( 'wp_ajax_wp-fullscreen-save-post', 'ajax_wp_fullscreen_save_post' ); 63 } 64 } 29 65 30 if ( isset( $_POST['action'] ) && $_POST['action'] == 'autosave') {31 66 function ajax_logged_out_autosave() { 67 $id = isset($_POST['post_ID'])? (int) $_POST['post_ID'] : 0; 32 68 33 34 69 if ( ! $id ) 70 die('-1'); 35 71 36 $message = sprintf( __('<strong>ALERT: You are logged out!</strong> Could not save draft. <a href="%s" target="_blank">Please log in again.</a>'), wp_login_url() ); 37 $x = new WP_Ajax_Response( array( 38 'what' => 'autosave', 39 'id' => $id, 40 'data' => $message 41 ) ); 42 $x->send(); 43 } 44 45 if ( !empty( $_REQUEST['action'] ) ) 46 do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); 47 48 die('-1'); 72 $message = sprintf( __('<strong>ALERT: You are logged out!</strong> Could not save draft. <a href="%s" target="_blank">Please log in again.</a>'), wp_login_url() ); 73 $x = new WP_Ajax_Response( array( 74 'what' => 'autosave', 75 'id' => $id, 76 'data' => $message 77 ) ); 78 $x->send(); 49 79 } 50 80 51 if ( isset( $_GET['action'] ) ) : 52 switch ( $action = $_GET['action'] ) : 53 case 'fetch-list' : 54 81 function ajax_fetch_list() { 55 82 $list_class = $_GET['list_args']['class']; 56 83 check_ajax_referer( "fetch-list-$list_class", '_ajax_fetch_list_nonce' ); 57 84 … … 73 100 $wp_list_table->ajax_response(); 74 101 75 102 die( '0' ); 76 break; 77 case 'ajax-tag-search' : 103 } 104 105 function ajax_tag_search() { 78 106 if ( isset( $_GET['tax'] ) ) { 79 107 $taxonomy = sanitize_key( $_GET['tax'] ); 80 108 $tax = get_taxonomy( $taxonomy ); … … 100 128 101 129 echo join( $results, "\n" ); 102 130 die; 103 break; 104 case 'wp-compression-test' : 131 } 132 133 function wp_compression_test() { 105 134 if ( !current_user_can( 'manage_options' ) ) 106 135 die('-1'); 107 136 … … 144 173 } 145 174 146 175 die('0'); 147 break; 148 case 'imgedit-preview' : 176 } 177 178 function ajax_imgedit_preview() { 149 179 $post_id = intval($_GET['postid']); 150 180 if ( empty($post_id) || !current_user_can('edit_post', $post_id) ) 151 181 die('-1'); … … 157 187 die('-1'); 158 188 159 189 die(); 160 break; 161 case 'menu-quick-search': 190 } 191 192 function admin_menu_quick_search() { 162 193 if ( ! current_user_can( 'edit_theme_options' ) ) 163 194 die('-1'); 164 195 … … 167 198 _wp_ajax_menu_quick_search( $_REQUEST ); 168 199 169 200 exit; 170 break; 171 case 'oembed-cache' : 201 } 202 203 function oembed_cache() { 172 204 $return = ( $wp_embed->cache_oembed( $_GET['post'] ) ) ? '1' : '0'; 173 205 die( $return ); 174 break; 175 default : 176 do_action( 'wp_ajax_' . $_GET['action'] ); 177 die('0'); 178 break; 179 endswitch; 180 endif; 206 } 181 207 208 182 209 /** 183 210 * Sends back current comment total and new page links if they need to be updated. 184 211 * … … 316 343 $x->send(); 317 344 } 318 345 319 $id = isset($_POST['id'])? (int) $_POST['id'] : 0; 320 switch ( $action = $_POST['action'] ) : 321 case 'delete-comment' : // On success, die with time() instead of 1 346 function ajax_delete_comment() { // On success, die with time() instead of 1 347 $id = isset($_POST['id'])? (int) $_POST['id'] : 0; 322 348 if ( !$comment = get_comment( $id ) ) 323 349 die( (string) time() ); 324 350 if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) … … 357 383 if ( $r ) // Decide if we need to send back '1' or a more complicated response including page links and comment counts 358 384 _wp_ajax_delete_comment_response( $comment->comment_ID, $delta ); 359 385 die( '0' ); 360 break; 361 case 'delete-tag' : 386 } 387 388 function ajax_delete_tag() { 362 389 $tag_id = (int) $_POST['tag_ID']; 363 390 check_ajax_referer( "delete-tag_$tag_id" ); 364 391 … … 376 403 die('1'); 377 404 else 378 405 die('0'); 379 break; 380 case 'delete-link' : 406 } 407 408 function ajax_delete_link() { 409 $id = isset($_POST['id'])? (int) $_POST['id'] : 0; 381 410 check_ajax_referer( "delete-bookmark_$id" ); 382 411 if ( !current_user_can( 'manage_links' ) ) 383 412 die('-1'); … … 390 419 die('1'); 391 420 else 392 421 die('0'); 393 break; 394 case 'delete-meta' : 422 } 423 424 function ajax_delete_meta() { 425 $id = isset($_POST['id'])? (int) $_POST['id'] : 0; 395 426 check_ajax_referer( "delete-meta_$id" ); 396 427 if ( !$meta = get_post_meta_by_id( $id ) ) 397 428 die('1'); … … 401 432 if ( delete_meta( $meta->meta_id ) ) 402 433 die('1'); 403 434 die('0'); 404 break; 405 case 'delete-post' : 435 } 436 437 function ajax_delete_post() { 438 $id = isset($_POST['id'])? (int) $_POST['id'] : 0; 406 439 check_ajax_referer( "{$action}_$id" ); 407 440 if ( !current_user_can( 'delete_post', $id ) ) 408 441 die('-1'); … … 414 447 die('1'); 415 448 else 416 449 die('0'); 417 break; 418 case 'trash-post' : 419 case 'untrash-post' : 450 } 451 452 function ajax_trash_untrash_post() { 453 $id = isset($_POST['id'])? (int) $_POST['id'] : 0; 420 454 check_ajax_referer( "{$action}_$id" ); 421 455 if ( !current_user_can( 'delete_post', $id ) ) 422 456 die('-1'); … … 433 467 die('1'); 434 468 435 469 die('0'); 436 break; 437 case 'delete-page' : 470 } 471 472 function ajax_delete_page() { 473 $id = isset($_POST['id'])? (int) $_POST['id'] : 0; 438 474 check_ajax_referer( "{$action}_$id" ); 439 475 if ( !current_user_can( 'delete_page', $id ) ) 440 476 die('-1'); … … 446 482 die('1'); 447 483 else 448 484 die('0'); 449 break; 450 case 'dim-comment' : // On success, die with time() instead of 1 485 } 451 486 487 function ajax_dim_comment() { // On success, die with time() instead of 1 488 $id = isset($_POST['id'])? (int) $_POST['id'] : 0; 452 489 if ( !$comment = get_comment( $id ) ) { 453 490 $x = new WP_Ajax_Response( array( 454 491 'what' => 'comment', … … 481 518 // Decide if we need to send back '1' or a more complicated response including page links and comment counts 482 519 _wp_ajax_delete_comment_response( $comment->comment_ID ); 483 520 die( '0' ); 484 break; 485 case 'add-link-category' : // On the Fly 521 } 522 523 function ajax_add_link_category() { // On the Fly 486 524 check_ajax_referer( $action ); 487 525 if ( !current_user_can( 'manage_categories' ) ) 488 526 die('-1'); … … 506 544 ) ); 507 545 } 508 546 $x->send(); 509 break; 510 case 'add-tag' : 547 } 548 549 function ajax_add_tag() { 511 550 check_ajax_referer( 'add-tag' ); 512 551 $post_type = !empty($_POST['post_type']) ? $_POST['post_type'] : 'post'; 513 552 $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag'; … … 558 597 'supplemental' => (array) $tag 559 598 ) ); 560 599 $x->send(); 561 break; 562 case 'get-tagcloud' : 600 } 601 602 function ajax_get_tagcloud() { 563 603 if ( isset( $_POST['tax'] ) ) { 564 604 $taxonomy = sanitize_key( $_POST['tax'] ); 565 605 $tax = get_taxonomy( $taxonomy ); … … 593 633 echo $return; 594 634 595 635 exit; 596 break; 597 case 'get-comments' : 636 } 637 638 function ajax_get_comments() { 598 639 check_ajax_referer( $action ); 599 640 600 641 set_current_screen( 'edit-comments' ); … … 623 664 'data' => $comment_list_item 624 665 ) ); 625 666 $x->send(); 626 break; 627 case 'replyto-comment' : 667 } 668 669 function ajax_replyto_comment() { 628 670 check_ajax_referer( $action, '_ajax_nonce-replyto-comment' ); 629 671 630 672 set_current_screen( 'edit-comments' ); … … 693 735 )); 694 736 695 737 $x->send(); 696 break; 697 case 'edit-comment' : 738 } 739 740 function ajax_edit_comment() { 698 741 check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' ); 699 742 700 743 set_current_screen( 'edit-comments' ); … … 731 774 )); 732 775 733 776 $x->send(); 734 break; 735 case 'add-menu-item' : 777 } 778 779 function ajax_add_menu_item() { 736 780 if ( ! current_user_can( 'edit_theme_options' ) ) 737 781 die('-1'); 738 782 … … 793 837 ); 794 838 echo walk_nav_menu_tree( $menu_items, 0, (object) $args ); 795 839 } 796 break; 797 case 'add-meta' : 840 } 841 842 function ajax_add_meta() { 798 843 check_ajax_referer( 'add-meta', '_ajax_nonce-add-meta' ); 799 844 $c = 0; 800 845 $pid = (int) $_POST['post_id']; … … 875 920 ) ); 876 921 } 877 922 $x->send(); 878 break; 879 case 'add-user' : 923 } 924 925 function ajax_add_user() { 880 926 check_ajax_referer( $action ); 881 927 if ( !current_user_can('create_users') ) 882 928 die('-1'); … … 903 949 ) 904 950 ) ); 905 951 $x->send(); 906 break; 907 case 'autosave' : // The name of this action is hardcoded in edit_post() 952 } 953 954 function ajax_autosave() { // The name of this action is hardcoded in edit_post() 908 955 define( 'DOING_AUTOSAVE', true ); 909 956 910 957 $nonce_age = check_ajax_referer( 'autosave', 'autosavenonce' ); … … 998 1045 'supplemental' => $supplemental 999 1046 ) ); 1000 1047 $x->send(); 1001 break; 1002 case 'closed-postboxes' : 1048 } 1049 1050 function ajax_closed_postboxes() { 1003 1051 check_ajax_referer( 'closedpostboxes', 'closedpostboxesnonce' ); 1004 1052 $closed = isset( $_POST['closed'] ) ? explode( ',', $_POST['closed']) : array(); 1005 1053 $closed = array_filter($closed); … … 1024 1072 } 1025 1073 1026 1074 die('1'); 1027 break; 1028 case 'hidden-columns' : 1075 } 1076 1077 function ajax_hidden_columns() { 1029 1078 check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' ); 1030 1079 $hidden = isset( $_POST['hidden'] ) ? $_POST['hidden'] : ''; 1031 1080 $hidden = explode( ',', $_POST['hidden'] ); … … 1041 1090 update_user_option($user->ID, "manage{$page}columnshidden", $hidden, true); 1042 1091 1043 1092 die('1'); 1044 break; 1045 case 'menu-get-metabox' : 1093 } 1094 1095 function ajax_menu_get_metabox() { 1046 1096 if ( ! current_user_can( 'edit_theme_options' ) ) 1047 1097 die('-1'); 1048 1098 … … 1080 1130 } 1081 1131 1082 1132 exit; 1083 break; 1084 case 'menu-quick-search': 1133 } 1134 1135 function ajax_menu_quick_search() { 1085 1136 if ( ! current_user_can( 'edit_theme_options' ) ) 1086 1137 die('-1'); 1087 1138 … … 1090 1141 _wp_ajax_menu_quick_search( $_REQUEST ); 1091 1142 1092 1143 exit; 1093 break; 1094 case 'wp-link-ajax': 1144 } 1145 1146 function ajax_wp_link_ajax() { 1095 1147 require_once ABSPATH . 'wp-admin/includes/internal-linking.php'; 1096 1148 1097 1149 check_ajax_referer( 'internal-linking', '_ajax_linking_nonce' ); … … 1111 1163 echo "\n"; 1112 1164 1113 1165 exit; 1114 break; 1115 case 'menu-locations-save': 1166 } 1167 1168 function ajax_menu_locations_save() { 1116 1169 if ( ! current_user_can( 'edit_theme_options' ) ) 1117 1170 die('-1'); 1118 1171 check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' ); … … 1120 1173 die('0'); 1121 1174 set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_POST['menu-locations'] ) ); 1122 1175 die('1'); 1123 break; 1124 case 'meta-box-order': 1176 } 1177 1178 function ajax_meta_box_order() { 1125 1179 check_ajax_referer( 'meta-box-order' ); 1126 1180 $order = isset( $_POST['order'] ) ? (array) $_POST['order'] : false; 1127 1181 $page_columns = isset( $_POST['page_columns'] ) ? (int) $_POST['page_columns'] : 0; … … 1140 1194 update_user_option($user->ID, "screen_layout_$page", $page_columns, true); 1141 1195 1142 1196 die('1'); 1143 break; 1144 case 'get-permalink': 1197 } 1198 1199 function ajax_get_permalink() { 1145 1200 check_ajax_referer( 'getpermalink', 'getpermalinknonce' ); 1146 1201 $post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0; 1147 1202 die(add_query_arg(array('preview' => 'true'), get_permalink($post_id))); 1148 break; 1149 case 'sample-permalink': 1203 } 1204 1205 function ajax_sample_permalink() { 1150 1206 check_ajax_referer( 'samplepermalink', 'samplepermalinknonce' ); 1151 1207 $post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0; 1152 1208 $title = isset($_POST['new_title'])? $_POST['new_title'] : ''; 1153 1209 $slug = isset($_POST['new_slug'])? $_POST['new_slug'] : null; 1154 1210 die(get_sample_permalink_html($post_id, $title, $slug)); 1155 break; 1156 case 'inline-save': 1211 } 1212 1213 function ajax_inline_save() { 1157 1214 check_ajax_referer( 'inlineeditnonce', '_inline_edit' ); 1158 1215 1159 1216 if ( ! isset($_POST['post_ID']) || ! ( $post_ID = (int) $_POST['post_ID'] ) ) … … 1210 1267 $wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ) ); 1211 1268 1212 1269 exit; 1213 break; 1214 case 'inline-save-tax': 1270 } 1271 1272 function ajax_inline_save_tax() { 1215 1273 check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' ); 1216 1274 1217 1275 $taxonomy = sanitize_key( $_POST['taxonomy'] ); … … 1249 1307 } 1250 1308 1251 1309 exit; 1252 break; 1253 case 'find_posts': 1310 } 1311 1312 function ajax_find_posts() { 1254 1313 check_ajax_referer( 'find-posts' ); 1255 1314 1256 1315 if ( empty($_POST['ps']) ) … … 1319 1378 'data' => $html 1320 1379 )); 1321 1380 $x->send(); 1381 } 1322 1382 1323 break; 1324 case 'widgets-order' : 1383 function ajax_widgets_order() { 1325 1384 check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' ); 1326 1385 1327 1386 if ( !current_user_can('edit_theme_options') ) … … 1350 1409 } 1351 1410 1352 1411 die('-1'); 1353 break; 1354 case 'save-widget' : 1412 } 1413 1414 function ajax_save_widget() { 1355 1415 check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' ); 1356 1416 1357 1417 if ( !current_user_can('edit_theme_options') || !isset($_POST['id_base']) ) … … 1418 1478 call_user_func_array( $form['callback'], $form['params'] ); 1419 1479 1420 1480 die(); 1421 break; 1422 case 'image-editor': 1481 } 1482 1483 function ajax_image_editor() { 1423 1484 $attachment_id = intval($_POST['postid']); 1424 1485 if ( empty($attachment_id) || !current_user_can('edit_post', $attachment_id) ) 1425 1486 die('-1'); … … 1444 1505 1445 1506 wp_image_editor($attachment_id, $msg); 1446 1507 die(); 1447 break; 1448 case 'set-post-thumbnail': 1508 } 1509 1510 function ajax_set_post_thumbnail() { 1449 1511 $post_ID = intval( $_POST['post_id'] ); 1450 1512 if ( !current_user_can( 'edit_post', $post_ID ) ) 1451 1513 die( '-1' ); … … 1461 1523 if ( set_post_thumbnail( $post_ID, $thumbnail_id ) ) 1462 1524 die( _wp_post_thumbnail_html( $thumbnail_id ) ); 1463 1525 die( '0' ); 1464 break; 1465 case 'date_format' : 1526 } 1527 1528 function ajax_date_format() { 1466 1529 die( date_i18n( sanitize_option( 'date_format', $_POST['date'] ) ) ); 1467 break; 1468 case 'time_format' : 1530 } 1531 1532 function ajax_time_format() { 1469 1533 die( date_i18n( sanitize_option( 'time_format', $_POST['date'] ) ) ); 1470 break; 1471 case 'wp-fullscreen-save-post' : 1534 } 1535 1536 function ajax_wp_fullscreen_save_post() { 1472 1537 if ( isset($_POST['post_ID']) ) 1473 1538 $post_id = (int) $_POST['post_ID']; 1474 1539 else … … 1529 1594 1530 1595 echo json_encode( array( 'message' => $message, 'last_edited' => $last_edited ) ); 1531 1596 die(); 1532 break; 1533 default : 1534 do_action( 'wp_ajax_' . $_POST['action'] ); 1535 die('0'); 1536 break; 1537 endswitch; 1597 } 1598 1599 include( '../wp-ajax.php' ); 1538 1600 ?>