Skip to content

Instantly share code, notes, and snippets.

@jessepearson
Created June 18, 2020 14:19
Show Gist options
  • Save jessepearson/068b9591619eef50b1b871dad092e72d to your computer and use it in GitHub Desktop.
Save jessepearson/068b9591619eef50b1b871dad092e72d to your computer and use it in GitHub Desktop.
Attempts to remove all shutdown actions if file is being downloaded via WC.
<?php // only copy this line if needed
/**
* Attempts to remove all shutdown actions if file is being downloaded via WC.
*/
function remove_all_shutdown_actions_20200618() {
remove_all_actions( 'shutdown' );
}
add_action( 'woocommerce_download_file_redirect', 'remove_all_shutdown_actions_20200618', 1 );
add_action( 'woocommerce_download_file_xsendfile', 'remove_all_shutdown_actions_20200618', 1 );
add_action( 'woocommerce_download_file_force', 'remove_all_shutdown_actions_20200618', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment