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 | |
| /** | |
| * Moves custom PMPro user fields after the email fields using JavaScript. | |
| * | |
| * 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/ | |
| */ | |
| function my_pmpro_move_user_field_to_account_information() { |
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 | |
| /** | |
| * Prevent users from checking out for a specific set of levels if they already have that level. | |
| * | |
| * Set the $blocked_levels array to the level ids you want to block in each function. | |
| * | |
| * 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 // Do not copy this line | |
| /** | |
| * Add another membership level on approval, if member is approved when using the Approvals Add On | |
| * Please add the below code to your custom plugin or Code Snippets Plugin by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_change_level_if_approved( $user_id, $level_id ) { | |
| // Only run if the approved level is the Entry level | |
| $entry_level_id = 14; // Replace with your Entry Level ID | |
| $new_level_id = 1; // Level to add after approval |
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 | |
| /** | |
| * Enable comment support for the pmpro_lesson custom post type. | |
| * | |
| * Allowing users to comment on lessons may be set with the "Allow comments" | |
| * checkbox option in the "Discussion" metabox on the lesson edit screen. | |
| * | |
| * 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 // Do not copy this line | |
| /** | |
| * Add this code to a PMPro Customization Plugin: https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/ | |
| **/ | |
| function vat_gettext_membership( $output_text ) { | |
| $output_text = str_replace( 'Members in the EU will be charged a VAT tax', 'Members will pay Tax', $output_text ); | |
| return $output_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
| <?php | |
| /** | |
| * Add a “Requires Membership” column to the Posts and Pages lists in the WordPress admin. | |
| * | |
| * title: Add a “Requires Membership” Column to Posts and Pages | |
| * - shows which membership levels are required to view each post or page. | |
| * layout: snippet | |
| * collection: admin-pages | |
| * category: admin | |
| * link: TBD |
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 | |
| /** | |
| * A simple example to show you how to add a Renew link to the Member Profile page when a membership level expires in 30 days. | |
| * | |
| * 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/ | |
| */ | |
| function my_pmpro_show_renew_link_when_level_expires_in_x_days( $pmpro_member_action_links, $level_id ) { |
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 | |
| /** | |
| * | |
| * ===== WARNING ===== | |
| * This code recipe is intended for developers and requires extensive knowledge of websites, and WordPress. | |
| * Copying and pasting this recipe into your site as-is won't work - you need to follow the steps outlined in this code. | |
| * If you are unsure, please hire a local WordPress developer or freelance for assistance. | |
| * | |
| * This code recipe is experimental and was built for private use, outside of Paid Memberships Pro and it's support scope. | |
| * |
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 // Do not copy this line please. | |
| /* | |
| * Please add the below code to your custom plugin or Code Snippets Plugin by following this guide: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| // As part of WP authentication process, call our function | |
| add_filter('wp_authenticate_user', 'wp_authenticate_user_acc', 10, 2); | |
| function wp_authenticate_user_acc($user, $password) { |
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 // do not copy this line | |
| /** | |
| * This recipe makes all billing fields on the checkout page not required | |
| * | |
| * Note: Make sure your Gateway doesn't require these fields. | |
| * | |
| * 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. |
NewerOlder