mansj / enable-media-replace

***DEVELOPMENT DISCONTINUED*** Enable Media Replace, a WordPress plugin to make it possible to replace uploaded media files in a simple way.
GNU General Public License v2.0
28 stars 27 forks source link

Allow other plugins to control the $unfiltered passed to get_attached_file() #15

Closed polevaultweb closed 9 years ago

polevaultweb commented 9 years ago

Some background: Our plugin https://wordpress.org/plugins/amazon-s3-and-cloudfront/ allows users to copy files to S3 and gives the option to remove the local files from the server. This becomes problematic for other plugins that use get_attached_file(), as it no longer exists. However, we hook into get_attached_file() when necessary to copy back the file to the server so certain plugins use it.

At the moment your plugin tells get_attached_file() to NOT filter the result by passing true to the $unfiltered parameter, therefore we can't grab it from S3 and the replace process breaks down. We have a number of users using both plugins so it would be great to get this in :)

mansj commented 9 years ago

Thank you, I've tested it and it seems to work fine, so it will make the next release.