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"> | |
document.addEventListener('om.Dtr.init', function(event) { | |
/** | |
* API method for setting a custom variable. Must be accessed via the Dtr object. | |
* | |
* @param string $key The custom variable key to set. | |
* @param string $value The custom variable value to set for the key. | |
* @return null | |
*/ | |
event.detail.Dtr.setCustomVariable('foo', 'bar'); |
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 (qs) { | |
var query = (qs || window.location.search).substring(1), | |
bits = query ? query.split('&').map(function (params) { | |
var p = params.split('=') | |
return [ p[0], p[1] ? decodeURIComponent(p[1]) : p[1] ] | |
}) : [], | |
index = -1, | |
result = {}, | |
pair |
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
<?php | |
/* | |
* Plugin Name: WP Forms to OptinMonster | |
* Plugin URI: http://optinmonster.com | |
* Description: Automatically trigger an OptinMonster form to show, filled out, when an WP Form is submitted. | |
* Version: 0.1.0 | |
* Author: Justin Sternberg | |
* Author URI: http://optinmonster.com | |
*/ |
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"> | |
document.addEventListener('om.Campaign.load', function(event) { | |
var slug = event.detail.Campaign.id; | |
var images = document.querySelectorAll('#om-' + slug + ' img'); | |
if ( images ) { | |
images.forEach(function(el) { | |
el.setAttribute('data-pin-nopin', 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
<?php | |
/** | |
* Registers a new post type | |
* @uses $wp_post_types Inserts new post type object into the list | |
* | |
* @param string Post type key, must not exceed 20 characters | |
* @param array|string See optional args description above. | |
* @return object|WP_Error the registered post type object, or an error object | |
*/ |
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
<?php | |
function filter_om_campaigns_by_name( $campaigns, $save ) { | |
// Make sure this is the refresh request and that we have data. | |
if ( ! isset( $campaigns->success ) && ! empty( $campaigns ) ) { | |
// Loop through the campaigns | |
foreach ( (array) $campaigns as $slug => $campaign ) { |
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
<pre> | |
```````````````````````````````````````````````````````````````````````````````````````````````````` | |
```````````````````````````````````````````````````````````````````````````````````````````````````` | |
```````````````````````````````````````````````````````````````````````````````````````````````````` | |
```````````````````````````````````````````````````````````````````````````````````````````````````` | |
```````````````````````````````````````````````````````````````````````````````````````````````````` | |
```````````````````````````````````````````````````````````````````````````````````````````````````` | |
```````````````````````````````````````````````````````````````````````````````````````````````````` | |
```````````````````````````````````````````````````````````````````````````````````````````````````` |
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> | |
document.addEventListener('om.Optin.init.submit', function( evt ) { | |
// Only do this for a specific campaign | |
if ( '<slug>' !== evt.detail.Campaign.id ) { | |
return; | |
} | |
var meta = { products_form: jQuery(document.forms.products_form).serialize() }; |
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
<?php | |
add_action( 'admin_init', function() { | |
$exists = get_term_by( 'slug', 'xpp', $taxonomy ); | |
if ( empty( $exists ) ) { | |
$result = wp_insert_term( 'X++', 'languages', array( 'slug' => 'xpp' ) ); | |
wp_die( '<xmp>'. __LINE__ .') $result: '. print_r( $result, true ) .'</xmp>', 'Debug' ); | |
} | |
wp_die( '<xmp>'. __LINE__ .') $exists: '. print_r( $exists, true ) .'</xmp>', 'Debug' ); | |
} ); |
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
clear(); | |
var cdSettings = { | |
debug: true, | |
evt: null, | |
audio: null, | |
audioUrl: 'https://jtsternberg.com/file-drop/analog-watch-alarm_daniel-simion.mp3', | |
secondsLeft: 0, | |
timeLeft: 0, | |
log: true, | |
alarming: false, |