Skip to content

Instantly share code, notes, and snippets.

View JarrydLong's full-sized avatar

Jarryd Long JarrydLong

  • Paid Memberships Pro
  • South Africa
  • 07:18 (UTC +02:00)
  • X @jarrydlong
View GitHub Profile
@JarrydLong
JarrydLong / pmpro-add-userfields-approvals.php
Last active February 6, 2023 14:37 — forked from kimwhite/pmpro-add-userfields-approvals.php
PMPro - Add Custom User Fields to the Admin Approval Email
<?php // don't copy this line
/**
* Adds Custom User Fields to the Approvals 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/
*/
@JarrydLong
JarrydLong / pmpro-australia-gst.php
Last active January 19, 2023 09:28 — forked from ideadude/pmpro-australia-gst.php
Paid Memberships Pro - Australia GST
<?php
/*
Plugin Name: Paid Memberships Pro - Australia GST
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-australia-gst/
Description: Apply Australia GST to Checkouts with PMPro
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
/*
@JarrydLong
JarrydLong / my-template-redirect-example.php
Created November 14, 2022 06:13 — forked from andrewlimaza/my-template-redirect-example.php
Redirect non-members to homepage but allow access to PMPro checkout pages.
<?php
/**
* Redirect non-members (including logged-in non-members) away from restricted pages and to login page.
* This allows non-members to access Paid Memberships Pro checkout/levels pages as well as the default WordPress login page.
*
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_redirect_non_members_example() {
@JarrydLong
JarrydLong / change-we-accept-checkout-text.php
Last active November 7, 2022 08:17 — forked from andrewlimaza/change-we-accept-checkout-text.php
Change the We Accept Checkout Text for Paid Memberships Pro.
<?php
/**
* Change the "We Accept..." text on the checkout page.
* Follow this guide to add custom code to your membership site - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function change_my_pmpro_account_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'We accept all major credit cards' :
@JarrydLong
JarrydLong / my-pmpro-send-discount-code-for-expired-members.php
Last active June 20, 2022 08:41 — forked from andrewlimaza/my-pmpro-send-discount-code-for-expired-members.php
Generate a discount code and email it to expired members only.
<?php
/**
* This generates an unique discount code with one use whenever a user expires, for their current level.
* Add the variable !!expired_code!! to the Membership Expired email, to show the code to users.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function pmpro_create_discount_code_on_expiry( $user_id, $level_id ) {
if( $level_id === 2 ) { // change 2 to your trial level
@JarrydLong
JarrydLong / append_profile_page_with_cf7.php
Last active June 9, 2022 08:29 — forked from kimcoleman/append_profile_page_with_cf7.php
Add Contact Form 7 to the Profile page when using the Member Directory and Profiles Add On for Paid Memberships Pro.
<?php
/**
* Add Contact Form 7 to the Profile page when using the Member Directory and Profiles Add On for Paid Memberships Pro.
* Update line 36 with the correct CF7 shortcode for your desired form to display.
* Add a hidden field to your form: "[hidden send-to-email default:shortcode_attr]".
* Set the "To" field of the Contact Form to "[send-to-email]".
*
*/
// Allow custom shortcode attribute for "send-to-email".
@JarrydLong
JarrydLong / change_choose_your_payment_method_txt_pmpro.php
Last active September 24, 2024 12:29 — forked from andrewlimaza/change_choose_your_payment_method_txt_pmpro.php
Change 'Choose your Payment Method' in Paid Memberships Pro
<?php
/**
* This code is used to change 'Choose your Payment Method' text in Paid Memberships Pro.
* Add the function into your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function change_choose_your_payment( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Choose your Payment Method' :
@JarrydLong
JarrydLong / pmpro-show-adverts-non-members.php
Last active March 29, 2022 05:59 — forked from andrewlimaza/hide-adthrive-members-pmpro.php
Show adverts for PMPro non-members.
<?php
/**
* Displays ads for non-members on your site
*
* 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 / my_pmpro_checkout_start_date.php
Created March 14, 2022 09:07 — forked from strangerstudios/my_pmpro_checkout_start_date.php
PMPro Adjust start date to the first following Sunday.
<?php //do not copy
/*
Adjust start date to the first following Sunday for a specific level
*/
function my_pmpro_checkout_start_date( $startdate, $user_id, $level ){
if( $level->id == 8 ) { //Change to the preferred level you want this to apply to
//which day is it
@JarrydLong
JarrydLong / my-pmpro-adjust-trial-ending-email.php
Last active February 10, 2022 05:51 — forked from andrewlimaza/my-pmpro-adjust-trial-ending-email.php
Disable the trial ending email [Paid Memberships Pro]
<?php
/**
* Intends to disable the reminder email
* Add this code to your Code Snippet/Custom Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_adjust_trial_ending_email( $days ) {
return 999; //We don't want to send out reminders
}
add_filter( 'pmpro_email_days_before_trial_end', 'my_pmpro_adjust_trial_ending_email', 10, 1 ); // Trial Ending Soon Emails
add_filter( 'pmpro_email_days_before_expiration', 'my_pmpro_adjust_trial_ending_email', 10, 1 ); // Expiring Soon Emails