Skip to content

Instantly share code, notes, and snippets.

View eighty20results's full-sized avatar

Thomas Sjølshagen eighty20results

View GitHub Profile
@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_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 / 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-custom-tax.php
Last active January 1, 2017 22:47 — forked from strangerstudios/pmpro-customizations.php
Tax solution for British Columbia, Canada to be used with Paid Memberships Pro
<?php
/*
Plugin Name: PMPro Custom Tax
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for PMPro
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
/*
@eighty20results
eighty20results / insert-price-for-addon-packages.sql
Created February 1, 2017 17:03
SQL Example for adding price to multiple addon packages
INSERT INTO PREFIX_postmeta (`post_id`, `meta_key`, `meta_value`)
SELECT `ID`, '_pmproap_price`, '<your price without a currency sign, i.e. 3.99>'
FROM PREFIX_posts
WHERE ID IN ( <comma>, <separated>, <list>, <of>, <addon>, <package>, <post>, <ids> );
@eighty20results
eighty20results / order-records-example.php
Created February 2, 2017 00:21
Sample check of order records for a user
<?php
global $wpdb;
$records = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->pmpro_membership_orders} WHERE user_id = %d AND status = %s", $user_id, 'success' ) );
if ( $records == 1 ) {
// No previous order found
} else {
// Found old orders so member is not new
}
@eighty20results
eighty20results / e20r-disabled-domains.php
Created March 31, 2017 17:51
Disallow certain email domains from creating membership(s)
<?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 / sn-customizations.php
Created May 23, 2017 23:03
Custom Fields (Register Helper)
<?php
/*
Plugin Name: PMPro: Custom Registration/WordPress Profile Fields
Description: Custom fields, using the PMPro Register Helper add-on
Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/
Author: Thomas Sjolshagen @ Paid Memberships Pro <thomas@eighty20results.com>
Author URI: https://eighty20results.com/thomas-sjolshagen/
Version: 1.0
License: GPL2
Text Domain: sn-customizations
@eighty20results
eighty20results / ic-customizations.php
Created June 8, 2017 21:42
Customizations to use the "Capture Name & Address for Free Levels or for Offsite Gateway" add-on
<?php
/*
Plugin Name: PMPro Customizations: Required Field Changes
Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/
Description: Customizations to disable required fields for some of the Address/Addon.
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-australian-gst.php
Last active November 6, 2017 01:27
Calculate GST for Australian billing addresses/residents
<?php
/**
* Plugin Name: Paid Memberships Pro - Australian GST
* Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/
* Description: Calculate and display GST for Australian customers at checkout
* Version: 1.0
* Author: Paid Memberships Pro / Thomas Sjolshagen <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