Skip to content

Instantly share code, notes, and snippets.

Pippin Williamson pippinsplugins

Block or report user

Report or block pippinsplugins

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@scottopolis
scottopolis / gist:bdde1926b1d08b0bb88f
Last active Aug 29, 2015
EDD Custom Bundle License Activation Limits
View gist:bdde1926b1d08b0bb88f
<?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 ) {
@thefrosty
thefrosty / edd-sl-upgrades.php
Created Nov 8, 2014
Upgrade a license to a higher sites count on Extendd.com for Easy Digital Downloads
View edd-sl-upgrades.php
<?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' );
@michael-cannon
michael-cannon / cbqe-restrict-content-pro.php
Last active Aug 29, 2015
Restrict Content Pro for Custom Bulk/Quick Edit plugin
View cbqe-restrict-content-pro.php
<?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 Dec 8, 2014
My answer to why I don't actively fight piracy.
View gist:55a3d6cbf9e9f2d51789

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

@jeffsebring
jeffsebring / gist:2025998
Created Mar 13, 2012 — forked from Viper007Bond/gist:2025993
Graphing car mileage
View gist:2025998
<?php
/**
* All of this code is in a big class that implements things like meta boxes and
* tons of other stuff but for now here's the relevant functions.
*
* Note the custom post types and custom taxonomies are just in placeholder form.
* I haven't gone through and properly set the labels, etc. for them like I will
* when I release the plugin.
*/
@pippinsplugins
pippinsplugins / all_post_types.php
Created Apr 21, 2012
All Post Types in Search
View all_post_types.php
<?php
function ecpt_include_post_types_in_search($query) {
if(is_search()) {
$post_types = get_post_types(array('public' => true, 'exclude_from_search' => false), 'objects');
$searchable_types = array();
if($post_types) {
foreach( $post_types as $type) {
$searchable_types[] = $type->name;
}
View gist:4475625
<?php
/*
Plugin Name: Easy Digital Downloads - Variable Pricing License Activation Limits
Plugin URL: http://easydigitaldownloads.com/extension/
Description: Limit the number of license activations permitted based on variable prices
Version: 1.0
Author: Pippin Williamson
Author URI: http://pippinsplugins.com
Contributors: mordauk
*/
View gist:4526094
<?php
//add_action( 'wp_head', 'tgm_delete_all_orders' );
function tgm_delete_all_orders() {
21
$payments = get_posts( array( 'post_type' => 'edd_payment', 'posts_per_page' => -1, 'post_status' => 'any' ) );
$downloads = get_posts( array( 'post_type' => 'download', 'posts_per_page' => -1 ) );
if ( $downloads ) {
foreach ( $downloads as $download ) {
delete_post_meta( $download->ID, '_edd_download_sales' );
@bradyvercher
bradyvercher / infinite-wp-list-tables.php
Last active Dec 20, 2015
WordPress Plugin: Infinite scroll support for WP List Tables in the WordPress admin panel.
View infinite-wp-list-tables.php
<?php
/**
* Plugin Name: Infinite WP List Tables
* Description: Infinite scroll support for WP List Tables in the WordPress admin panel.
* Version: 0.1.0
* Author: Brady Vercher
* Author URI: http://www.blazersix.com/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
@jdevalk
jdevalk / discount_url.php
Created Aug 14, 2013
Allow specification of a discount coupon through the URL, this means we can do away with the coupon field in the checkout process.
View discount_url.php
<?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'] );
You can’t perform that action at this time.