Multisite download fix
This commit is contained in:
parent
e0a0065abb
commit
28d7bb525c
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue