This gist has been migrated to a repo here.
This file contains hidden or 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 | |
/* Sample Register Helper fields | |
Register Helper Add On (https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/) | |
Add this to your customization plugin for PMPro Customizations: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
or |
This file contains hidden or 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 | |
//we have to put everything in a function called on init, so we are sure Register Helper is loaded | |
function my_pmprorh_init() | |
{ | |
//don't break if Register Helper is not loaded | |
if(!function_exists( 'pmprorh_add_registration_field' )) { | |
return false; | |
} |
This file contains hidden or 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
// 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'); |
This file contains hidden or 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 | |
/** | |
* 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 | |
*/ |
This file contains hidden or 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
/** | |
* 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( |
This file contains hidden or 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
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' ); |
This file contains hidden or 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
## | |
# 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" |
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.
ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
This file contains hidden or 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
/// <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 |
NewerOlder