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
/** | |
* This function will output the number of days left in a trial period for a user in the | |
* member links section on the account page. | |
*/ | |
add_action( 'pmpro_member_links_top', 'my_pmpro_member_links_top' ); | |
function my_pmpro_member_links_top() { | |
// Get current level details | |
$user_level = pmpro_getMembershipLevelForUser(); | |
// Make sure we have a trial |
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
/** | |
* When checking out adjust the starting recurring payment date. Applies to new and existing users. | |
* | |
* $monthly_cutoff_day is the day of each month that the start date should be adjusted | |
* We're also checking to see if it's before March 15th, 2014 in this example. | |
*/ | |
function my_pmpro_profile_start_date( $startdate, $order ) { | |
$monthly_cutoff_day = 16; // (e.g. March 16th) Adjust this value accordingly, this is the day of the month that the start date should be rolled over to the next month | |
$current_day = ( int ) date( 'd' ); // Get the current day of the month |
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
/** | |
* Prevent users from downgrading levels. | |
*/ | |
add_filter( 'pmpro_checkout_level', 'my_pmpro_checkout_level' ); | |
function my_pmpro_checkout_level( $level ) { | |
// Check to see if the current user is downgrading (Gold to Silver or Gold to Free) | |
if( pmpro_hasMembershipLevel( 3 ) && ( $level->id == 2 || $level->id == 1 ) ) { | |
// Re-direct them to page explaining why they cannot downgrade | |
wp_redirect( home_url( '/gold-downgrade-message' ) ); | |
exit; |
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
/** | |
* Hook into Members List header | |
*/ | |
add_action( 'pmpro_memberslist_extra_cols_header', 'my_pmpro_memberslist_extra_cols_header' ); | |
function my_pmpro_memberslist_extra_cols_header() { | |
echo '<th>Discount Code</th>'; | |
} | |
/** | |
* Hook into Members List body to show discount code |
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
/* | |
Nicer level costs for levels that have trial periods. | |
*/ | |
function nicer_pmpro_level_cost_text($text, $level) | |
{ | |
global $pmpro_currency_symbol; | |
if(pmpro_isLevelFree($level)) | |
$text = "Membership is free."; | |
// Levels that have a trial |
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
/** | |
* This function allows a custom confirmation message to be added to a checkout e-mail template. This will allow you to add | |
* your custom confirmation message to an e-mail template, without creating your own custom template in your theme. | |
* | |
* We're checking for the "checkout_" prefix on the e-mail template name and if we have current user data. | |
* We're then getting the custom confirmation level based on the current user data. | |
* We replace the 'is now active.</p>' portion of the body to append the confirmation message. | |
*/ | |
add_filter( 'pmpro_email_body', 'my_pmpro_email_body', 10, 2 ); | |
function my_pmpro_email_body( $body, $email ) { |
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 Strong Passwords | |
Version: 0.1 | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Force users to submit strong passwords. | |
Version: .1 | |
Author: Scott Sousa | |
Author URI: http://slocumstudio.com |