This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------- | |
# .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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. | |
array (size=2) | |
'function' => string '_config_wp_siteurl' (length=18) | |
'accepted_args' => int 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. | |
array (size=2) | |
'function' => string '_config_wp_siteurl' (length=18) | |
'accepted_args' => int 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace PrefixCore\Support; | |
/** | |
* Load the specified config file. | |
* | |
* @since 1.0.0 | |
* | |
* @param string $config_file Config filename with extension. | |
* @param string $path Config path. Defaults to plugin config folder. | |
* @returns array Returns the configuration array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace PrefixCore\Admin; | |
/** | |
* Add metabox and fields to a theme options page. | |
* | |
* Replace the add_options_page_metabox method with what you see below. | |
* Obviously, you'll want to update the namespace, constant and config path | |
* to suit your situation. | |
* | |
* @link https://github.com/WebDevStudios/CMB2-Snippet-Library/blob/master/options-and-settings-pages/theme-options-cmb.php |
OlderNewer