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 // don't copy this line | |
/** | |
* Adds Custom User Fields to the Approvals Email. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ |
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 - Australia GST | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-australia-gst/ | |
Description: Apply Australia GST to Checkouts with PMPro | |
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 | |
/** | |
* Redirect non-members (including logged-in non-members) away from restricted pages and to login page. | |
* This allows non-members to access Paid Memberships Pro checkout/levels pages as well as the default WordPress login page. | |
* | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_redirect_non_members_example() { |
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 the "We Accept..." text on the checkout page. | |
* Follow this guide to add custom code to your membership site - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function change_my_pmpro_account_text( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'We accept all major credit cards' : |
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 | |
/** | |
* This generates an unique discount code with one use whenever a user expires, for their current level. | |
* Add the variable !!expired_code!! to the Membership Expired email, to show the code to users. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_create_discount_code_on_expiry( $user_id, $level_id ) { | |
if( $level_id === 2 ) { // change 2 to your trial 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 | |
/** | |
* Add Contact Form 7 to the Profile page when using the Member Directory and Profiles Add On for Paid Memberships Pro. | |
* Update line 36 with the correct CF7 shortcode for your desired form to display. | |
* Add a hidden field to your form: "[hidden send-to-email default:shortcode_attr]". | |
* Set the "To" field of the Contact Form to "[send-to-email]". | |
* | |
*/ | |
// Allow custom shortcode attribute for "send-to-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 | |
/** | |
* This code is used to change 'Choose your Payment Method' text in Paid Memberships Pro. | |
* Add the function into your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function change_choose_your_payment( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Choose your Payment Method' : |
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 | |
/** | |
* Displays ads for non-members on your site | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ |
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 | |
/* | |
Adjust start date to the first following Sunday for a specific level | |
*/ | |
function my_pmpro_checkout_start_date( $startdate, $user_id, $level ){ | |
if( $level->id == 8 ) { //Change to the preferred level you want this to apply to | |
//which day is it |
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 | |
/** | |
* Intends to disable the reminder email | |
* Add this code to your Code Snippet/Custom Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_adjust_trial_ending_email( $days ) { | |
return 999; //We don't want to send out reminders | |
} | |
add_filter( 'pmpro_email_days_before_trial_end', 'my_pmpro_adjust_trial_ending_email', 10, 1 ); // Trial Ending Soon Emails | |
add_filter( 'pmpro_email_days_before_expiration', 'my_pmpro_adjust_trial_ending_email', 10, 1 ); // Expiring Soon Emails |