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
# Bypass oEmbed sandbox for store links, add UTM params into the summary card | |
add_filter( 'pre_oembed_result', 'add_utm_params_to_barstool_store', PHP_INT_MAX, 3 ); | |
function add_utm_params_to_barstool_store ( $result, $url, $args ) { | |
if ( strpos($url, 'https://store.barstoolsports.com') !== false && strpos($url, 'utm_') === false ) { | |
$api_key = trim( get_site_option( 'iframely_api_key' ) ); | |
$link = $url; | |
$link = add_query_arg( array( | |
'utm_source' => 'barstoolsports', |
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
function exec_body_scripts(body_el) { | |
function nodeName(elem, name) { | |
return elem.nodeName && elem.nodeName.toUpperCase() === | |
name.toUpperCase(); | |
} | |
function evalScript(elem) { | |
var data = (elem.text || elem.textContent || elem.innerHTML || "" ), | |
script = document.createElement("script"); |
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
<script type="text/javascript"> | |
function loadIframelyEmbedJs() { | |
// Replace 'iframe.ly' with your custom CDN if available. | |
if (document.querySelectorAll("[data-iframely-url]").length === 0 | |
&& document.querySelectorAll("iframe[src*='iframe.ly']").length === 0) return; | |
var iframely = window.iframely = window.iframely || {}; | |
if (iframely.load) { | |
iframely.load(); | |
} else { | |
var ifs = document.createElement('script'); ifs.type = 'text/javascript'; ifs.async = true; |
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
var receiveMessage = function(callback) { | |
function cb(e) { | |
var message; | |
try { | |
message = JSON.parse(e.data); | |
} catch (ex) { | |
} | |
callback(e, message); |
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
<script> | |
var iframely = window.iframely = window.iframely || {}; | |
var widgets = iframely.widgets = iframely.widgets || {}; | |
function iframelyLoaded() { | |
iframely.events.on('heightChanged', function(iframe, oldHeight, newHeight) { | |
// your handler here, like | |
// adjustScroll(newHeight - oldHeight); | |
// iframe is a dom element, heights are numbers |
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
<script type="text/javascript"> | |
function loadIframelyEmbedJs() { | |
var iframely = window.iframely = window.iframely || {}; | |
var widgets = iframely.widgets = iframely.widgets || {}; | |
if (widgets.load) { | |
widgets.load(); | |
} else { | |
var ifs = document.createElement('script'); ifs.type = 'text/javascript'; ifs.async = true; | |
ifs.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//cdn.iframe.ly/embed.js'; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ifs, s); |
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
<style> | |
.centering-fullwidth { | |
width: 100%; | |
} | |
.constraint-container { | |
width: 500px; | |
margin: auto; | |
} | |
</style> |
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
<style> | |
.centering-fullwidth { | |
width: 100%; | |
-webkit-justify-content: center; | |
-ms-flex-pack: center; | |
justify-content: center; | |
display: -webkit-flex; | |
display: -ms-flexbox; | |
display: flex; | |
} |
NewerOlder