Skip to content

Instantly share code, notes, and snippets.

View pippinsplugins's full-sized avatar

Pippin Williamson pippinsplugins

View GitHub Profile
@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 ) {
@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' );
@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

@jeffsebring
jeffsebring / gist:2025998
Created March 13, 2012 01:19 — forked from Viper007Bond/gist:2025993
Graphing car mileage
<?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 April 21, 2012 16:54
All Post Types in Search
<?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;
}
<?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
*/
anonymous
anonymous / gist:4526094
Created January 13, 2013 20:34
<?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 December 20, 2015 08:39
WordPress Plugin: Infinite scroll support for WP List Tables in the WordPress admin panel.
<?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 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'] );