wp_ajax_crop_image_pre_save

ACTION wp-admin\includes\ajax-actions.php (ligne 4079) github
Fires before a cropped image is saved. Allows to add filters to modify the way a cropped image is saved.

Paramètres

Entrée :
$context, $attachment_id, $cropped
Sortie :
@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.

Utilisation

// Ajouter une fonction au hook action 'wp_ajax_crop_image_pre_save'
add_action('wp_ajax_crop_image_pre_save', 'ma_fonction_personnalisee', 10, 1);

function ma_fonction_personnalisee($context, $attachment_id, $cropped) {
    // Votre code ici
    error_log('Hook wp_ajax_crop_image_pre_save déclenché');
}

Actualités

Chargement des actualités...