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 | |
| /** | |
| * Adds "Group One" and "Group Two" columns to the PMPro Members List CSV export. | |
| * Each column includes level names based on static arrays of level IDs. | |
| * | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_members_list_static_columns( $columns ) { | |
| $columns['group_one'] = 'my_pmpro_get_group_one_column'; // Column title will be "Group One" | 
  
    
      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 | |
| /** | |
| * This stops users from accessing restricted products directly with Paid Memberships Pro. | |
| * Tested on WooCommerce 3.4 and up. | |
| * You may be interested with the following gist for removing products from WooCommerce shop page - https://gist.github.com/andrewlimaza/6ee480694d38a99695503febe3cdabf1 | |
| * Add the following function to your PMPro Customizations plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * Visit https://www.paidmembershipspro.com for any questions or assistance. | |
| */ | 
  
    
      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 | |
| /** | |
| * Validate a custom dropdown field in PMPro checkout to ensure a valid selection. | |
| * | |
| * In this gist, if the user selects the option ("SELECT ONE"), an error message is displayed. | |
| * IMPORTANT - Remember you need to add this "default" option to your list of options in the select user field. | |
| * The script attempts to retrieve the field's label dynamically for a more informative error. | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | 
  
    
      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 | |
| /** | |
| * Modify the checkout message based on the "Donations-Only Level" setting. | |
| * | |
| * Ensures that existing members are only prevented from checking out with the donation-only level | |
| * if the "Donations-Only Level" option is checked in the membership level settings. | |
| */ | |
| /** | |
| * | 
  
    
      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 custom state/region to a specific country in the PMPro State Dropdown Add On. | |
| * | |
| * This ensures the new state/region appears in alphabetical order within the country's list. | |
| * Modify `$country_code` and `$custom_state` as needed for your use case. | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * Read this companion article for step-by-step directions on either method: | 
  
    
      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 Website Field to PMPro Checkout, Frontend Profile Edit, and Admin Member Edit Screen. | |
| * | |
| * - Adds a "Website" field to checkout, user profile edit, and admin member edit screen. | |
| * - Saves the website URL correctly to the default WordPress `user_url` field. | |
| */ | |
| /** | |
| * Add Website field to PMPro Checkout Form. | 
  
    
      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 | |
| /** | |
| * This recipe will add a fee to the initial and recurring value when using Stripe | |
| * including when a payment plan is selected. | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * Read this companion article for step-by-step directions on either method. | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | 
  
    
      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 | |
| /** | |
| * Donation notes. | |
| * Edit the copy below. | |
| * Add to a custom plugin. | |
| * Notes are now saved into the order meta instead of the order notes. | |
| */ | |
| // Show the donation notes field at checkout (Always visible) | 
  
    
      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
    
  
  
    
  | # For subsites | |
| rewrite ^\/wp-content\/uploads\/sites\/([0-9]+)\/(.*[\.pdf|\.doc|\.docx|\.ppt|\.zip])$ /wp-content/plugins/paid-memberships-pro/services/getfile.php?blog_id=$1&file=$2 last; | |
| # For the main site | |
| rewrite ^\/wp-content\/uploads\/(.*[\.pdf|\.doc|\.docx|\.ppt|\.zip])$ /wp-content/plugins/paid-memberships-pro/services/getfile.php?file=$1 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 | |
| /** | |
| * Update the user_nicename field in the database after changing a username. | |
| * | |
| * Use this snippet after updating a user's username (user_login) using a plugin like | |
| * "Easy Username Updater" or similar tools. This ensures that the profile URL updates | |
| * correctly by setting the user_nicename field to match the updated username. | |
| * | |
| * Instructions: | |
| * 1. Add this snippet to your theme's functions.php file or use a code snippets plugin. |