wp_ajax_imgedit_preview

Ajax handler for image editor previews.

Description

wp_ajax_imgedit_preview(); 

Usage

  1. if ( !function_exists( 'wp_ajax_imgedit_preview' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/ajax-actions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_ajax_imgedit_preview(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/ajax-actions.php  
  1. function wp_ajax_imgedit_preview() { 
  2. $post_id = intval($_GET['postid']); 
  3. if ( empty($post_id) || !current_user_can('edit_post', $post_id) ) 
  4. wp_die( -1 ); 
  5.  
  6. check_ajax_referer( "image_editor-$post_id" ); 
  7.  
  8. include_once( ABSPATH . 'wp-admin/includes/image-edit.php' ); 
  9. if ( ! stream_preview_image($post_id) ) 
  10. wp_die( -1 ); 
  11.  
  12. wp_die();