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 this function into a customizations plugin | |
| * and then visit yoursite.com/wp-admin/?test_braintree_webhook=1 from a browser. | |
| */ | |
| function init_test_braintree_webhook() { | |
| if(!empty($_REQUEST['test_braintree_webhook'])) { | |
| define('PMPRO_BRAINTREE_WEBHOOK_DEBUG', true); | |
| $_POST['bt_signature'] = 'putthesignaturefromthewebhookloghere'; |
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: Paid Memberships Pro - Australia GST | |
| Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-australia-gst/ | |
| Description: Apply Australia GST to Checkouts with PMPro | |
| Version: .1 | |
| Author: Stranger Studios | |
| Author URI: http://www.strangerstudios.com | |
| */ | |
| /* |
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 | |
| /** | |
| * Display a member's badge on replies. | |
| * Requires the Member Badge Add On https://www.paidmembershipspro.com/add-ons/member-badges/ | |
| * Add this code to a Code Snippet or custom plugin. | |
| * https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/ | |
| */ | |
| function my_show_member_badge_in_bbpress_replies() { | |
| // Make sure pmpro and bbpress are active. | |
| if ( ! defined( 'PMPRO_VERSION' ) || ! class_exists( 'bbPress' ) ) { |
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. |