wp_ajax_cropped_attachment_id хук-фильтрWP 4.3.0

Filters the attachment ID for a cropped image.

Использование

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(строка)
The Customizer control requesting the cropped image.

Список изменений

С версии 4.3.0 Введена.

Где вызывается хук

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

Где используется хук в WordPress

Использование не найдено.