Skip to content

Instantly share code, notes, and snippets.

@danieliser
Created September 16, 2015 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danieliser/c395e43281c1cf550987 to your computer and use it in GitHub Desktop.
Save danieliser/c395e43281c1cf550987 to your computer and use it in GitHub Desktop.
<?php
add_action('wp_footer', 'my_custom_popup_scripts', 500 );
function my_custom_popup_scripts() { ?>
<script type="text/javascript">
jQuery('#popmake-123')
.on('popmakeBeforeOpen', function () {
var $iframe = jQuery('iframe', jQuery(this)),
src = $iframe.prop('src');
$iframe.prop('src', '').prop('src', src + '/?autoplay=1');
})
.on('popmakeBeforeClose', function () {
var $iframe = jQuery('iframe', jQuery(this)),
src = $iframe.prop('src');
$iframe.prop('src', '').prop('src', src.replace('/?autoplay=1', ''));
});
</script><?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment