Notify 3rd party code of exceptions when deleting a completed action older than the retention period This hook provides a way for 3rd party code to log or otherwise handle exceptions relating to their actions.
$action_id, $e, $lifespan, count( $actions_to_delete
Sortie :
@param int $action_id The scheduled actions ID in the data store @param Exception $e The exception thrown when attempting to delete the action from the data store @param int $lifespan The retention period, in seconds, for old actions @param int $count_of_actions_to_delete The number of old actions being deleted in this batch
// Ajouter une fonction au hook action 'action_scheduler_failed_{$context}_action_deletion'
add_action('action_scheduler_failed_{$context}_action_deletion', 'ma_fonction_personnalisee', 10, 1);
function ma_fonction_personnalisee($action_id, $e, $lifespan, count( $actions_to_delete) {
// Votre code ici
error_log('Hook action_scheduler_failed_{$context}_action_deletion déclenché');
}
Chargement des actualités...