Skip to content

Instantly share code, notes, and snippets.

@wplaunchify
wplaunchify / wait-el.js
Created November 23, 2019 15:09 — forked from chrisjhoughton/wait-el.js
Wait for an element to exist on the page with jQuery
var waitForEl = function(selector, callback) {
if (jQuery(selector).length) {
callback();
} else {
setTimeout(function() {
waitForEl(selector, callback);
}, 100);
}
};
@wplaunchify
wplaunchify / benchmark-to-trigger.php
Created August 20, 2019 16:36
Change BenchMark To Trigger (or any other word) in Groundhogg.io
add_filter( 'gettext', 'lab_translate' );
function lab_translate( $translated ) {
$original = array(
// 'original word' = > 'your new translated word'
'Benchmark' => 'Trigger',
);
$translated = str_ireplace( array_keys($original), $original, $translated );
return $translated;