Skip to content

Instantly share code, notes, and snippets.

@adamsilverstein
Created February 11, 2017 23:43
Show Gist options
  • Save adamsilverstein/e5e3a19c60a96e9503cceba013c2ff2b to your computer and use it in GitHub Desktop.
Save adamsilverstein/e5e3a19c60a96e9503cceba013c2ff2b to your computer and use it in GitHub Desktop.
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