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
rewrite ^\/wp-content\/uploads\/(.*[\.pdf|\.doc|\.docx|\.ppt|\.zip])$ /wp-content/plugins/paid-memberships-pro/services/getfile.php last; |
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
rewrite ^/wp-content/uploads/(.*)$ /wp-content/plugins/paid-memberships-pro/services/getfile.php last; |
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 | |
/** | |
* Redirect BuddyPress registration to the PMPro levels page. | |
* Add this code into a Code Snippet or custom plugin. | |
* https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/ | |
* Note that this gist will redirect users to the level pages. | |
* You can adjust it to link to checkout for a specific level | |
* or, if you have only one level, adjust it to link to the | |
* checkout page, which will default to the first available level. | |
*/ |
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 | |
/** | |
* Cancel subscriptions when a recurring payment fails. | |
* You should also use the PMPro Email Templates Add On to edit the | |
* default billing_failure.html email to mention that users are cancelled upon failure. | |
*/ | |
function my_cancel_subscriptions_on_any_failed_payment( $order ) { | |
pmpro_cancelMembershipLevel( $order->membership_id, $order->user_id ); | |
} | |
add_action( 'pmpro_subscription_payment_failed', 'my_cancel_subscriptions_on_any_failed_payment' ); |
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 | |
/** | |
* Add a column to the PMPro orders table that shows the original subscription order. | |
* Requires PMPro 2.5+ | |
* Add this code to a Code Snippet or custom plugin. | |
*/ | |
function my_original_sub_order_col_header($order_ids) { | |
?> | |
<th>Original Order</th> | |
<?php |
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
/** | |
* Hide docs from some levels. | |
* Make sure to adjust the pmpro_hasMembershipLevel check below | |
* to use the IDs of your levels which SHOULD have access to view members. | |
* Everyone else will be redirected to the restricted access or levels page. | |
* | |
* Copy this code into a custom plugin or Code Snippet. | |
*/ | |
function my_redirect_away_from_docs() { | |
// Bail if PMPro and BuddyPress aren't active. |
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
/** | |
* Hide individual member pages from some levels. | |
* Make sure to adjust the pmpro_hasMembershipLevel check below | |
* to use the IDs of your levels which SHOULD have access to view members. | |
* Everyone else will be redirected to the restricted access or levels page. | |
* | |
* Copy this code into a custom plugin or Code Snippet. | |
*/ | |
function my_redirect_away_from_member_pages() { | |
// Bail if PMPro and BuddyPress aren't active. |
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
/** | |
* Only let certain members post BuddyPress activity. | |
* This code works with BuddyPress and BuddyBoss. | |
* This code only filters the main activity page. | |
* Posting to groups you are a member of still works. | |
* | |
* Make sure BuddyPress (or BuddyBoss), PMPro, and PMPro BuddyPress are all active. | |
* Copy this code into a custom plugin or Code Snippet. | |
*/ |
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 | |
// show ads to non-members and level 3 | |
if( pmpro_hasMembershipLevel( array(0,3) ) ) { | |
?> | |
<script>//...</script> | |
<?php | |
} | |
// use the pmpro_displayAds function | |
// https://www.paidmembershipspro.com/documentation/content-controls/hide-ads/ |
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 | |
/** | |
* Change the statement descriptor for Stripe charges and subscriptions. | |
* This is the message shown on the customer's credit card statement. | |
* Must contain at least one letter, 22 characters max. | |
* | |
* Requires PMPro 2.4.1+ | |
* | |
* Note: If your descriptor includes invalid characters or | |
* more than 22 chacters, checkout will fail. |