Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi there,

    I think some s3 plugins would automatically replace the URL for you (meta slider uses built in functions to get the URLs to images, so other plugins should be able to filter those functions to automatically update the URL), but if that isn’t the case then there are 2 options:

    1. Meta Slider PRO only – Use the External URL Slide type – with these you can enter the direct URL to the image on s3

    2. Add a filter to your themes functions.php file. See this page for more details: https://www.metaslider.com/documentation/metaslider_resized_image_url/. You would need to do a string replace on your current URL to the S3 url.

    Thanks,
    Dave

    Thread Starter prolab

    (@prolab)

    Thank U! I will try to use the filter to solve this problem

    Matcha Labs
    I have found that if you make the following changes to ml_slider/inc/metaslider.imagehelper.class to have ml_slider work with S3 and CloudFront plugin.
    From:

    $this->id = $slide_id;
    $this->url = $upload_dir['baseurl'] . "/" . get_post_meta( $slide_id, '_wp_attached_file', true );
    $this->path = get_attached_file( $slide_id );

    To:

    $this->id = $slide_id;
    $this->url = wp_get_attachment_url($slide_id);
    $this->path = get_attached_file( $slide_id );
    apply_filters('get_attached_file', $this->path, $slide_id);

    Is there an easy way to handle this in functions.php instead of in the plugin’s code? It looks like the S3 and Cloudfront plugin uses wp_get_attachment_url to load the proper URL.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘metaslider with s3 cloudfront plugin’ is closed to new replies.