Skip to content

Instantly share code, notes, and snippets.

View eighty20results's full-sized avatar

Thomas Sjølshagen eighty20results

View GitHub Profile
@eighty20results
eighty20results / discounts.php
Last active July 12, 2016 21:19
Add discount code column to order list
function my_pmpro_add_cols_header($order_ids) {
ob_start(); ?>
<th>Discount Code</th><?php
return ob_get_clean();
}
add_filter('pmpro_orders_extra_cols_header', 'my_pmpro_add_cols_header');
function my_pmpro_add_cols_body($order) {
<?php
function my_add_pmpro_state_abbrev( $states )
{
// Canadian province abbreviations
$provinces = array(
"AB",
"BC",
"MB",
"NB",
add_action( "pmpro_after_change_membership_level", "e20r_cancel_at_end_of_period", 10, 2 );
add_filter( "pmpro_email_body", "e20r_email_body_for_cancel_msg", 10, 2 );
/**
* Change cancellation to set expiration date for next payment instead of cancelling immediately.
* Assumes monthly membership levels.
* Assumes orders are generated for each payment (i.e. your webhooks/etc are setup correctly).
*
* @param (int) $level_id -- The membership levelId we're changing
* @param (int) $user_id -- The member we're changing levels for.