Multisite download fix

This commit is contained in:
Mike Jolley 2011-12-07 19:25:35 +00:00
parent e0a0065abb
commit 28d7bb525c
1 changed files with 7 additions and 1 deletions

View File

@ -923,7 +923,13 @@ function woocommerce_download_product() {
if (!is_multisite()) :
$file_path = str_replace(trailingslashit(site_url()), ABSPATH, $file_path);
else :
$upload_dir = wp_upload_dir();
// Try to replace network url
$file_path = str_replace(trailingslashit(network_admin_url()), ABSPATH, $file_path);
// Now try to replace upload URL
$file_path = str_replace($upload_dir['baseurl'], $upload_dir['basedir'], $file_path);
endif;
// See if its local or remote