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 to your wp-config.php file. | |
| define('PMPRO_LICENSE_NAG', 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
| span.pmpro_asterisk:after { content: "Required" } |
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 | |
| /** | |
| * Restrict files in the media library based on media category. | |
| * Required plugins: | |
| * - Paid Memberships Pro | |
| * - Media Library Categories | |
| * Must have PMPro set up to run files through the getfile.php script. | |
| * See this post: https://www.paidmembershipspro.com/locking-down-protecting-files-with-pmpro/ | |
| * Add a 'members' category or adjust the code below to use your categories. | |
| */ |
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 | |
| /** | |
| * Swap the word Membership with Access in the PMPro expiration text. | |
| * Add this through a code snippet or custom plugin. | |
| */ | |
| function my_custom_level_expiration_text( $expiration_text, $level ) { | |
| $expiration_text = str_replace( 'Membership', 'Access', $expiration_text ); | |
| return $expiration_text; | |
| } |
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
| /** | |
| * Tell PMPro allow weak passwords on the change password and reset password forms. | |
| * Requires PMPro v2.3.3+ | |
| */ | |
| add_filter( 'pmpro_allow_weak_passwords', '__return_true' ); |
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
| /** | |
| * Forward PMPro IPNs to another PMPro site. | |
| */ | |
| function my_pmpro_forward_ipn() { | |
| $fp = wp_remote_post( 'https://theothersite.com/wp-admin/admin-ajax.php?action=ipnhandler', $_POST ); | |
| } | |
| add_action('wp_ajax_nopriv_ipnhandler', 'my_pmpro_forward_ipn', 5); | |
| add_action('wp_ajax_ipnhandler', 'my_pmpro_forward_ipn', 5); |
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 filter to the PMPro orders table | |
| * in the WordPress dashboard | |
| * to show the past 30 days of orders. | |
| * Requires PMPro 2.3 or higher. | |
| * Add this code through a Code Snippet or Custom Plugin. | |
| */ | |
| // Add the filter. | |
| function my_pmpro_admin_orders_filters_past30( $filters ) { |
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 | |
| // Force international addresses (include country, longer state field). | |
| add_filter( 'pmpro_international_addresses', '__return_true' ); | |
| ?> |
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
| /** | |
| * This gist will disable the default behavior in PMPro BuddyPress 5.2.5 or earlier, | |
| * which would redirect users away from the BP profile pages if you had | |
| * "all of BuddyPress" locked down for non-members or members of a specific level. | |
| * | |
| * We might address this in future versions of the Add-On, but for now, you can use | |
| * this gist. Add it to a Code Snippet or a custom plugin. | |
| */ | |
| // First disable the default PMPro BuddyPress behavior. |
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
| /** | |
| * Discounts when purchasing multiple levels with PMPro MMPU | |
| * | |
| * 1. Add this to a custom plugin or code snippet. | |
| * 2. Adjust the discount_levels array. | |
| * 3. Adjust the logic for when the price is changed and how much. | |
| * 4. Make sure to remove the billing_amount lines if you don't have recurring billing. | |
| */ | |
| function my_pmpro_checkout_level_discounts( $level ) { | |
| $discount_levels = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ); |