Skip to content

Instantly share code, notes, and snippets.

View JarrydLong's full-sized avatar

Jarryd Long JarrydLong

  • Paid Memberships Pro
  • South Africa
  • 12:47 (UTC +02:00)
  • X @jarrydlong
View GitHub Profile
<?php //do not copy
/**
* This recipe will bulk approve users that may have signed up before the Add On was installed.
*
* Use /wp-admin/?approvemembers=true to run the script.
*
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@JarrydLong
JarrydLong / logout_url_redirect_pmpro.php
Created September 14, 2023 19:01 — forked from dparker1005/logout_url_redirect_pmpro.php
Redirect logout to PMPro login page.
<?php
// Copy from below here...
/*
* Redirect logout to PMPro login page.
*/
function my_logout_url_redirect_pmpro( $logout_url ) {
global $pmpro_pages;
if ( ! empty( $pmpro_pages['login'] ) ) {
<?php //do not copy
/**
* This recipe will add the Sofort payment method in Stripe Connect.
* Note that this will only work with EUR payments
*
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Works for PayPal Express and Stripe payment gateways.
* www.paidmembershipspro.com
*/
@JarrydLong
JarrydLong / my-pmpro-confirmation-message.php
Created August 21, 2023 13:27 — forked from ipokkel/my-pmpro-confirmation-message.php
Create a custom confirmation with a custom message
<?php
/**
* This recipe changes the default confirmation message when a user checks out.
*
*
* 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/
<?php //do not copy
/**
* This recipe removes the HTML content type and adds a plain text content type for all PMPro emails
*
* 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/
*/
@JarrydLong
JarrydLong / change-email-for-pmpro-locales.php
Created August 1, 2023 14:55 — forked from andrewlimaza/change-email-for-pmpro-locales.php
Translate Email / Change email content based on different locale for PMPro.
<?php
/**
* Adjust email content based on locale used on checkout. Works with WPML plugin.
* This requires a couple of steps to get working.
* 1. Inside your PMPro Customizations Plugin, create a folder called email_fr_FR
* (You may change fr_FR to the locale your site will be serving besides the default locale - create as many folders that you need).
* 2. Copy the email templates from 'wp-content/plugins/paid-memberships-pro/email' and paste them into your email_fr_FR folder created above.
* 3. Manually edit each template with the translation of the emails or adjust the email template to your liking.
* 4. Repeat these steps for each email folder you created depending on the number of locales your site is using.
@JarrydLong
JarrydLong / pmpro-expire-soon-banner.php
Created July 17, 2023 13:22 — forked from kimcoleman/pmpro-expire-soon-banner.php
Create a banner that will display a message to soon to be expiring members
<?php
/**
* This code will display a renewal reminder notification banner at the top of your website for members whose membership
* level will expire within 7 days of the date they visit your site.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Note: When adding to your Customizations Plugin, be careful not to include the opening php tag on line 1 above.
*/
function pmpro_show_banner_renewal_message() {
global $pmpro_pages;
@JarrydLong
JarrydLong / memberlite-banner-expiration-notification.php
Last active July 17, 2023 13:22 — forked from kimcoleman/memberlite-banner-expiration-notification.php
Display a banner that notifies users about their upcoming expiration - Memberlite method.
<?php
/**
* This code will display a renewal reminder notification banner at the top of your website for members whose membership
* level will expire within 7 days of the date they visit your site.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Note: When adding to your Customizations Plugin, be careful not to include the opening php tag on line 1 above.
*/
function memberlite_show_banner_renewal_message(){
global $pmpro_pages;
<?php //do not copy
/**
* This recipe adds a sortable column to the member list.
*
* This assumes that a 'country' User Field has been created.
*
* 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.
<?php //do not copy
/**
* This recipe gets the payment plan associated with the level that is purchased
* and shows the relevant payment plan on the Membership Account page.
*
* This is used as a workaround when using the Payment Plans Add On only.
*
* 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.