wp_ajax_crop_image_pre_save action-hookWP 4.3.0

Fires before a cropped image is saved.

Allows to add filters to modify the way a cropped image is saved.

Usage

add_action( 'wp_ajax_crop_image_pre_save', 'wp_kama_ajax_crop_image_pre_save_action', 10, 3 );

/**
 * Function for `wp_ajax_crop_image_pre_save` action-hook.
 * 
 * @param string $context       The Customizer control requesting the cropped image.
 * @param int    $attachment_id The attachment ID of the original image.
 * @param string $cropped       Path to the cropped image file.
 *
 * @return void
 */
function wp_kama_ajax_crop_image_pre_save_action( $context, $attachment_id, $cropped ){

	// action...
}
$context(string)
The Customizer control requesting the cropped image.
$attachment_id(int)
The attachment ID of the original image.
$cropped(string)
Path to the cropped image file.

Changelog

Since 4.3.0 Introduced.

Where the hook is called

wp_ajax_crop_image()
wp_ajax_crop_image_pre_save
wp-admin/includes/ajax-actions.php 4064
do_action( 'wp_ajax_crop_image_pre_save', $context, $attachment_id, $cropped );

Where the hook is used in WordPress

Usage not found.