Skip to content

Instantly share code, notes, and snippets.

View eighty20results's full-sized avatar

Thomas Sjølshagen eighty20results

View GitHub Profile
@eighty20results
eighty20results / allow-fqdn-to-signup.php
Last active May 26, 2016 23:54
Check whether the new member has an email address that matches the specified domain and the level they're trying to sign up for is a free level.
<?php
/*
Plugin Name: PMPro e-mail domain check
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Check if a domain is on the "allow" list for registration
Version: .1
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com>
Author URI: http://www.eighty20results.com/thomas-sjolshagen/
*/
@eighty20results
eighty20results / pmpro-acto-rh-fields.php
Last active May 25, 2016 23:13
Register Helper fields (customization plugin) for ACTO Online
<?php
/*
Plugin Name: Additional user data for ACTO checkout
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Add Register Helper fields to ACTO chekout & profile pages
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
@eighty20results
eighty20results / pmpro-bulk-update.php
Last active May 31, 2016 15:17
Proof of Concept for bulk-updating posts with membership protection (if the post didn't previously have protection)
<?php
/*
Plugin Name: PMPro Bulk Update
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Allow updating all posts to a membership level
Version: .1
Author: Thomas Sjolshage <thomas@eighty20results.com>
Author URI: http://www.eighty20results.com/thomas-sjolshagen/
*/
@eighty20results
eighty20results / pmpro-single-use-trial.php
Created June 12, 2016 13:27
Configure one or more membership level(s) as "single-use" trial memberships (i.e. prevent the user from signing up more than once)
<?php
/*
Plugin Name: PMPro Single Use Trial Memberships
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Allow a member to sign up for the trial membership level once
Version: .1
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com>
Author URI: http://www.eighty20results.com/thomas-sjolshagen/
*/
@eighty20results
eighty20results / pmpro-start-of-month-payments.php
Created August 27, 2016 17:50
Prorate the inital payment & set the start date for the recurring payments to the 1st of the month
<?php
/*
Plugin Name: Prorated initial membership payment
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Will prorate the membership payment from today until the 1st of the next month.
Version: .1
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com>
Author URI: http://www.eighty20results.com/thomas-sjolshagen
*/
@eighty20results
eighty20results / pmpro-single-use-trial.php
Last active September 3, 2016 13:43
One time use trial membership level(s). Has filter `pmprosut_set_trial_level_ids` to configure which membership levels to make into one-time trial memberships
<?php
/*
Plugin Name: PMPro Single Use Trial Memberships
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Allow a member to sign up for the trial membership level once
Version: .2
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com>
Author URI: http://www.eighty20results.com/thomas-sjolshagen/
*/
@eighty20results
eighty20results / pmpro-buddypress-membership-protection.php
Created September 3, 2016 14:11
Limit access to BuddyPress components for users without a valid Paid Memberships Pro membership level
<?php
/*
Plugin Name: PMPro/BuddyPress members only access
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Limit access to BuddyPress pages/components for non-members.
Version: .1
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com>
Author URI: http://www.eighty20results.com/thomas-sjolshagen
*/
@eighty20results
eighty20results / pmpro-set-default-country.php
Created September 9, 2016 17:41
Configure International addresses & set a non-US default country
<?php
/*
Plugin Name: PMPro: Set Default Country for Billing Page
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Configure International addresses & set a non-US default country
Version: 1.0
Requires: 4.0
Author: Thomas Sjolshagen @ Paid Memberships Pro <thomas@eighty20results.com>
Author URI: http://www.eighty20results.com/thomas-sjolshagen/
License: GPL2
@eighty20results
eighty20results / e20r-end-of-month-membership-cancellation.php
Last active April 16, 2018 19:29
Cancel the membership at the end of the month, not immediately.
/*
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).
*/
//give users their level back with an expiration
function e20r_pmpro_after_change_ml($level_id, $user_id)
{
@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