Code-Snippets-Functions/Execute a function on a child site/WooCommerce/change-free-download-filename.txt

7 lines
232 B
Text

add_filter('woocommerce_file_download_filename', 'custom_download_filename',
10, 2);
function custom_download_filename($filename, $product_id) {
// You can replace "free download" with any text you want.
return 'free download';
}