Skip to content

Instantly share code, notes, and snippets.

View patrickodacre's full-sized avatar

Patrick O'Dacre patrickodacre

View GitHub Profile
@patrickodacre
patrickodacre / 0_reuse_code.js
Created April 14, 2014 20:37
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
@patrickodacre
patrickodacre / bower.json
Created July 10, 2015 14:21
heisenberg - Zeek Interactive Starter Theme
{
"name": "heisenberg",
"version": "0.0.1",
"authors": [
"Jacob Arriola <jacob@zeek.com>",
"Steve Zehngut <steve@zeek.com>",
"David Arceneaux <david@zeek.com>"
],
"description": "WordPress starter theme",
"keywords": [
add_action('wp_loaded','webendev_register_nav_menu_class');
/**
* New walker class to extend Walker_Nav_Menu
* Dynamically adds child categories to menu
*
*/
function webendev_register_nav_menu_class(){
class Submenu_Walker_Nav_Menu extends Walker_Nav_Menu {
1. call_user_func_array passes the callback function an array of parameters.
2. $args = func_get_args();
2a.
array (size=3)
0 => string 'This is Episode Number' (length=22)
1 => int 4
2 =>
@patrickodacre
patrickodacre / know_the_code_show_pt_2_ep_5
Created July 22, 2015 17:13
Know the Code Show - Part 2, Ep 5
1.
array (size=2)
'function' => string '_config_wp_siteurl' (length=18)
'accepted_args' => int 1
@patrickodacre
patrickodacre / know_the_code_show_pt_2_ep_5
Created July 22, 2015 17:13
Know the Code Show - Part 2, Ep 5
1.
array (size=2)
'function' => string '_config_wp_siteurl' (length=18)
'accepted_args' => int 1
1.
array (size=2)
'function' => string '_config_wp_siteurl' (length=18)
'accepted_args' => int 1
2. a - an array comprising the argument list / the variables - as declared at the time of creating the filter. A dev can declare as many variables as he wants.
b. $arg stores the arguments / the variables declared when a developer uses the apply_filters function. It has to store the arguments assigned to that $tag.
Code Challenge 1
<?php
/**
* Config file for registering custom post types.
*
* This is an array of custom post types and the common settings
* each cpt is to share. If each cpt is to have unique settings
* ( ie: some with archives and others without ) then you can
* add those keys and values to the main arrays, omitting the
* settings array completely.
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20150227
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
<?php namespace POD_Core\Config;
use InvalidArgumentException;
use RuntimeException;
class ArrayConfig implements I_Config {
protected $config;