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/ | |
| */ |
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 the following code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * Give members of level 1 or 2 Free Shipping when free shipping is available (must set free shipping as an option in store settings). | |
| * Change $pmprowc_free_shipping_levels = array(1,2); to include level IDs that receive free shipping | |
| */ | |
| function my_pmprowc_free_shipping( $rates, $package ) { |
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 an attachment to PMPro confirmation emails. | |
| */ | |
| function my_pmpro_email_attachments($attachments, $email) | |
| { | |
| //make sure it's a checkout email (but not the admin one) | |
| if(strpos($email->template, "checkout_") !== false && strpos($email->template, "admin") === false) | |
| { | |
| //make sure attachments is an array |
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 creates Member Numbers | |
| * Change the generate_member_number function if your member number needs to be in a certain format. | |
| * Member numbers are generated when users are registered or when the membership account page is accessed for the first time. | |
| * | |
| * 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 | |
| //Copy lines 5 onwards into your PMPro Customizations plugin -> https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| /** | |
| * Add days left to members list | |
| */ | |
| function my_pmpro_days_left_members_list_col_header( $theusers ) | |
| { | |
| ?> |
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 | |
| /** | |
| * Changes the output label to Recurring in member/order lists for recurring 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/ | |
| */ | |
| /** |
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 oembeds from running on the PMPro Member Directory Add On pages. | |
| * | |
| * This may be helpful if any external or social URLs are listed on the directory | |
| * or profile page. | |
| * | |
| * Can clear oembed cache with steps here: https://siteorigin.com/clearing-oembed-cache/ | |
| * | |
| * You can add this recipe to your site by creating a custom plugin |