Created
June 11, 2015 14:41
-
-
Save tomhemsley/c05c662af05c5015ce12 to your computer and use it in GitHub Desktop.
Meta Slider - Amazon S3 CloudFront
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Use wp_get_attachment_url to retrieve the attachment URL | |
* | |
* Important: Resized images created by Meta Slider are not uploaded to s3. | |
* Important: Disable cropping in the slideshow settings to stop Meta Slider from outputting a URL to a file that doesn't exist on S3. | |
*/ | |
function metaslider_s3_cloudfront_url($local_url, $attachment_id) { | |
return wp_get_attachment_url($attachment_id); | |
} | |
add_filter('metaslider_attachment_url', 'metaslider_s3_cloudfront_url', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment