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 | |
| /** | |
| * 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. |
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 | |
| /** | |
| * Limit Post Views: Don't allow post views for certain categories. | |
| */ | |
| function my_pmprolpv_has_membership_access( $has_access, $post ) { | |
| // Set blocked categories here. | |
| $blocked_categories = array( 'silver', 'gold' ); | |
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 | |
| global $pmpro_addon_pages_for_courses; | |
| // 28 is the page ID; 24 is the course ID. | |
| // 30 is the page ID; 26 is the course ID. | |
| $pmpro_addon_pages_for_courses = array( | |
| 28 => 24, | |
| 30 => 26, | |
| ); | |
| function pmproap_learndash_template_redirect() | |
| { |
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 allows members to cancel a locked membership level | |
| * if the level was locked with PMPro Lock Membership Levels Add On. | |
| * | |
| * This recipe expects and requires the Membership Locked page set up | |
| * and assigned under Memberships > Settings > Page settings. | |
| * @link https://www.paidmembershipspro.com/add-ons/pmpro-lock-membership-level/#install | |
| * |
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 | |
| /** | |
| * Notification bar when post views are being tracked and restricted by the Limit Post Views Add On | |
| */ | |
| function add_notification_bar_for_limit_post_view() { | |
| // check for past views and if we are on a single page. needs to check if the post is locked at all by default. | |
| if ( ! empty( $_COOKIE['pmpro_lpv_count'] ) && is_single() ) { | |
| global $current_user; | |
| // Check cookie for views value. |
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 | |
| /** | |
| * Custom membership-card template: Set recurring membership renewal date as expiration date. | |
| * Place this directly in your theme/child-theme's root directory | |
| * e.g.: example.com/wp-content/themes/{your active theme}/membership-card.php | |
| */ | |
| global $wpdb, $pmpro_membership_card_user, $pmpro_currency_symbol, $post; |
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
| global $pmprosm_sponsored_account_levels; | |
| $pmprosm_sponsored_account_levels = [ | |
| //set 5 seats at checkout | |
| 4 => [ | |
| 'main_level_id' => 4, //redundant but useful | |
| 'sponsored_level_id' => [4], //array or single id | |
| 'sponsored_accounts_at_checkout' => TRUE, | |
| 'seat_cost' => 0, | |
| 'max_seats' => 4, | |
| 'min_seats' => 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
| <?php | |
| /** | |
| * Remove the gift aid text from the checkout page for specified membership levels. | |
| * | |
| * 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/ | |
| */ |
NewerOlder