This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pmpro_pennsports_gift() { | |
global $pmprogl_gift_levels; | |
$pmprogl_gift_levels = array( | |
// Set level 3 as a "Purchase Gift" membership level to create a gift code for a free level 4 gift. | |
3 => array( // "Purchase Gift" level ID | |
'level_id' => 4, // Membership Level ID of the gift membership level. | |
'initial_payment' => 0, // The initial payment for the gift membership level. | |
'billing_amount' => 0, // The recurring billing amount for the gift membership level.The recurring billing amount for the gift membership level. | |
'cycle_number' => 0, // The number of billing cycles for the gift membership level. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: PMPro Profile Fields | |
* | |
* Add PMPro billing fields to the WordPress and BuddyPress user profiles | |
* | |
* You must have installed both Paid Memberships Pro and the PMPro Register Helper plugins | |
* | |
* https://github.com/strangerstudios/pmpro-register-helper | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // do no include in Customizaations Plugin | |
/** | |
* Plugin Name: PMPro Levels Popup | |
* Description: Add Level selection to a popup | |
*/ | |
add_shortcode( 'pmpro-levels2-popup', 'pmpro_levels_select_shortcode2' ); | |
function pmpro_levels_select_shortcode2() { | |
global $wpdb, $pmpro_msg, $pmpro_msgt, $current_user; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Allow members to only renew if their membership expires in 45 days or less. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function custom_pmpro_is_level_expiring_soon( $r, $level ) { | |
$days = 45; //change number of days before someone is allowed to renew. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Calculate days remaining for current membership level and add it to new subscription. | |
* Only works for PMPro WooCommerce Integration | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* www.paidmembershipspro.com | |
*/ | |
function pmprowoo_add_days_to_level( $level_array ) { | |
$level_obj = pmpro_getLevel($level_array['membership_id']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
License: GPL2 | |
License URI: https://www.gnu.org/licenses/gpl-2.0.html | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Define the global array below for your main accounts and sponsored levels. | |
Array keys should be the main account level. | |
*/ | |
global $pmprosm_sponsored_account_levels; | |
$pmprosm_sponsored_account_levels = array( | |
//set 5 seats at checkout | |
1 => array( | |
'main_level_id' => 1, //redundant but useful | |
'sponsored_level_id' => array(1,2), //array or single id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Setup Level 3 to start next Monday and end the following Monday | |
Requires PMPro 1.8.9 or higher. | |
Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
//startdate | |
function my_pmpro_checkout_start_date($enddate, $user_id, $level) { | |
if($level->id == 3) |