This gist has been migrated to a repo here.
View gist:b386934f8502f0077dea
// Adds "All Settings" link in the Settings Tab for Admins | |
function all_settings_link() { | |
add_options_page(__('All Settings'), __('All Settings'), 'administrator', 'options.php'); | |
} | |
add_action('admin_menu', 'all_settings_link'); |
View wcs-upgrade-fix.php
<?php | |
/** | |
* Plugin Name: WCS 1.4 Upgrade Fix | |
* Plugin URI: | |
* Description: Custom plugin to fix a database that fell out of sync with Subscriptions 1.4's database structure. | |
* Author: Brent Shepherd | |
* Author URI: | |
* Version: 1.0 | |
*/ |
View gist:8287925
/** | |
* Delete ALL WooCommerce tax rates | |
* | |
* Add to your theme functions.php then go to woocommerce -> system status -> tools and there will be a delete all tax rates button http://cld.wthms.co/tXvp | |
*/ | |
add_filter( 'woocommerce_debug_tools', 'custom_woocommerce_debug_tools' ); | |
function custom_woocommerce_debug_tools( $tools ) { | |
$tools['woocommerce_delete_tax_rates'] = array( |
View gist:7223022
function tweakjp_custom_is_support() { | |
$supported = current_theme_supports( 'infinite-scroll' ) && ( is_home() || is_archive() || is_search() ); | |
return $supported; | |
} | |
add_filter( 'infinite_scroll_archive_supported', 'tweakjp_custom_is_support' ); |
View morning-coffee.sh
## | |
# pull down all woothemes repos from github | |
# https://gist.github.com/BFTrick/5876275 | |
## | |
echo "Hi there! Grab a cup of coffee. I'll pull down the latest updates from Github" | |
# declare where our repository folder is located | |
repositoryLocation="repos" |
View wp-unit-tests.md
WordPress Unit Tests Quick Start Guide
This quick start guide is geared towards installing PHPUnit on OSX in order to run the WordPress unit tests. It uses homebrew to install PHP using homebrew-php. You can likely skip this step if you've already got php and pear installed properly.
If you use MAMP, then try these instructions to use MAMP's php and pear to install PHPUnit.
install homebrew
ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
View gist:853906
/// <summary> | |
/// Will transform "some $ugly ###url wit[]h spaces" into "some-ugly-url-with-spaces" | |
/// </summary> | |
public static string Slugify(this string phrase, int maxLength = 50) | |
{ | |
string str = phrase.ToLower(); | |
// invalid chars, make into spaces | |
str = Regex.Replace(str, @"[^a-z0-9\s-]", ""); | |
// convert multiple spaces/hyphens into one space |