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
/* | |
Allows renewing yearly memberships with a set expiration date. | |
E.g. if the level expires on 1/1/2020 and the member renews their membership before then, their membership will be extended to 1/1/2021 | |
Requires the Set Expiration Dates Add On for Paid Memberships Pro | |
*/ | |
function my_pmpro_yearly_membership_renewal($level) { | |
$extend_level = 1; //change to the level with a set expiration date | |
if( $level->id == $extend_level && pmpro_hasMembershipLevel( $extend_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 | |
/* | |
*/ | |
function my_pmpro_add_directory_page_numbers($title){ | |
global $post, $pmpro_pages; | |
$pn = 0; | |
if( isset($_REQUEST['pn'] ) ) | |
{ | |
$pn = sanitize_text_field( $_REQUEST['pn'] ); | |
} |
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 | |
/* Checks to see if a registration is happening after a given date; if so, prevent registration and stop new signups for the level/no longer display the level on the levels page | |
*/ | |
global $pmproml_end_date, $pmproml_limited_level_id; | |
$pmproml_limited_level_id = 1; // change to the ID of the limited-time membership level | |
$pmproml_end_date = "2019/04/30"; // change to the date registration ends, in YYYY/MM/DD format | |
function pmproml_pmpro_registration_date_checks( $value ) { | |
global $wpdb, $pmproml_end_date, $pmproml_limited_level_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 | |
/** | |
* Change subject line of Checkout email based on membership level. | |
* | |
* @param string $subject The email's subject is a string of text that you can adjust here as you see fit or pull from another custom function. | |
* @param object $email This is the php object from which we extracting the appropriate level and to which we'll add the new email content. | |
* @return string Whichever condition applies in the function below will determine what string is supplied to the email object. If none of the conditions are met, the return string will be the original message subject. | |
*/ | |
function pmpro_adjust_email_subject_to_level_checkout( $subject, $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
/* | |
Change email subjects. | |
The function checks $email->template and updates the subject as needed. | |
The email template name will be equivalent to the filenames in the /email/ folder of the PMPro plugin. | |
*/ | |
function my_pmpro_email_subject($subject, $email) | |
{ | |
//only checkout emails |
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 | |
/* Generate checkout email when using Add Member from Admin Add On for Paid Memberships Pro | |
*/ | |
function pmpro_send_member_notification( $user ) { | |
$pmproemail = new PMProEmail(); | |
$pmproemail->sendCheckoutEmail( $user ); | |
} | |
add_action( 'pmpro_add_member_added', 'pmpro_send_member_notification', 10, 2 ) |
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 | |
/* Change /wp-admin/ Redirect After Login for Paid Memberships Pro */ | |
function my_pmpromh_login_redirect( $redirect_to, $request, $user ) | |
{ | |
$admin_url = get_admin_url(); | |
$landing_page_id = 11; //change this to the ID of the page you want to redirect the user to | |
if ( ! current_user_can( 'administrator' ) && $redirect_to == $admin_url ) { | |
$redirect_to = get_permalink( $landing_page_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: PMPro Stripe Billing Limits | |
Plugin URI: http://www.paidmembershipspro.com/add-ons/pmpro-stripe-billing-limits/ | |
Description: Allow billing limits with Stripe, where the Stripe subscription is cancelled, but the PMPro membership is not after X payments. | |
Version: .3 | |
Author: strangerstudios | |
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 | |
/* | |
* Give users a new level after x successful payments at another level. | |
*/ | |
function my_pmpro_after_change_membership_level($level_id, $user_id, $cancel_level) | |
{ | |
global $wpdb; | |
// change number of payments here | |
$payments = 10; |
NewerOlder