diff --git a/includes/admin/class-wc-admin-post-types.php b/includes/admin/class-wc-admin-post-types.php index 386651e2290..56a82e6cf8a 100644 --- a/includes/admin/class-wc-admin-post-types.php +++ b/includes/admin/class-wc-admin-post-types.php @@ -769,11 +769,11 @@ class WC_Admin_Post_Types { $pathdata['url'] = $pathdata['url'] . '/woocommerce_uploads'; $pathdata['subdir'] = '/woocommerce_uploads'; } else { - $new_subdir = '/woocommerce_uploads' . $uploads['subdir']; + $new_subdir = '/woocommerce_uploads' . $pathdata['subdir']; - $uploads['path'] = str_replace( $uploads['subdir'], $new_subdir, $uploads['path'] ); - $uploads['url'] = str_replace( $uploads['subdir'], $new_subdir, $uploads['url'] ); - $uploads['subdir'] = str_replace( $uploads['subdir'], $new_subdir, $uploads['subdir'] ); + $pathdata['path'] = str_replace( $pathdata['subdir'], $new_subdir, $pathdata['path'] ); + $pathdata['url'] = str_replace( $pathdata['subdir'], $new_subdir, $pathdata['url'] ); + $pathdata['subdir'] = str_replace( $pathdata['subdir'], $new_subdir, $pathdata['subdir'] ); } } return $pathdata;