Skip to content

Instantly share code, notes, and snippets.

View pippinsplugins's full-sized avatar

Pippin Williamson pippinsplugins

View GitHub Profile
@johnbillion
johnbillion / wp_mail.md
Last active January 27, 2024 14:06
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@michael-cannon
michael-cannon / cbqe-restrict-content-pro.php
Last active August 29, 2015 14:14
Restrict Content Pro for Custom Bulk/Quick Edit plugin
<?php
/**
* Restrict Content Pro for Custom Bulk/Quick Edit plugin
*
* In WordPress Admin > Settings > Custom Bulk/Quick, configure your fields as needed, per below. If configuration updates are needed, either manually edit them or remove the current field configuration and click Save Changes for automatic updates.
*
* Paid Only? - As checkbox
* Show Excerpt? - As checkbox
* Hide from Feed? - As checkbox
* Access Level - As RCP Access Level
@pippinsplugins
pippinsplugins / gist:55a3d6cbf9e9f2d51789
Created December 8, 2014 15:08
My answer to why I don't actively fight piracy.

While I'm often a member of a rather small group of people that think this way, I actually believe very strongly that spending time and effort figuring out how to make it harder for dishonest people to take things from you is generally a waste of time.

security is all about steadily making it harder for dishonest people to try stuff.

Piracy happens in just about every industry, but the impact that piracy has on your business largely has to do with how you choose to fight it. If you take an active approach and invest multitudes of time, effort, and money into combatting those that have no appreciation for the value of your product, you will actually undermine the intrinsic value of the product. How? Simply by investing time, money and effort in the wrong place. I prefer to take the time, effort and money that I could use to fight piracy and invest it directly into real customers and the people that have an appreciation for what has been built. Is some money lost due to piracy? Maybe. Is a whole lot more g

@thefrosty
thefrosty / edd-sl-upgrades.php
Created November 8, 2014 01:40
Upgrade a license to a higher sites count on Extendd.com for Easy Digital Downloads
<?php
if ( !defined( 'ABSPATH' ) )
exit;
function extendd_add_key_column() {
echo '<th class="edd_license_key_upgrade">' . __( 'Upgrade License', 'extendd' ) . '</th>';
}
add_action( 'edd_purchase_history_header_after', 'extendd_add_key_column' );
@scottopolis
scottopolis / gist:bdde1926b1d08b0bb88f
Last active August 29, 2015 14:02
EDD Custom Bundle License Activation Limits
<?php
function sb_edd_filter_license_limit( $limit, $download_id, $license_id, $price_id ) {
$payment_id = get_post_meta( $license_id, '_edd_sl_payment_id', true );
$is_bundle = false;
$bundle_items = array();
$downloads = edd_get_payment_meta_downloads( $payment_id );
if( $downloads ) {
foreach( $downloads as $download ) {
@GaryJones
GaryJones / class-gamajo-template-loader.php
Created December 9, 2013 16:17
Separate out the template loader class into a generic class for all plugins, and a specific one for this plugin.
<?php
/**
* Template Loader for Plugins
*
* @package Template_Loader_For_Plugins
* @author Gary Jones
* @link http://gamajo.com/template-loader
* @copyright 2013 Gary Jones
* @license GPL-2.0+
*/
@danielbachhuber
danielbachhuber / gist:6719651
Created September 26, 2013 19:54
Automatically append mtime to script and style versions for cache-busting action
<?php
/** Automatically append mtime to script and style versions for cache-busting action **/
add_action( 'wp_enqueue_scripts', function() {
global $wp_styles, $wp_scripts;
foreach( array( 'wp_styles', 'wp_scripts' ) as $resource ) {
foreach( $$resource->registered as $name => $registered_resource ) {
// Not hosted here
@jdevalk
jdevalk / EDD_AJAX_non_ssl_filter.php
Created August 14, 2013 09:36
Make sure the AJAX URL for EDD uses the protocol for the current page, either http or https, as it doesn't work otherwise.
<?php
/**
* Make sure the AJAX URL for EDD uses the protocol for the current page, either http or https, as it doesn't work otherwise.
*
* @param string $ajaxurl The current ajaxurl
*
* @return string
*/
function yst_filter_edd_ajax_url( $ajaxurl ) {
@jdevalk
jdevalk / discount_url.php
Created August 14, 2013 09:34
Allow specification of a discount coupon through the URL, this means we can do away with the coupon field in the checkout process.
<?php
/**
* Allow people to specify a coupon code in the URL, and add it to their cart.
*/
function yst_edd_discount_link() {
if ( isset( $_GET['coupon'] ) ) {
// Check whether it's a valid coupon, if so, add it to the cart.
if ( edd_is_discount_valid( $_GET['coupon'] ) )
edd_set_cart_discount( $_GET['coupon'] );
@samikeijonen
samikeijonen / licence-limit.php
Created July 31, 2013 07:10
Add license limit UI for variable prices and show license key limit in [purchase_history] shortcode.
<?php
/**
* Show license key limit in [purchase_history] shortcode.
*
* @since 0.1.0
*/
function edd_site_count_downloads_license_limit_th() {
echo '<th class="edd-site-count-site-count">' . __( 'Site Count', 'edd-site-count' ) . '</th>';