Changeset 11965 for trunk/wp-admin/admin-ajax.php
- Timestamp:
- 09/24/2009 01:54:07 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r11911 r11965 112 112 die('0'); 113 113 break; 114 case ' load-preview-image' :114 case 'imgedit-preview' : 115 115 $post_id = intval($_GET['postid']); 116 116 if ( empty($post_id) || !current_user_can('edit_post', $post_id) ) … … 1349 1349 die(); 1350 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 1351 case 'image-editor': 1352 $attachment_id = intval($_POST['postid']); 1353 if ( empty($attachment_id) || !current_user_can('edit_post', $attachment_id) ) 1354 die('-1'); 1355 1356 check_ajax_referer( "image_editor-$attachment_id" ); 1359 1357 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 1358 1359 $msg = false; 1360 switch ( $_POST['do'] ) { 1361 case 'save' : 1362 $msg = wp_save_image($attachment_id); 1363 $msg = json_encode($msg); 1364 die($msg); 1365 break; 1366 case 'scale' : 1367 $msg = wp_save_image($attachment_id); 1368 break; 1369 case 'restore' : 1370 $msg = wp_restore_image($attachment_id); 1371 break; 1372 } 1373 1374 wp_image_editor($attachment_id, $msg); 1374 1375 die(); 1375 1376 break;
Note: See TracChangeset
for help on using the changeset viewer.