Skip to content

Instantly share code, notes, and snippets.

View brichards's full-sized avatar

Brian Richards brichards

View GitHub Profile
@brichards
brichards / functions.php
Created January 8, 2013 15:07
Layout Override
<?php
// Force a one column layout if the user is not logged in
add_filter( 'get_theme_layout', 'my_layout_override' );
function my_layout_override( $layout ) {
if ( ! is_user_logged_in() )
$layout = 'layout-one-col';
return $layout;
@brichards
brichards / functions.php
Created January 8, 2013 22:21
Remove SB Options Menu
add_action( 'admin_init', 'remove_sb_options_menu', 20 );
function remove_sb_options_menu() {
remove_submenu_page( 'themes.php', 'sb_admin' );
}
@brichards
brichards / SublimeLinter.sublime-settings
Last active December 11, 2015 07:18
Sublime Linter Settings
{
"sublimelinter_delay": 0.5,
"sublimelinter_mark_style": "fill",
"jshint_options" :
{
"evil": true,
"regexdash": true,
"browser": true,
"wsh": true,
"trailing": true,
@brichards
brichards / functions.php
Created January 31, 2013 17:27
New Option Defaults
<?php
// Set some new option defaults for our theme
function my_option_defaults( $defaults ) {
// Set some new options
$defaults['option_name'] = 'value';
$defaults['option_name'] = 'value';
$defaults['option_name'] = 'value';
@brichards
brichards / functions.php
Created January 31, 2013 17:28
Filter child option defaults
add_filter( 'sb_child_option_defaults', 'my_option_defaults' );
@brichards
brichards / functions.php
Created January 31, 2013 17:28
Filter options on reset
add_filter( 'sb_option_defaults', 'my_option_defaults' );
@brichards
brichards / functions.php
Created January 31, 2013 17:29
Override StartBox Option Defaults
<?php
// Set some new option defaults for our theme
function my_option_defaults( $defaults ) {
// Set some new options
$defaults['option_name'] = 'value';
$defaults['option_name'] = 'value';
$defaults['option_name'] = 'value';
@brichards
brichards / wp
Last active December 13, 2015 17:39
WP Commandline Local Install
#!/bin/bash
#
# WP Commandline Local Install, by Brian Richards (@rzen)
#
# Creates a new directory, downloads WordPress, creates a database, sets up wp-config,
# optionally empties wp-content, and deletes other misc files. This compliments my local
# dev setup, outlined here: http://rzen.net/development/local-develoment-in-osx/
#
# Credit:
# Based on WPBuildr (https://github.com/AaronHolbrook/wpbuildr/). Props to Aaron Holbrook
@brichards
brichards / sb-github-downloads.php
Last active February 16, 2021 17:10
StartBox GitHub Download Generator
<?php
/**
* Plugin Name: StartBox GitHub .zip Generator
* Description: Generates a .zip download for StartBox from GitHub Master.
*
* @props Konstantin Kovshenin (@kovshenin) for sharing his work used on underscores.me (http://code.svn.wordpress.org/underscoresme/plugins/underscoresme-generator/underscoresme-generator.php)
*/
class SB_Download_Generator {
@brichards
brichards / wp-config.php
Created May 6, 2013 17:16
WP Debug Setup
<?php
// Enable WP_DEBUG mode
define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);