Skip to content

Instantly share code, notes, and snippets.

View JarrydLong's full-sized avatar

Jarryd Long JarrydLong

  • Paid Memberships Pro
  • South Africa
  • 03:46 (UTC +02:00)
  • X @jarrydlong
View GitHub Profile
@JarrydLong
JarrydLong / remove-custom-trial-for-members.php
Last active April 16, 2025 06:02 — forked from andrewlimaza/remove-custom-trial-for-members.php
Remove custom trial for levels for existing and past members Paid Memberships Pro (Trial only used once)
<?php
/**
* Removes custom trial for active and past members.
* Adjust this code accordingly to price your membership level when removing the trial.
* To add this code to your site, please follow this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_remove_custom_trial( $level ) {
if ( is_admin() || ! is_user_logged_in() ) {
return $level;
@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 ) {
@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
/**
@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;
}
@JarrydLong
JarrydLong / my_ipn_redirect.php
Created December 17, 2024 12:11 — forked from ideadude/my_ipn_redirect.php
Redirect MEPR IPN URL to the PMPro IPN URL
/*
Redirect MEPR IPN URL to the PMPro IPN URL, e.g.
https://yoursite.com/mepr/notify/onibvz-5w6/ipn =>
https://yoursite.com/wp-admin/admin-ajax.php?action=ipnhandler
Update line 9 to match the IPN URL given to you by MEPR
*/
function my_ipn_redirect() {
if( defined('PMPRO_DIR') && $_SERVER['REQUEST_URI'] === '/mepr/notify/onibvz-5w6/ipn' ) {
require_once(PMPRO_DIR . "/services/ipnhandler.php");
@JarrydLong
JarrydLong / change-add-first-last-name-to-checkout.php
Created December 13, 2024 06:25 — forked from ipokkel/change-add-first-last-name-to-checkout.php
Change text or translate Add Name to Checkout Add On #pmpro-add-name-to-checkout
<?php
/**
* This recipe changes localized text strings for
* Add Name to Checkout Add On using the gettext filter.
*
* @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.
@JarrydLong
JarrydLong / change-add-first-last-name-to-checkout.php
Created December 13, 2024 06:25 — forked from ipokkel/change-add-first-last-name-to-checkout.php
Change text or translate Add Name to Checkout Add On #pmpro-add-name-to-checkout
<?php
/**
* This recipe changes localized text strings for
* Add Name to Checkout Add On using the gettext filter.
*
* @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.
@JarrydLong
JarrydLong / minh-my_login_change_text_with_gettext.php
Last active December 6, 2024 09:37 — forked from dwanjuki/my_login_change_text_with_gettext.php
Change / Translate login page text strings with the gettext filter
<?php // do not copy this line
/**
* This recipe changes login page text strings with the gettext filter
*
* 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-addon-package-confirmation-url.php
Created November 27, 2024 12:18 — forked from ipokkel/pmpro-addon-package-confirmation-url.php
Redirect membr back to Addon Package purchased after checkout.
<?php
/**
* Redirect member back to Addon Packages page after checkout.
*
* 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 / generate-username-from-email-pmpro.php
Last active December 30, 2024 15:36 — forked from andrewlimaza/generate-username-from-email-pmpro.php
Generate a username during checkout for user [Paid Memberships Pro]
<?php
/**
* Generate a username at PMPro checkout from email for users.
* Hide your 'username' field using custom CSS.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_generate_username_at_checkout() {
// Make sure PMPro is installed and the function to get the level at checkout exists.