Skip to content

Instantly share code, notes, and snippets.

View jcpeden's full-sized avatar

John Peden jcpeden

View GitHub Profile
@jcpeden
jcpeden / licensing-variable-pricing.php
Last active December 13, 2015 17:58 — forked from pippinsplugins/gist:4475625
This single-file plugin adds licensing to variably-priced products served through Easy Digital Downloads. I patched line 28 by adding '$item = array();' to avoid a fatal error that my server returned when I implemented it.
<?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
*/
@jcpeden
jcpeden / buddypress-member-profile-match
Created June 7, 2012 13:41
BuddyPress Members List Based on Profile Field Match
//Load members list on research centre pages
//Build list of users based on research centre slug
function research_centre_member_function() {
global $post;
$ancs = get_ancestors($post->ID, 'page');
if(($ancs[1] == 128) || ($ancs[1] == 136) || ($ancs[1] == 138)) {
global $wpdb;
$slug = basename(get_permalink());
//Build array to match permalink slug to profile field value
$centre_array = array(