Skip to content

Instantly share code, notes, and snippets.

@RexAK
RexAK / README.md
Created June 2, 2017 21:29 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

<?php
// put array in here
$array = array (
'key' => 'group_54624ad06f391',
'title' => 'Company List',
'fields' => array (
array (
'key' => 'field_54624aff43237',
'label' => 'Companies',
@RexAK
RexAK / gist:58aa1cd90ba6eb12eada
Created January 22, 2015 18:42
Mandrill "new line to br"
// This will temporarily turn on the nl2br in mandrill for WP's forgot my password link.
function forgotMyPasswordEmails( $nl2br, $message ) {
if ( in_array( 'wp_retrieve_password', $message['tags']['automatic'] ) ) {
$nl2br = true;
}
return $nl2br;
}
add_filter( 'mandrill_nl2br', 'forgotMyPasswordEmails', 10, 2 );
<link rel="stylesheet" href="//contentrepositorydev.devcloud.acquia-sites.com/styles/mitel-embed.css"/>
<!--[if lt IE 9]>
<script src="//contentrepositorydev.devcloud.acquia-sites.com/scripts/es5-shim.js"></script>
<![endif]-->
<script src="//contentrepositorydev.devcloud.acquia-sites.com/scripts/vendor.js"></script>