Last active
February 26, 2023 16:50
-
-
Save selul/7b98188cb0c9d5dd0846493953fc33c2 to your computer and use it in GitHub Desktop.
Add exif to Optimole
This file contains 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
<?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