Skip to content

Instantly share code, notes, and snippets.


Patrick Rauland BFTrick

View GitHub Profile
DanielSantoro / gist:b386934f8502f0077dea
Created Jul 7, 2014
Show Options Page in "Settings" Section
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
* 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
ChromeOrange / gist:8287925
Last active Feb 25, 2020
Delete all tax rates from WooCommerce
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
add_filter( 'woocommerce_debug_tools', 'custom_woocommerce_debug_tools' );
function custom_woocommerce_debug_tools( $tools ) {
$tools['woocommerce_delete_tax_rates'] = array(
blobaugh / gist:7223022
Created Oct 29, 2013
Add additional support for Infinite Scroll in Jetpack
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' );
thenbrent /
Last active Oct 31, 2016
Using WooCommerce and want to disable PayPal for subscription purchases, but still offer it as an option for buying one-off products? Activate this plugin.

This gist has been migrated to a repo here.

BFTrick /
Last active Dec 19, 2015
A shell script to download the latest WooThemes updates from GitHub
# pull down all woothemes repos from github
echo "Hi there! Grab a cup of coffee. I'll pull down the latest updates from Github"
# declare where our repository folder is located
xentek /
Created Aug 26, 2012
WordPress Unit Tests Quick Start

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
kamranayub / gist:853906
Created Mar 4, 2011
Generates a URL-friendly "slug" from an unsanitized string
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
You can’t perform that action at this time.