SEE DOC https://gist.github.com/kolbaba/5c9b112ffc3db9e4b3648eae8b655f11
newly added
console.table((function listAllEventListeners() { | |
const allElements = Array.prototype.slice.call(document.querySelectorAll('*')); | |
allElements.push(document); // we also want document events | |
const types = []; | |
for (let ev in window) { | |
if (/^on/.test(ev)) types[types.length] = ev; | |
} | |
let elements = []; | |
for (let i = 0; i < allElements.length; i++) { |
<?php | |
# Turn on Caching | |
#define('WP_CACHE', true); | |
# Set the Memory Limit | |
#define('WP_MEMORY_LIMIT', '64M'); | |
# Development Table prefix | |
#$table_prefix = 'dev_'; |
<?php | |
/** | |
* == About this Gist == | |
* | |
* Code to add to wp-config.php to enhance information available for debugging. | |
* | |
* You would typically add this code below the database, language and salt settings | |
* | |
* Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists). | |
* |
<?php | |
// basic idea here is a common function to pass a parent page ID | |
// and get back an array of it and its child page IDs only | |
function getChildPageIDs( $id ) { | |
$child_pages = get_pages('child_of='.$id); | |
$ids_to_remove = array($id); // we want to remove parent id too | |
foreach($child_pages as $child) { | |
array_push($ids_to_remove,$child->ID); // for every child add the id into array | |
} |
<?php | |
/** | |
* Log any errors for debugging. | |
* | |
* @global WP_DEBUG | |
* @uses error_log | |
* @var string|array $message the error message (a string or array) | |
*/ | |
if( !function_exists( 'jdn_log_me' ) ) { | |
function jdn_log_me( $message ) { |
<?php | |
/** | |
* Apply shortcodes to custom field output | |
* | |
* @author Joshua David Nelson, [email protected] | |
*/ | |
$custom_field_output = 'some text with a [shortcode]'; | |
add_filter( 'custom_field', 'do_shortcode' ); | |
$custom_field_output = apply_filters( 'custom_field', $custom_field_output ); |