wp_ajax_cropped_attachment_id filter-hookWP 4.3.0

Filters the attachment ID for a cropped image.

Usage

add_filter( 'wp_ajax_cropped_attachment_id', 'wp_kama_ajax_cropped_attachment_id_filter', 10, 2 );

/**
 * Function for `wp_ajax_cropped_attachment_id` filter-hook.
 * 
 * @param int    $attachment_id The attachment ID of the cropped image.
 * @param string $context       The Customizer control requesting the cropped image.
 *
 * @return int
 */
function wp_kama_ajax_cropped_attachment_id_filter( $attachment_id, $context ){

	// filter...
	return $attachment_id;
}
$attachment_id(int)
The attachment ID of the cropped image.
$context(string)
The Customizer control requesting the cropped image.

Changelog

Since 4.3.0 Introduced.

Where the hook is called

wp_ajax_crop_image()
wp_ajax_cropped_attachment_id
wp-admin/includes/ajax-actions.php 4100
$attachment_id = apply_filters( 'wp_ajax_cropped_attachment_id', $attachment_id, $context );

Where the hook is used in WordPress

Usage not found.