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
| [membership level="0"] | |
| <!--this is shown to non-members and non-logged in visitors--> | |
| [pmpro_advanced_levels levels="1,2,3" layout="3col"] | |
| [/membership] | |
| [membership level="1,2"] | |
| [pmpro_advanced_levels levels="2,3" layout="2col"] | |
| <!--this is shown to Level 1 and 2 Members--> | |
| [/membership] | |
| [membership level="3"] | |
| [pmpro_advanced_levels levels="4"] |
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
| /** | |
| * Turn Discount Code dropdown on orders list to a select2 field. | |
| * Add this code to a custom plugin. https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_add_select2_to_discount_code_filter_on_orders_page() { | |
| if ( ! empty( $_REQUEST['page'] ) && $_REQUEST['page'] == 'pmpro-orders' ) { | |
| wp_enqueue_style( 'select2', plugins_url( 'css/select2.css', __FILE__ ), '', '4.0.6', 'screen' ); | |
| wp_enqueue_script( 'select2', plugins_url( 'js/select2.js', __FILE__ ), array( 'jquery' ), '4.0.6' ); | |
| function my_add_select2_inline_script() { |
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
| /** | |
| * Update member and order searches to also search by discount code. | |
| * | |
| * I'm not recommending anyone actually use this, but sharing as an example. | |
| * | |
| * This is a little hacky how the members list SQL is edited. | |
| * You get odd results if you change the level or other parameters | |
| * on the members list table and also search for an order. | |
| * Can also act wonky if you have overlaps between your discount code names | |
| * and cities, user names, names, or anything else that would normally |
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
| # Avoid errors in MySQL 5.7 | |
| UPDATE wp_pmpro_memberships_users SET enddate = NULL WHERE CAST(enddate AS CHAR(20)) = '0000-00-00 00:00:00'; | |
| # Fix membership_levels table | |
| ALTER TABLE `wp_pmpro_membership_levels` MODIFY `initial_payment` decimal(18,8); | |
| ALTER TABLE `wp_pmpro_membership_levels` MODIFY `billing_amount` decimal(18,8); | |
| ALTER TABLE `wp_pmpro_membership_levels` MODIFY `trial_amount` decimal(18,8); | |
| # Fix memberships_users table | |
| ALTER TABLE `wp_pmpro_memberships_users` MODIFY `initial_payment` decimal(18,8); |
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 /?test_braintree_webhook from a browser. | |
| */ | |
| function init_test_braintree_webhook() { | |
| if(!empty($_REQUEST['test_braintree_webhook'])) { | |
| define('PMPRO_BRAINTREE_WEBHOOK_DEBUG', true); | |
| $gateway = new PMProGateway_braintree(); |
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
| /** | |
| * Testing the pmprosed_fixDate function. | |
| * 1. Make sure PMPro and PMPro Set Expiration Dates is active. | |
| * 2. Add this code to a custom plugin. | |
| * 3. Visit ?test_date_functions=1 to a URL | |
| * 4. Remember to remove the code when done. | |
| */ | |
| function test_set_expiration_dates() { | |
| if( empty( $_REQUEST['test_date_functions'] ) ) { | |
| return; |
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
| /** | |
| * Keep pmpro_next_payment_date() from using the Stripe API. | |
| * Instead, the next payment date will be calculated based on | |
| * the date of the last order in PMPro. | |
| * This will be inaccurate in some cases with regards to trials, | |
| * but avoids issues where Stripe is giving the wrong "next payment" | |
| * date when payments fail. | |
| */ | |
| function my_disable_stripe_api_next_payment_date( $next_payment_date ) { | |
| // remove this filter which may run later |
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 - Custom Register Helper Fields | |
| Plugin URI: https://www.paidmembershipspro.com/documentation/register-helper-documentation/code-examples/ | |
| Description: Register Helper Fields | |
| Version: .1 | |
| Author: Stranger Studios | |
| Author URI: http://www.strangerstudios.com | |
| */ | |
| //we have to put everything in a function called on init, so we are sure Register Helper is loaded |
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
| /** | |
| * Check for merged plugins that should be deactivated. | |
| */ | |
| function pmpro_check_for_deprecated_plugins() { | |
| $pmpro_deprecated_plugins = array( | |
| 'pmpro-better-logins-report/pmpro-better-logins-report.php' => 'Better Logins Report', | |
| ); | |
| $plugins_to_deactivate = array(); | |
| foreach( $pmpro_deprecated_plugins as $plugin_path => $plugin_name ) { |
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 the PMPro pricing box at checkout | |
| * and replace with our own. | |
| * | |
| * Require PMPro v1.9.5.6+ and PMPro Sitewide Sales v1.0+ | |
| * Add this into a custom plugin. | |
| */ | |
| function override_pricing_fields_on_sitewide_sales_pages( $include_pricing_fields ) { | |
| global $wpdb, $pmpro_level; |