Skip to content

Instantly share code, notes, and snippets.

Avatar

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / my-pmpro-email-data-custom-message-per-level.php
Created Apr 16, 2021
Create the !!custom_message!! shortcode for the Email Templates Admin Editor Add On and set a custom message per membership level.
View my-pmpro-email-data-custom-message-per-level.php
<?php
/**
* This recipe adds a custom email shortcode !!custom_message!! that can be
* used in the Email Templates Admin Editor.
*
* 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/
*/
@ipokkel
ipokkel / my-pmpro-custom-checkout-email-template-per-level.php
Created Apr 16, 2021
Send a custom checkout email template with a custom subject line per membership level #pmpro
View my-pmpro-custom-checkout-email-template-per-level.php
<?php
/**
* This recipe sets a custom checkout email template and subject line per level.
*
* In this example recipe we created a custom email template for level ID's 1 & 2
* in the "email" folder inside our customization plugin's directory.
*
* 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.
@ipokkel
ipokkel / my_first_last_display_name.php
Last active Apr 16, 2021 — forked from kimcoleman/my_first_last_display_name.php
Set Display Name on Membership Checkout and for BuddyPress Name field.
View my_first_last_display_name.php
<?php
/**
* Set Display Name on Membership Checkout and for BuddyPress Name field.
*/
function my_first_last_display_name( $user_id, $morder ) {
// Get user's first and last name.
$first_name = get_user_meta( $user_id, 'first_name', true );
$last_name = get_user_meta( $user_id, 'last_name', true );
@ipokkel
ipokkel / cancel-on-next-payment-date-expiration-date-email-variable.php
Created Apr 15, 2021
This recipe removes the default PMPro Cancel on Next Payment date email message and adds the !!access_expire_date!! email shortcode for the Email Templates Admin Editor.
View cancel-on-next-payment-date-expiration-date-email-variable.php
<?php
/**
* This recipe removes the cancel email filter for Cancel on Next Payment Date
* and creates the shortcode !!access_expire_date!! that can be used in the
*
* 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/
*/
@ipokkel
ipokkel / hide-first-last-display-name-on-user-profile-page.php
Created Apr 14, 2021
Removes the First Name, Last Name, and Display Name fields on the Member Profile Edit page.
View hide-first-last-display-name-on-user-profile-page.php
<?php
/**
* This recipe removes the First Name, Last Name, and Display Name fields on the Member Profile Edit page.
*
* 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/
*/
@ipokkel
ipokkel / hide-profile-from-directory-by-default.php
Created Apr 14, 2021
Hide a new member's profile from the PMPro Directory by default #pmpro-directory
View hide-profile-from-directory-by-default.php
<?php
/**
* This recipe defaults to hide a new member's profile from the directory
*
* 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/
*/
@ipokkel
ipokkel / my-pmpro-account-bullets-levels-start-end-dates.php
Created Apr 13, 2021
Display start and end dates for each level on the PMPro Account page in the My Account section. #pmpro
View my-pmpro-account-bullets-levels-start-end-dates.php
<?php
/**
* This recipe shows the user's membership level's start and end date on the account page.
*
* 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/
*/
@ipokkel
ipokkel / remove-pmproarc-email-filter-if-pmproconpd-exists.php
Created Apr 13, 2021
Prevent duplicate "Your access will expire on [DATE]" notification in email if both Auto Renewal Checkbox and Cancel on Next Payment Date Add On's are active.
View remove-pmproarc-email-filter-if-pmproconpd-exists.php
<?php
/**
* This recipe removes the cancel email filter for Auto Renewal Checkbox
* if Cancel on Next Payment Date Add On is active to prevent duplication
* of the expiration notice "Your access will expire on [DATE]" in the email.
*
* 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/
@ipokkel
ipokkel / pmpror4c-conditional-email-body-string-replace.php
Created Apr 12, 2021
Add the reason for cancelling to the email body only when the shortcode !!reason!! was not used. #pmpro-reason-for-cancelling
View pmpror4c-conditional-email-body-string-replace.php
<?php
/**
* This recipe adds the reason for cancelling in the default cancel email templates
* if the email shortcode !!reason!! is not in the template.
*
* 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/
*/
@ipokkel
ipokkel / change-level-cost-text.php
Created Apr 1, 2021
Change or translate text for PMPro Custom Level Cost Text Add On #pmpro-level-cost-text #translate
View change-level-cost-text.php
<?php
/**
* This recipe is an example of how to change or translate
* localized text strings for PMPro Custom Level Cost Text Add On.
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*
* 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.