Changeset 11911 for trunk/wp-admin/admin-ajax.php
- Timestamp:
- 09/10/2009 10:07:33 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r11881 r11911 111 111 112 112 die('0'); 113 break; 114 case 'load-preview-image' : 115 $post_id = intval($_GET['postid']); 116 if ( empty($post_id) || !current_user_can('edit_post', $post_id) ) 117 die('-1'); 118 119 check_ajax_referer( "image_editor-$post_id" ); 120 121 include_once( ABSPATH . 'wp-admin/includes/image-edit.php' ); 122 if ( !stream_preview_image($post_id) ) 123 die('-1'); 124 125 die(); 113 126 break; 114 127 default : … … 1336 1349 die(); 1337 1350 break; 1351 case 'image-edit-save': 1352 // $post_id is the attachment ID 1353 $post_id = intval($_POST['postid']); 1354 if ( empty($post_id) || !current_user_can('edit_post', $post_id) ) 1355 die('-1'); 1356 1357 check_ajax_referer( "image_editor-$post_id" ); 1358 1359 include_once( ABSPATH . 'wp-admin/includes/image-edit.php' ); 1360 $msg = wp_save_image($post_id); 1361 1362 die($msg); 1363 break; 1364 case 'open-image-editor' : 1365 $post_id = intval($_POST['postid']); 1366 if ( empty($post_id) || !current_user_can('edit_post', $post_id) ) 1367 die('-1'); 1368 1369 check_ajax_referer( "image_editor-$post_id" ); 1370 1371 include_once( ABSPATH . 'wp-admin/includes/image-edit.php' ); 1372 wp_image_editor($post_id); 1373 1374 die(); 1375 break; 1338 1376 default : 1339 1377 do_action( 'wp_ajax_' . $_POST['action'] );
Note: See TracChangeset
for help on using the changeset viewer.