Skip to content

Instantly share code, notes, and snippets.

View eighty20results's full-sized avatar

Thomas Sjølshagen eighty20results

View GitHub Profile
@eighty20results
eighty20results / oeis-substitution-variables.php
Last active October 25, 2018 17:11
Add custom member application fields as substitution variables for email messages from the OEIS Member Application Management
<?php
/*
Plugin Name: OEIS Member Application Management: Custom Substitution Variables
Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/
Description: Add custom, pre-defined Register Helper fields, as email substitution variables for the messages sent by the OEIS Member Application Management plugin
Version: 1.1
Requires at least: 4.9
Tested up to: 4.9.8
Author: Eighty / 20 Results by Wicked Strong Chicks, LLC <thomas@eighty20results.com>
Author URI: https://eighty20results.com/thomas-sjolshagen/
@eighty20results
eighty20results / pmpro_ld2aff.php
Last active October 23, 2018 04:12 — forked from strangerstudios/pmpro_ld2aff.php
Link Paid Memberships Pro discount codes to affiliate accounts from another plugin/service.
<?php
/*
Plugin Name: E20R - Link PMPro Discount Codes to Affiliate Accounts
Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/
Description: Link a PMPro Discount Code to the account of an affiliate
Version: 1.0
Requires at least: 4.5
Tested up to: 4.9.8
Author: Eighty / 20 Results by Wicked Strong Chicks, LLC <thomas@eighty20results.com>
Author URI: https://eighty20results.com/thomas-sjolshagen/
@eighty20results
eighty20results / bulk-update.sql
Created September 17, 2018 18:41
Bulk update membership levels in Paid Memberships Pro
UPDATE wp_pmpro_memberships_users SET 'membership_id' = 2 WHERE status = 'active' AND 'membership_id' = 1;
@eighty20results
eighty20results / uj-customizations.php
Created May 19, 2018 11:36
Custom fields per support topic
<?php
/*
Plugin Name: PMPro Customizations: Register Helper Fields
Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/
Description: Customizations - Register Helper Fields
Version: 1.0
Author: Eighty / 20 Results by Wicked Strong Chicks, LLC <thomas@eighty20results.com>
Author URI: https://eighty20results.com/thomas-sjolshagen/
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
License: GPLv2 or later
@eighty20results
eighty20results / disable-paypalexpress-for-level.php
Created May 15, 2018 10:58
Removes the "Pay with PayPal Express" choice from the checkout page when the user uses one of the specified Membership Level IDs
<?php
/*
Plugin Name: PMPro Customizations: Remove PayPal Express as payment option for Membership Level
Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/
Description: Removes PayPal Express as a payment option on the PMPro Checkout page when the user has selected a specific membership level.
Version: 1.0
Author: Eighty / 20 Results by Wicked Strong Chicks, LLC <thomas@eighty20results.com>
Author URI: https://eighty20results.com/thomas-sjolshagen/
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
License: GPLv2 or later
@eighty20results
eighty20results / gh-custom-cancel-page
Created April 14, 2018 03:51
Load custom cancellation page for certain membership levels
<?php
/**
* Filter handler for `pmpro_pages_shortcode_cancel` (load custom cancellation page for certain membeship levels)
*
* @param string $content
*
* @return string
*/
function gc_custom_cancel_page( $content ) {
@eighty20results
eighty20results / unique_line_items.php
Last active November 21, 2017 07:26
Add a new line item if the quantity of a product increases
function createUniqueLineItems( $cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data ) {
// Only do this for quantities > 1
if ( $quantity > 1 ) {
// Reset the quantity for the current product entry
WC()->cart->set_quantity( $cart_item_key, 1 );
// Add a line-item for all quantities > 1. Already have one entry in the cart, so do it for $quantity - 1
for ( $i = 1; $i <= $quantity - 1; $i ++ ) {
@eighty20results
eighty20results / pmpro_cancelled_level.php
Last active October 23, 2018 03:52 — forked from strangerstudios/pmpro_cancelled_level.php
Place a PMPro member in another level when they cancel.
<?php
/*
Plugin Name: Eighty/20 Results: Assign free level when cancelling
Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/
Description: Custom code to configure a default member level for a user who cancels
Version: 1.0
Requires at least: 4.5
Tested up to: 4.9.8
Author: Eighty / 20 Results by Wicked Strong Chicks, LLC <thomas@eighty20results.com>
Author URI: https://eighty20results.com/thomas-sjolshagen/
<?php
/*
Plugin Name: PMPro Customizations: Register Helper Fields
Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/
Description: Customizations - Register Helper Fields
Version: 1.0
Author: Eighty / 20 Results by Wicked Strong Chicks, LLC <thomas@eighty20results.com>
Author URI: https://eighty20results.com/thomas-sjolshagen/
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
License: GPLv2 or later
@eighty20results
eighty20results / pmpro-canadian-tax-option.php
Last active January 16, 2018 20:24
Canadian Tax calculation for PMPro (HST, PST, TPS and TVQ rates)
<?php
/*
Plugin Name: PMPro: Canadian Tax calculation
Plugin URI: https://eighty20resultsc.com/wordpress-plugins/
Description: PMPro Tax Calculation for (some of) the Canadian province(s)
Version: 1.4
Author: Thomas Sjolshagen @ Paid Memberships Pro <thomas@eighy20results.com>
Author URI: https://eighty20results.com/thomas-sjolshagen/
License: GPL2