• Howdy, when using a media offloader to Amazon s3, the image tags load images but their links go to a 404. This is because the link goes to WP’s native media directory instead of the offloaded images on Amazon s3. I’ve tried overriding with functions.php with no luck with the following:

    add_filter( 'pre_option_upload_url_path', function( $upload_url_path ) {
    return 'https://bucket.s3.us-west-1.amazonaws.com';
    });

    I have successfully gotten links to work when modifying wp-content/plugins/meow-gallery/classes/core.php at line 409 within function get_gallery_options adding:

    wp_upload_dir['baseurl'] = 'https://bucket.s3.us-west-1.amazonaws.com';

    Along with modifying line 867 with:

    $wpUploadDir['baseurl'] = 'https://bucket.s3.us-west-1.amazonaws.com';

    Modifying the plugin core of course isn’t ideal. I tried using the attribute override but it seems $atts[‘link’] isn’t supported. Tried with simply image.jpg which doesn’t override:

    add_filter( 'shortcode_atts_gallery', function( $result, $defaults, $atts ) {

    if ( !empty( $atts['link'] ) ) {
    $image_link = $atts['link'];
    $new_link = str_replace("https://site.com/wp-content/uploads","https://bucket.s3.us-west-1.amazonaws.com",$image_link);
    $atts['link'] = $new_link;
    }
    return $atts;
    }, 10, 3 );
Viewing 1 replies (of 1 total)
  • Plugin Support Val Meow

    (@valwa)

    Hey @ljosh! 👋

    Currently, Meow Gallery does not support offloaded media. We will see what we can do about that in a future update.

    Once we support it, you will only need to add your offloaded domain in the settings, and it will work as expected. We will also make sure to provide filters in case you want to customize the behavior more easily.

    Thanks for your patience and understanding! 🙇

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.