Skip to content

Instantly share code, notes, and snippets.

View JarrydLong's full-sized avatar

Jarryd Long JarrydLong

  • Paid Memberships Pro
  • South Africa
  • 11:41 (UTC +02:00)
  • X @jarrydlong
View GitHub Profile
<?php //do not copy
/**
* This recipe gets a customer's Tax ID and country from the webhook
*
* Create two User fields with the names pmpro_stripe_tax_type and pmpro_stripe_tax_id to view
* the tax type and tax ID in the member's profile.
*
* 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.
/**
* Intends to protect uploads within the uploads/sites/x/ file structure
* This code assumes that PMPro is installed and active on each multisite installation
*/
rewrite ^/wp-content/uploads/(sites/[0-9]+/)?(.+\.(pdf|doc|docx|ppt|zip|png))$ /wp-content/plugins/paid-memberships-pro/services/getfile.php?file=$1$2 last;
<?php //do not copy
/**
* This recipe filters the search request from the member directory into the membership map
*
* 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
function my_pmpro_registration_checks( $okay, $level ){
global $pmpro_msg, $pmpro_msgt;
/**
* Restricts based on gender field - START
*/
@JarrydLong
JarrydLong / change-add-paypal-express.php
Created March 20, 2025 06:07 — forked from kimwhite/change-add-paypal-express.php
Change text for add paypal express to checkout translation strings
<?php
// Add this code below to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
add_filter( 'gettext', 'change_text_for_add_paypal_express', 20, 3 );
/**
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function change_text_for_add_paypal_express( $translated, $text, $domain ) {
switch ( $domain ) {
case 'pmpro-add-paypal-express':
switch ( $text ) {
<?php //do not copy
function my_pmpro_email_headers_admin_emails( $headers, $email ) {
// BCC emails already going to admin_email.
if ( strpos( $email->template, '_admin' ) !== false ) {
if ( intval( $email->data['membership_id'] ) == 2 ) {
$headers[] = 'Bcc:' . '[email protected]';
// $headers[] = 'Bcc:' . '[email protected],[email protected],[email protected]'; //Example with multiple BCC emails
@JarrydLong
JarrydLong / my_pmpro_stripe_checkout_session_parameters_subscription_description.php Updates the payment description in Stripe when purchasing a subscription using Stripe Checkout.
<?php
/**
* 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.
*/
// Copy from below this line
/**
<?php //do not copy
/**
* This recipe gets the expiration date for a member's membership when updating it from the Edit Member 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/
*/
<?php //do not copy
/**
* This recipe changes the 'Expires' text on the Membership Account page to 'Renewal Date'
*
* 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 / pmpro_nginx.conf
Created January 9, 2025 11:15 — forked from ideadude/pmpro_nginx.conf
NGINX rule to lock down files with Paid Memberships Pro
location ^~ /wp-content/uploads/ {
rewrite ^/wp-content/uploads/(.*)$ /wp-content/plugins/paid-memberships-pro/services/getfile.php?file=$1 last;
}