wp_ajax_imgedit_preview() WordPress Function

wp_ajax_imgedit_preview() is a Wordpress function that allows you to preview an image before you save it. This is useful if you want to make sure that the image is exactly what you want it to be.

wp_ajax_imgedit_preview() #

Ajax handler for image editor previews.


Source

File: wp-admin/includes/ajax-actions.php

function wp_ajax_imgedit_preview() {
	$post_id = (int) $_GET['postid'];
	if ( empty( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) {
		wp_die( -1 );
	}

	check_ajax_referer( "image_editor-$post_id" );

	include_once ABSPATH . 'wp-admin/includes/image-edit.php';

	if ( ! stream_preview_image( $post_id ) ) {
		wp_die( -1 );
	}

	wp_die();
}


Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More