I hereby claim:
- I am andrew-womeldorf on github.
- I am andrewwomeldorf (https://keybase.io/andrewwomeldorf) on keybase.
- I have a public key ASCBXGHd1NrGZILAkalLxxmcPnD8SOPaLJaas665OrmDdgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
$string = "<span class='tooltip-trigger' data-tooltip='[{\"code\":\"XXXXXXX\",\"isTruthy\":false,\"body\":\"Blah blah blah blah, blah blah blah.\"}]'><span class='nested'>*</span></span>"; | |
preg_match_all("/\{(?:[^{}]|(?R))*\}/", $string, $matches); | |
var_dump($matches); |
/* make_ajax_call( data ) | |
* Very very boiled down AJAX call to replace jQuery | |
* Can use as a starter for future needs | |
* data is a json object | |
*/ | |
function prepareData( data ){ | |
var encodedArray = new Array(); | |
for( key in data ){ | |
encodedArray.push(encodeURIComponent( key ) + "=" + encodeURIComponent( data[key] ) ); |
// Async & Defer on selected scripts | |
// This could (should, probably) be broken out into two functions, but since I want both all the time, I'm just combining them | |
function add_async_and_defer( $tag, $handle ){ | |
// Add handles used in either wp_register_script or wp_enqueue_script | |
$scripts_to_async_and_defer = array( | |
'google_maps' | |
); | |
foreach( $scripts_to_async_and_defer as $async_and_defer_script ){ | |
if( $async_and_defer_script === $handle ){ |
add_action('save_post', 'assign_parent_terms', 10, 2); | |
function assign_parent_terms( $post_id, $post ){ | |
$terms = wp_get_post_terms($post_id, 'category' ); | |
foreach($terms as $term){ | |
while($term->parent != 0 && !has_term( $term->parent, 'category', $post )){ | |
wp_set_post_terms($post_id, array($term->parent), 'category', true); | |
$term = get_term($term->parent, 'category'); | |
} | |
} | |
} |
//░░░░░░░░░░░░░░░░░░░░░░░░ | |
// | |
// DIRECTORY | |
// | |
// _Requires | |
// _Configuration | |
// _CSS | |
// _JS | |
// _BrowserSync | |
// _Watch |
module.exports = { | |
browserSync : { | |
proxy : '.dev', | |
notify : false, | |
port : 3000, | |
tunnel : null, | |
scrollRestoreTechnique : 'cookie' | |
} | |
} |
// show_hooks_except to show all except what is in array | |
// show_hooks_including to search for specific hooks | |
// can use RegExp | |
add_action( 'all', 'show_hooks_between' ); | |
// echo all hooks except those that match the regexps in the array | |
function show_hooks_except() { | |
$do_not_see = array( | |
'gettext', | |
'locale', |
<?php | |
define('DB_NAME', ''); | |
define('DB_USER', ''); | |
define('DB_PASSWORD', ''); | |
define('DB_HOST', ''); | |
define('WP_HOME', 'http://.dev'); | |
define('WP_SITEURL', 'http://.dev'); |
<?php | |
define('AUTH_KEY', ''); | |
define('SECURE_AUTH_KEY', ''); | |
define('LOGGED_IN_KEY', ''); | |
define('NONCE_KEY', ''); | |
define('AUTH_SALT', ''); | |
define('SECURE_AUTH_SALT', ''); | |
define('LOGGED_IN_SALT', ''); | |
define('NONCE_SALT', ''); | |
$table_prefix = 'af_'; |