WP Offload Media compatibility issue
-
Hello,
I’m using WP Offload Media on a website where I offload all media to Amazon S3 and delete the local files to save some server storage.
However with your plugin, I even tried to reupload an avatar picture for a WordPress Author user and on the front-end this is the local image URL that is being output and so there are broken images for author.
I contacted WP Offload Media team and they told me this:The most likely reason for this is “Simple Local Avatars” is not using the WordPress hooks that WP Offload Media requires to rewrite the URLs –
https://deliciousbrains.com/wp-offload-media/doc/developer-guide/#local-to-provider-hooksYou could try and contact the “Simple Local Avatars” authors and see if they could try to implement these wordpress hooks.
Or even use the following filters to rewrite the local URLs into their S3 versions –
https://deliciousbrains.com/wp-offload-media/doc/filtering-urls-in-custom-content/For my own function internal I used their filter and it worked great.
So maybe you can check if the filter exists and use it before returning the avatar picture URL?$image_url = wp_get_attachment_url($image_id); if ( has_filter('as3cf_filter_post_local_to_provider') ) { $image_url = apply_filters( 'as3cf_filter_post_local_to_provider', $image_url ); }
Can you do something for this please?
- The topic ‘WP Offload Media compatibility issue’ is closed to new replies.