Skip to content

Instantly share code, notes, and snippets.

View Zackio's full-sized avatar

Zackary Allnutt Zackio

View GitHub Profile
<?php
/**
* Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
* @author Weston Ruter (@westonruter), X-Team
*/
add_action( 'init', array( 'XTeam_Nav_Menu_Item_Custom_Fields', 'setup' ) );
class XTeam_Nav_Menu_Item_Custom_Fields {
static $options = array(
@Zackio
Zackio / 0_reuse_code.js
Created January 1, 2014 12:10
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
@Zackio
Zackio / Javascipt: Insert string into url
Created November 25, 2013 20:41
Javascipt: Insert string into url
var lastSlash = url.lastIndexOf('/') +1;
var firstSect = url.substring( 0, lastSlash );
var endSect = url.substring( lastSlash, url.length );
url = firstSect + 'full_screen_preview/' + endSect;
@Zackio
Zackio / Javascipt: Split big arrays to smaller
Created November 25, 2013 20:38
Javascipt: Split big arrays to smaller
var splitArray = [];
while(yourArray.length) {
splitArray.push( yourArray.splice(0,10) );
}