Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Rauland BFTrick

View GitHub Profile
@DanielSantoro
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
<?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
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 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(
@blobaugh
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
thenbrent / woocommerce-disable-paypal-for-subscriptions.md
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.
View woocommerce-disable-paypal-for-subscriptions.md

This gist has been migrated to a repo here.

@BFTrick
BFTrick / morning-coffee.sh
Last active Dec 19, 2015
A shell script to download the latest WooThemes updates from GitHub
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"
@xentek
xentek / wp-unit-tests.md
Created Aug 26, 2012
WordPress Unit Tests Quick Start
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)
@kamranayub
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.