Skip to content

Instantly share code, notes, and snippets.

View eighty20results's full-sized avatar

Thomas Sjølshagen eighty20results

View GitHub Profile
@eighty20results
eighty20results / pmpro-append-to-end.php
Created October 10, 2016 16:16
When user renews membership we append the duration to their current enddate
<?php
/*
Plugin Name: Paid Memberships Pro: Extend membership by new level duration
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: On change of level, modify the end date to add the new level's time
Version: 1.0
Requires: 4.5.3
Author: Thomas Sjolshagen <thomas@eighty20results.com>
Author URI: http://www.eighty20results.com/thomas-sjolshagen/
License: GPL2
@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 / pmpro_cancel_on_next_payments_date.php
Last active July 17, 2019 20:22 — forked from strangerstudios/pmpro_cancel_on_next_payments_date.php
Change PMPro membership cancellation to set expiration date to be the end of the payment period, instead of cancelling immediately (except when payment gateway is causing cancellation)
<?php
/*
Change cancellation to set expiration date et expiration date to be the end of the current month, instead of cancelling immediately.
Assumes orders are generated for each payment (i.e. your webhooks/etc are setup correctly).
*/
function e20r_stripe_delete_action( $user_id ) {
@eighty20results
eighty20results / e20r-pmpro-powerpress-feed-protection.php
Last active April 23, 2019 20:57
Protect PowerPress Podcast Feeds, but let members access them with their custom RSS key. Requires both BluBrry PowerPress plugin, and the PMPro Member RSS add-on.
<?php
/*
Plugin Name: E20R - PowerPress Podcast Feed Protection for Paid Memberships Pro
Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/
Description: Verify PMPro RSS Member Key when accessing PowerPress feed
Version: 1.2
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 / 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 / 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/
@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