Skip to content

Instantly share code, notes, and snippets.

View eighty20results's full-sized avatar

Thomas Sjølshagen eighty20results

View GitHub Profile
@eighty20results
eighty20results / e20r-list-all-addonpage-users.php
Last active January 1, 2017 20:15
Create `[pmpro_list_addon_users]` shortcode to list addon package (page/post) users who're registered as having purchased the specified list of addon package IDs.
<?php
/*
Plugin Name: PMPro Add-on Page/Post user list
Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/
Description: List all user(s) who've bought a specific Add-on Post/Page
Version: 1.1
Author: Eighty / 20 Results by Wicked Strong Chicks, LLC <thomas@eighty20results.com>
Author URI: https://eighty20results.com/thomas-sjolshagen/
License:
@eighty20results
eighty20results / pmpro_multi_payment_options.php
Last active November 18, 2016 14:30 — forked from strangerstudios/my_init_pmpro_payment_options.php
Get PMPro Pay By Check and PMPro Add PayPal Express to work together.
/*
Plugin Name: Paid Memberships Pro - Pay By Check and PayPal Express at checkout
Plugin URI: http://eighty20results.com/paid-memberships-pro/do-it-for-me/
Description: More gracefully handle Pay By Check and PayPal Express as payment options during checkout
Version: 1.0
Author: Thomas Sjoslhagen @ Paid Memberships Pro <thomas@eighty20results.com>
Author URI: http://eighty20results.com/thomas-sjolshagen
*/
/*
Get PMPro Pay By Check and PMPro Add PayPal Express to work together.
@eighty20results
eighty20results / jb-custom-pmpro-membership-number.php
Created November 11, 2016 15:13
Custom PMPro Membership Number for @jacobeels
<?php
/*
Member Numbers
* Change the generate_member_number function if your member number needs to be in a certain format.
* Member numbers are generated when users are registered or when the membership account page is accessed for the first time.
*/
//Generate member_number when a user is registered.
function generate_member_number($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
@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-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 / 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-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-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
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/
*/