This file contains hidden or 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_start_date, $pmproml_end_date, $pmproml_limited_level_id; | |
$pmproml_limited_level_id = array( 1, 2, 4 ); // change to the ID of the limited-time membership level | |
$pmproml_start_date = "2019/04/01"; // change to the date registration starts, in YYYY/MM/DD format | |
$pmproml_end_date = "2019/04/30"; // change to the date registration ends, in YYYY/MM/DD format |
This file contains hidden or 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 | |
/* | |
Require a certain level before registering for another level. | |
Add this code to your active theme's functions.php or | |
a custom plugin. | |
*/ | |
function my_pmpro_registration_checks($okay){ | |
//only check if things are okay so far | |
if($okay) | |
{ |
This file contains hidden or 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 recipe will allow you to assign a membership level to members when purchasing an EDD product. | |
* You can do this one of two ways: | |
* | |
* OPTION 1: Product ID and Membership Level | |
* $product_levels = array( | |
27 => 1, //27 is the EDD product ID. 1 is the membership level they get when purchasing product 27 | |
); | |
* |
This file contains hidden or 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 Member Count Shortcode | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Show the number of members in a level w/a status | |
Version: .2 | |
Author: Thomas Sjolshagen @ Stranger Studios <[email protected]>, strangerstudios | |
Author URI: http://www.strangerstudios.com | |
*/ | |
function pmpro_member_count_shortcode( $attrs = null ) |
This file contains hidden or 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 | |
/* | |
* Creates an OLDMEMBER merge field in MailChimp. | |
*/ | |
function my_pmpro_mailchimp_merge_field_oldmember( $merge_fields ) { | |
$merge_fields[] = array( | |
'name' => 'OLDMEMBER', | |
'type' => 'text' | |
); | |
return $merge_fields; |
This file contains hidden or 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 | |
/** | |
* Adds an email variable !!tax!! to Paid Memberships Pro emails. | |
* Use the Email Templates Admin Editor to add !!tax!! to your email templates. | |
* Follow this guide to add this code to your site: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
* Difficulty: Easy | |
*/ | |
function my_pmpro_email_variable( $data, $email ) { |
This file contains hidden or 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 | |
/** | |
* Register Helper "Phone" Field | |
* | |
*/ | |
function pmprorh_init_phone_field() { | |
//don't break if Register Helper is not loaded | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { | |
return false; | |
} |
This file contains hidden or 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 | |
/** | |
* Once a user checks out for a level, it will add usermeta to the user's account. | |
* This will then remove any subscription delay for that member in the future, even if the user cancels and then re-signs up. | |
*/ | |
// Update level meta everytime a user changes their level to ensure they are blocked from subscription delays. | |
function my_pmpro_trial_used( $level_id, $user_id ) { | |
update_user_meta( $user_id, "pmpro_trial_level_used", "1" ); | |
} |
This file contains hidden or 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
/* | |
1. Make sure PMPro and PMPro Proration are both active. | |
2. Edit the pmpro_checkout_level_custom_prorating_rules function below to your needs. | |
3. Then add this code into a custom plugin for your site. | |
*/ | |
/** | |
* Swap in our custom prorating function. | |
*/ | |
function init_custom_prorating_rules() { |
This file contains hidden or 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: My PMPro Directory Widget | |
* Description: Add widget to Member Directory page to filter results. | |
*/ | |
class My_PMPro_Directory_Widget extends WP_Widget { | |
/** | |
* Sets up the widget | |
*/ |