Skip to content

Instantly share code, notes, and snippets.

View cyberhobo's full-sized avatar

Dylan Kuhn cyberhobo

View GitHub Profile
@cyberhobo
cyberhobo / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
// First, read the reads
$materials = wp_get_post_terms( get_the_ID(), 'acme_materials' );
$child_count = array_reduce( $materials, function( $count, $material ) {
return $count + count( get_term_children( $material->term_id, 'acme_materials' ) );
});
if ( $child_count > 0 ) {
// Some term has children
} else {