Skip to content

Instantly share code, notes, and snippets.

View samuraijane's full-sized avatar

Matthew Day samuraijane

View GitHub Profile
@samuraijane
samuraijane / WP Output for <li>
Created March 23, 2015 19:57
This code defines the output for <li> in version 4.1. I researched this to figure out how to override the ID and classes that WP assigns to menu items contained in an <li>. One solution is to write your own walker to override this. Another is to simply delete the output parameters in line 15 (although this is a bad idea). See wp-includes/nav-men…
/**
* Filter the ID applied to a menu item's list item element.
*
* @since 3.0.1
* @since 4.1.0 The `$depth` parameter was added.
*
* @param string $menu_id The ID that is applied to the menu item's `<li>` element.
* @param object $item The current menu item.
* @param array $args An array of {@see wp_nav_menu()} arguments.
* @param int $depth Depth of menu item. Used for padding.
@samuraijane
samuraijane / 0_reuse_code.js
Last active August 29, 2015 14:17
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