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-load-custom-admin-page.php
Created March 3, 2016 14:38
Load additional "custom" fields to the advanced settings page.
<?php
/*
Plugin Name: PMPro Custom Admin Page
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Templated admin pages for Paid Memberships Pro
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
@eighty20results
eighty20results / pmpro-validate-email-domain.php
Created March 3, 2016 16:58
Prevent sign-up from email addresses in $invalid_domains array (Line: 32)
<?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 "do not allow" list for registration
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
@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 / pmpro-single-trial-period-per-user.php
Last active March 14, 2016 20:05
During checkout, werify whether user has used the specified "trial" membership level before. If so, prevent them from checking out. User must remember to define the level ID for the trial membership in the PMPRO_CUSTOM_TRIAL_LEVEL constant.
<?php
/*
Plugin Name: PMPro Trial Membership Limits
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Prevent users from signing up for the Trial Membership Level more than once
Version: .1
Author: Thomas Sjolshagen w/Stranger Studios <thomas@eighty20results.com>
Author URI: http://www.strangerstudios.com
*/
/*
@eighty20results
eighty20results / pmpro_next_year_expiration.php
Created March 15, 2016 14:53
For new sign-ups, expire the membership level on Dec 31st, the year after they signed up.
<?php
/*
Plugin Name: PMPro Expire New Memberships Next Year
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customization to expire new membership sign-ups on Jan 1 the year after, the year after this one.
Version: .1
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com>
Author URI: https://eighty20results.com/thomas-sjolshagen/
*/
function pmpro_next_year_expiration($level)
@eighty20results
eighty20results / pmpro_custom_expiration_interval.php
Created March 16, 2016 18:27
Allow user to define a custom expiration interval (defined in constant)
<?php
/*
Plugin Name: PMPro Custom Renew Button interval
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customization to let admin specify how early to show the renew button.
Version: .1
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com>
Author URI: https://eighty20results.com/thomas-sjolshagen/
*/
@eighty20results
eighty20results / pmpro_preserve_startdate.php
Last active April 16, 2018 19:34
Preserve initial startdate for member regardless of how the membership level is updated.
<?php
/*
Plugin Name: PMPro Preserve Startdate
Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/
Description: Customization to preserve initial membership signup (startdate) value.
Version: 1.0
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com>
Author URI: https://eighty20results.com/thomas-sjolshagen/
*/
/*
@eighty20results
eighty20results / pmpro-apply-addon-access-to-all-child-pages.php
Created March 26, 2016 21:54
Protect all child pages of a page protected by the "Protect Add-on Pages" add-on
<?php
/*
Plugin Name: PMPro Protect Child Pages
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Apply protection to all child pages of a Add-on Page that's protected.
Version: .1
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com>
Author URI: https://eighty20results.com/thomas-sjolshagen/
*/
/**
@eighty20results
eighty20results / pmpro-customization.php
Created May 5, 2016 13:37
Create Register Helper fields & sync them with the corresponding BuddyPress fields
<?php
/*
Plugin Name: PMPro Customizations
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for Paid Memberships Pro
Version: .2
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
@eighty20results
eighty20results / dpesrh-field-defs.php
Created May 8, 2016 15:09
Register Helper Fields for DPES
<?php
/*
Plugin Name: PMPro Register Helper - Extra fields
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Extra registration fields
Version: .1
Author: Thomas Sjolshagen - PMPro Support <thomas@eighty20results.com>
Author URI: http://www.strangerstudios.com/
*/
function dpesrh_RH_fields()