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 | |
/** | |
* Sequential Member Numbers | |
* Member numbers are automatically increased from the value set for $starting_member_number after each member registration | |
* | |
* Add this code to your PMPro Customizations Plugin | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
* Requirements: |
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 | |
/* | |
* Display Member Number on Edit Profile Page for Admin | |
* | |
*/ | |
// We have to put everything in a function called on init, so we are sure Register Helper is loaded. | |
function my_pmprorh_init_member_number() { | |
// Don't break if Register Helper is not loaded. | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { |
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 all non-admin user's after they login to your website's home page. | |
* Documentation for login_redirect filter - https://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect | |
* Visit https://yoohooplugins.com for more tutorials. | |
*/ | |
function yh_redirect_after_login( $redirect_to, $request, $user ) { | |
if ( isset( $user->roles ) && is_array( $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 | |
// Add this code below to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
add_filter( 'gettext', 'change_text_for_add_paypal_express', 20, 3 ); | |
/** | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
*/ | |
function change_text_for_add_paypal_express( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Choose Your Payment Method': | |
$translated_text = __( 'Choose Your Payment Method', 'pmpro' ); |
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_custom_level_cost_text( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Membership Level': | |
$translated_text = __( 'My Membership Level Name', 'paid-memberships-pro' ); | |
break; | |
} |
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 | |
/** | |
* Add this code to your PMPro Customizations Plugin or via a code snippets plugin. | |
*/ | |
function my_pmpro_adjust_reply_to_email( $headers, $email ) { | |
// Add "Reply-To" header and set it to the user that just cancelled. | |
if( strpos($email->template, "_admin")) { | |
$headers[] = "Reply-To: " . $email->data['user_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 | |
/** | |
* Filter to modify the days prior to renewal that the Recurring Payment Email Reminders Add On | |
* sends members the membership_recurring email notifcation. | |
* | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function custom_pmpro_upcoming_recurring_payment_reminder( $rec_array ) { | |
$rec_array = array ( 30 => 'membership_recurring', 7 => ' membership_recurring' ); | |
return $rec_array; |
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 not copy this line please. Copy from below. | |
/** | |
* This filter will search your codebase for translatable strings and replace when an exact match is found. | |
* Replace "Email Address" with "Username or Email Address" on PMPro Login Form | |
* Add this code to your PMPro Customizations Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
add_filter( 'the_content', 'register_text', 25 ); |
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 | |
/** | |
* Hide discount code link on checkout for a specific level Paid Memberships Pro. | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Visit www.paidmembershipspro.com for more info. | |
*/ | |
function pmpro_hide_discount_level_5() { | |
global $pmpro_pages; |