Created
February 11, 2017 23:43
-
-
Save adamsilverstein/e5e3a19c60a96e9503cceba013c2ff2b to your computer and use it in GitHub Desktop.
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
For reference, here's how I'm doing it now: | |
``` | |
add_filter( 'oembed_request_post_id', function( $post_id, $url ) { | |
if( is_my_gallery_page() ) { | |
add_filter( 'post_embed_url', function( $embed_url ) use ($url) { | |
remove_filter( current_filter(), __FUNCTION__ ); | |
$url = explode("?",$url); | |
$embed_url = $embed_url."?".$url[1]; | |
return $embed_url; | |
}); | |
} | |
return $post_id; | |
}, 10, 2 ); | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment