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 Hidden Levels | |
Plugin URI: http://www.paidmembershipspro.com/pmpro-hidden-levels/ | |
Description: With this plugin, select levels are removed from the levels page but still available for checkout if you visit the checkout URL directly. | |
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 | |
/* | |
Plugin Name: PMPro BuddyPress Customizations | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-buddypress-customizations/ | |
Description: Example code to lock down parts of BuddyPress with PMPro | |
Version: 0.2 | |
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
/* | |
Plugin Name: PMPro Extra Members List CSV Export Columns | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-extra-members-list-csv-export-columns/ | |
Description: Add extra fields to the Paid Memberships Pro Members List CSV Export | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
Notes on use: |
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 | |
/* | |
We now maintain this code gist as an addon. | |
* On GitHub: https://github.com/strangerstudios/pmpro-wp-affiliate-platform | |
* Our Site: http://www.paidmembershipspro.com/add-ons/plus-add-ons/pmpro-wp-affiliate-platform-integration/ | |
Tips and tricks also maintains a version here: | |
https://www.tipsandtricks-hq.com/wordpress-affiliate/paid-memberships-pro-wp-affiliate-plugin-integration-873 | |
*/ |
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 Disable All Emails | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-disable-all-emails/ | |
Description: Disable All PMPro Emails | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
Add this file to your /wp-content/plugins/ folder and then activate it from the Plugins page in your WP admin. |
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
/* | |
Important note! This code is included in PMPro versions 1.5.7 and later. | |
Adding this code will add 2x the number of days to the end of the subscription. | |
*/ | |
//if checking out for the same level, add remaining days to the enddate | |
function my_pmpro_checkout_level($level) | |
{ | |
global $pmpro_msg, $pmpro_msgt; | |
//does this level expire? are they an existing user of this 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
/* | |
Allow + in usernames | |
Just add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
function pmprorh_sanitize_user( $username, $raw_username, $strict = false ) | |
{ | |
//only check if there is a + in the raw username | |
if(strpos($raw_username, "+") === false) | |
return $username; |
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
/* | |
Set levels as "all access levels" so members of these levels will be able to view all Addon Packages. | |
Requires Paid Memberships Pro and the pmpro-addon-packages plugin. | |
*/ | |
function my_pmproap_all_access_levels($levels, $user_id, $post_id) | |
{ | |
//I'm just adding the level, but I could do some calculation based on the user and post id to programatically give access to content | |
$levels = array(16); | |
return $levels; | |
} |
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
/* | |
Don't show confirm password or email fields on the checkout page. | |
Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
add_filter("pmpro_checkout_confirm_password", "__return_false"); | |
add_filter("pmpro_checkout_confirm_email", "__return_false"); |
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
/* | |
This code will create a content filter for all pages and posts to remove access to posts that were published before a member's join date. Only posts or pages which require membership will be hidden. Note that pages and posts that require membership will still be hidden from non-members regardless of the publish date. | |
The params passed are: | |
$hasaccess - (bool) what PMPro thinks about whether the user has access | |
$thepost - (post object) the post being checked, usually the current post | |
$theuser - (user object) the user being checked, usually the current user | |
$post_membership_levels - (array of levels) the levels this post requires (if any) | |
*/ | |
add_filter("pmpro_has_membership_access_filter", "hide_old_posts_from_members", 10, 4); |