Change the displayed filename for downloads in WooCommerce

Change the displayed filename for downloads in WooCommerce .

Snippet Type

Execute on Child Sites

Snippet

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';
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.