Created
July 21, 2012 21:15
-
-
Save gyrus/3157207 to your computer and use it in GitHub Desktop.
Fix height of Flickr slideshows embedded in WordPress
This file contains hidden or 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 | |
| /** | |
| * Fix height of embedded Flickr slideshows | |
| */ | |
| add_filter( 'oembed_result', 'pilau_fix_flickr_slideshow_height', 10, 3 ); | |
| function pilau_fix_flickr_slideshow_height( $html, $url, $args ) { | |
| if ( strpos( $url, "flickr.com" ) !== false && substr( $url, -6 ) == "/show/" ) | |
| $html = preg_replace( '/ height="([^"]+)"/', ' height="350"', $html ); | |
| return $html; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment