Code-Snippets-Functions/Execute a function on a child site/WooCommerce/add-custom-download-file-my-account.txt

10 lines
360 B
Text

add_filter( 'woocommerce_customer_get_downloadable_products', 'wc_add_custom_default_download', 9999, 1 );
function wc_add_custom_default_download( $downloads ) {
$downloads[] = array(
'product_name' => 'Description',
'download_name' => 'Button Label',
'download_url' => '/wp-content/uploads/filename.pdf',
);
return $downloads;
}