Skip to content

Instantly share code, notes, and snippets.

View JarrydLong's full-sized avatar

Jarryd Long JarrydLong

  • Paid Memberships Pro
  • South Africa
  • 11:36 (UTC +02:00)
  • X @jarrydlong
View GitHub Profile
<?php //do not copy
/**
* This recipe will geocode users and ensure compatibility with Membership Maps v0.9+
* Run /wp-admin/?pmpromm_process_users=true to run the script.
*
* 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 will add the Crypto payment method in Stripe Connect.
*
* 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 / add-payment-method-to-pmpro-emails.php
Last active May 22, 2025 10:26 — forked from ipokkel/add-payment-method-to-pmpro-emails.php
Adds payment method variable to Paid Memberships Pro emails that can be included using the Paid Memberships Pro Email Templates Add On
<?php
/**
* Adds !!payment_method!! variable to be used with the
* Paid Memberships Pro Email Templates Add On.
* This data will be available for all Paid Memberships Pro emails.
* Add the below code to your PMPro Customizations Plugin and
* edit the email templates you want to add this to.
*/
function add_payment_method_to_pmpro_emails( $data, $email ) {
<?php //do not copy
/**
* This recipe set the default level on the checkout page to the member's current level
*
* 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.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
<?php //do not copy
/**
* This recipe unhooks the existing document title parts hook and
* uses the member's first and last names in the title.
*
* 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
//Run this via php pmpro-get-all-open-issues-across-repos.php or similar.
/**
* This recipe loops through all of the Stranger Studios Repos and checks for Open issues
* It then filters them and only records issues that are:
* - Tagged Good First Bug
* - Are not tagged Needs Thought
* - Body or Title contain the word bug in them
<?php //do not copy
// Store the old levels before the change.
function pmpro_store_old_levels( $level_id, $user_id ) {
$old_level_we_want_to_remember = 7;
// Store the current level in a static variable.
$current_level = pmpro_getMembershipLevelForUser( $user_id );
if ( ! empty( $current_level ) && $current_level === $old_level_we_want_to_remember ) {
<?php //do not copy
add_filter('query', function ($query) {
if (strpos($query, 'CREATE TABLE') !== false || strpos($query, 'ALTER TABLE') !== false) {
error_log("DBDelta altering query: " . $query);
}
return $query;
});
<?php //do not copy
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
<?php //do not copy
/**
* This recipe unhooks a function that the Member Directory uses to redirect profile URL's to pretty permalinks
*
* 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/
*/