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 example is to show you the 'niche' options each Paid Memberships Pro - Register Helper Add-on field can take and how to use it. | |
* For more information on the Register Helper Add-on please visit https://www.paidmembershipspro.com/add-ons/free-add-ons/pmpro-register-helper-add-checkout-and-profile-fields/ | |
**/ | |
function my_pmprorh_init() | |
{ | |
//don't break if Register Helper is not loaded |
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
<?php | |
/* | |
Only allow users to use the trial level once. | |
Add this code to your active theme's functions.php | |
or a custom plugin. | |
Be sure to change the $trial_level_id variable in multiple places. | |
*/ | |
//get trial level ids | |
function my_pmpro_trial_level_ids() { | |
// edit this to be a comma separated list of your trial level ids |
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 | |
/** | |
* Use the pmprowoo_get_membership_price filter to set prices for variable products. | |
* Update the $membership_prices array. | |
* Each item in that array should have a key equal to the membership level id, | |
* and a value equal to an array of the form array( {variable_product_id} => {member_price} ) | |
* | |
* Add this code into a custom plugin. | |
*/ | |
function my_pmprowoo_get_membership_price( $discount_price, $level_id, $original_price, $product ) { |
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: Register Helper Example | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Register Helper Initialization Example | |
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 | |
/* | |
Only allow users to use the trial level once. | |
Add this code to your active theme's functions.php | |
or a custom plugin. | |
Be sure to change the $trial_level_id variable in multiple places. | |
*/ | |
//record when users gain the trial level | |
function my_pmpro_after_change_membership_level($level_id, $user_id) | |
{ |