wp_ajax_crop_image_pre_save хук-событиеWP 4.3.0

Fires before a cropped image is saved.

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

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

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(строка)
The Customizer control requesting the cropped image.
$attachment_id(int)
The attachment ID of the original image.
$cropped(строка)
Path to the cropped image file.

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

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

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

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 );

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

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