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

@ -920,10 +920,16 @@ function woocommerce_download_product() {
if (!$file_path) exit; if (!$file_path) exit;
if (!is_multisite()) : if (!is_multisite()) :
$file_path = str_replace(trailingslashit(site_url()), ABSPATH, $file_path); $file_path = str_replace(trailingslashit(site_url()), ABSPATH, $file_path);
else : else :
$upload_dir = wp_upload_dir();
// Try to replace network url
$file_path = str_replace(trailingslashit(network_admin_url()), ABSPATH, $file_path); $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; endif;
// See if its local or remote // See if its local or remote