wordpress-cloud-media-offloader-plugin
wordpress-cloud-media-offloader-plugin copied to clipboard
When using root folder, you need to untrailslash line 178 in b2.php
When using root folder with b2, there's an additional trailing slash that breaks the links in the media library. starting at line 171:
return array( 'ID' => $attachment_id, 'filepath' => $filepath, 'filename' => basename( $filepath ), 'url' => wp_get_attachment_url( $attachment_id ), 'subdir' => trim( $uploads['subdir'], DIRECTORY_SEPARATOR ), 'destpath' => $remote_path . untrailingslashit( $uploads['subdir'] ), 'destfile' => $remote_path . untrailingslashit( $uploads['subdir'] ) . basename( $filepath ), // This is the line that went from trail to untrail 'mime_type' => get_post_mime_type( $attachment_id ) );