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 | |
/* PMPro Gift Levels Example */ | |
global $pmprogl_gift_levels; | |
$pmprogl_gift_levels = array( | |
// Set level 1 as a "Purchase Gift" membership level to create a gift code for a free level 2 gift. | |
1 => array( // "Purchase Gift" level ID | |
'level_id' => 2, // Membership Level ID of 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 | |
/* | |
* PMPro RSS Extra Feeds Example | |
* | |
* Extra feeds format: | |
* $feeds["Label"] = Feed URL | |
* | |
* learn more about feed URLs at http://codex.wordpress.org/WordPress_Feeds | |
*/ |
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 | |
/* Create [my_pmpro_levels] shortcode which will work in sidebar widgets, etc. */ | |
function my_pmpro_levels($atts = NULL) | |
{ | |
ob_start(); | |
include(PMPRO_DIR . "/preheaders/levels.php"); |
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 | |
// Constants | |
define( 'PMPROSL_FREE_LEVEL_ID', 5 ); //membership level to give access to | |
define( 'PMPROSL_MEMBERSHIP_PERIOD_DAYS', 7 ); //number of days to give visitor access |
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 Customizations | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Customizations for Paid Memberships Pro | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ |
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 | |
/* | |
Prorated payments. When a member chooses to upgrade, | |
he should be charged a pro-rated amount for the new membership level immediately, | |
and the payment date should stay the same. | |
Assumes initial payments are equal to billing amount. | |
Add this code to your active theme's functions.php or include this in a custom plugin. | |
*/ |
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 | |
/* | |
* Redirect admins to dashboard, everyone else to home page. | |
*/ | |
function my_pmpro_login_redirect_url($url, $request, $user) { | |
//only do this if we have a user | |
if(is_a($user, 'WP_User')) { | |
if(in_array('administrator', $user->roles)) |
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 Address For Free Levels | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-address-for-free-levels/ | |
Description: Show address fields for free levels also with Paid Memberships Pro | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ |
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 | |
/* | |
* Limit checkouts for membership level | |
*/ | |
function my_pmpro_registration_checks($continue_registration) { | |
global $wpdb; |
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 | |
/* | |
* Return the # of days until expiration for a given user | |
*/ | |
function getDaysUntilExpiration($user_id = NULL) { | |
global $current_user; | |
if(!$user_id) |