woocommerce_download_file_force

ACTION woocommerce\includes\class-wc-download-handler.php (ligne 356) github
Fallback on force download method for remote files. This is because: 1. xsendfile needs proxy configuration to work for remote files, which cannot be assumed to be available on most hosts. 2. Force download method is more secure than redirect method if `allow_url_fopen` is enabled in `php.ini`.

Paramètres

Entrée :
$file_path, $filename
Sortie :
N/A

Utilisation

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

function ma_fonction_personnalisee($file_path, $filename) {
    // Votre code ici
    error_log('Hook woocommerce_download_file_force déclenché');
}

Actualités

Chargement des actualités...