Skip to content

Instantly share code, notes, and snippets.

@selul
Last active February 26, 2023 16:50
Show Gist options
  • Save selul/7b98188cb0c9d5dd0846493953fc33c2 to your computer and use it in GitHub Desktop.
Save selul/7b98188cb0c9d5dd0846493953fc33c2 to your computer and use it in GitHub Desktop.
Add exif to Optimole
<?php
/*
* Plugin Name: Optimole Tweak - Add exif data.
* Version: 0.0.1
*/
add_filter( 'optml_replace_image', 'opml_add_exif', 99 );
add_filter( 'optml_content_url', 'opml_add_exif', 99 );
function opml_add_exif( $url ) {
if ( strpos( $url, 'sm:1' ) !== false ) {
return $url;
}
return str_replace( '/w:', '/sm:1/w:', $url );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment