mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +00:00
Image editing (first run). Includes code by stephanreiter, see #10528
git-svn-id: https://develop.svn.wordpress.org/trunk@11911 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -111,6 +111,19 @@ case 'wp-compression-test' :
|
||||
|
||||
die('0');
|
||||
break;
|
||||
case 'load-preview-image' :
|
||||
$post_id = intval($_GET['postid']);
|
||||
if ( empty($post_id) || !current_user_can('edit_post', $post_id) )
|
||||
die('-1');
|
||||
|
||||
check_ajax_referer( "image_editor-$post_id" );
|
||||
|
||||
include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
|
||||
if ( !stream_preview_image($post_id) )
|
||||
die('-1');
|
||||
|
||||
die();
|
||||
break;
|
||||
default :
|
||||
do_action( 'wp_ajax_' . $_GET['action'] );
|
||||
die('0');
|
||||
@@ -1333,6 +1346,31 @@ case 'save-widget' :
|
||||
if ( $form = $wp_registered_widget_controls[$widget_id] )
|
||||
call_user_func_array( $form['callback'], $form['params'] );
|
||||
|
||||
die();
|
||||
break;
|
||||
case 'image-edit-save':
|
||||
// $post_id is the attachment ID
|
||||
$post_id = intval($_POST['postid']);
|
||||
if ( empty($post_id) || !current_user_can('edit_post', $post_id) )
|
||||
die('-1');
|
||||
|
||||
check_ajax_referer( "image_editor-$post_id" );
|
||||
|
||||
include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
|
||||
$msg = wp_save_image($post_id);
|
||||
|
||||
die($msg);
|
||||
break;
|
||||
case 'open-image-editor' :
|
||||
$post_id = intval($_POST['postid']);
|
||||
if ( empty($post_id) || !current_user_can('edit_post', $post_id) )
|
||||
die('-1');
|
||||
|
||||
check_ajax_referer( "image_editor-$post_id" );
|
||||
|
||||
include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
|
||||
wp_image_editor($post_id);
|
||||
|
||||
die();
|
||||
break;
|
||||
default :
|
||||
|
||||
Reference in New Issue
Block a user