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
/* | |
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 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: https://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Customizations for my Paid Memberships Pro Setup | |
Version: .1 | |
Author: Paid Memberships Pro | |
Author URI: https://www.paidmembershipspro.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
if(is_user_logged_in() && function_exists('pmpro_hasMembershipLevel') && pmpro_hasMembershipLevel()) | |
{ | |
global $current_user; | |
$current_user->membership_level = pmpro_getMembershipLevelForUser($current_user->ID); | |
echo 'Membership Level: ' . $current_user->membership_level->name; | |
} |
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 these vars | |
SET @old_id = 2; | |
SET @new_id = 1; | |
# change the db table prefix here | |
UPDATE IGNORE wp_pmpro_membership_levels SET id = @new_id WHERE id = @old_id; | |
UPDATE IGNORE wp_pmpro_discount_codes_levels SET level_id = @new_id WHERE level_id = @old_id; | |
UPDATE IGNORE wp_pmpro_membership_orders SET membership_id = @new_id WHERE membership_id = @old_id; | |
UPDATE IGNORE wp_pmpro_memberships_categories SET membership_id = @new_id WHERE membership_id = @old_id; | |
UPDATE IGNORE wp_pmpro_memberships_pages SET membership_id = @new_id WHERE membership_id = @old_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
/* | |
Tell PMPro to filter the_content a bit later. | |
This will sometimes fix issues where theme or plugin elements (e.g. videos) | |
are not being filtered by PMPro. Note that this sometimes will cause | |
some things (e.g. share links) to be filtered that you don't want to be | |
filtered... and sometimes edits to the theme or a child theme are | |
required to get the desired effect. | |
Add this to your active theme's fucntions.php or a custom plugin. |
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
/* | |
Old Users Discount Code (oudc) | |
*/ | |
//define the discount code here | |
define('OUDC_DISCOUNT_CODE', 'abc123'); //change abc123 here to the discount code that is for old members only | |
//make sure only old members can use a specific discount code | |
function oudc_pmpro_registration_checks($okay) { | |
//if something else went wrong, just return $okay | |
if(!$okay) |
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
/* | |
If you add this code into a plugin, then the PMPro Email Templates addon | |
will allow you to set/change the body of the email through its UI. | |
You can then send an email using this template using code like: | |
$email = new PMProEmail(); | |
$email->template = 'my_email_template_name'; | |
$email->email = 'email@youaresendingto.com'; | |
$email->send(); |
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
/* | |
Shortcode to show a member's expiration date. | |
Add this code to your active theme's functions.php or a custom plugin. | |
Then add the shortcode [pmpro_expiration_date] where you want the current user's | |
expiration date to appear. | |
If the user is logged out or doesn't have an expiration date, then --- is shown. | |
*/ |
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
/* CSS Document */ | |
.pmpro-checkout #pmpro_payment_method span { | |
display: inline-block; | |
} | |
.pmpro-checkout #pmpro_payment_method span a { | |
background-position: bottom left; | |
background-repeat: no-repeat; | |
background-size: contain; | |
border: none; | |
display: inline-block; |