Skip to content

Instantly share code, notes, and snippets.

View nathansh's full-sized avatar
🏠

Nathan Shubert-Harbison nathansh

🏠
View GitHub Profile
@nathansh
nathansh / dockblock2.php
Created March 31, 2015 20:40
Simple docblock that doesn't return anything
/**
* Prints classes for a custom menu. Prints added class and any passed in class
*
* @param string $item Slug for menu item
* @param string $classes Extra classes to print
* @uses mbt_show_listing_menu_is_current()
*
*/
@nathansh
nathansh / docblock1.php
Last active August 29, 2015 14:18
Basic docblock example with associative array
/**
* Used to print a list of shows in feed format
*
* <code>
* $args = array(
* 'count' => 6, // int
* 'exclude_featured' => false,
* 'exclude_past' => true, // bool
* 'exclude_future' => false, // bool
* 'genre' => false, // show genres to include
<snippet>
<content><![CDATA[
global \$wp_query;
\$query = array(
$1
);
\$args = array_merge(\$wp_query->query_vars, \$query);
\$posts = query_posts(\$args);
]]></content>