Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@kimwhite
kimwhite / my_pmpro_login_replace_welcome_text.php
Last active September 25, 2024 19:23 — forked from dwanjuki/my_pmpro_login_replace_welcome_text.php
Remove "welcome" text from PMPro login page
<?php
/**
* Using gettext to remove the "welcome" text from the PMPro login 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/
*/
@kimwhite
kimwhite / hide-braintree-billing-address-fields.php
Last active September 19, 2024 13:44 — forked from ipokkel/hide-stripe-billing-address-fields.php
Force remove BrainTree billing fields on checkout and billing
<?php // Do NOT copy this line
function hide_address_on_billing_update_if_braintree() {
global $pmpro_pages, $gateway;
// Bail if necessary
if ( empty( $pmpro_pages ) || ( ! is_page( $pmpro_pages['checkout'] ) && ! is_page( $pmpro_pages['billing'] ) ) ) {
return;
}
// Filter out BrainTree billing fields
if ( ! empty( $gateway ) && 'braintree' === $gateway ) {
<?php // do not copy this line.
/**
* This recipe will redirect non-members from your blog page if all of the post are protected and you have hidden from non-memberts.
*
* 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/
*/
@kimwhite
kimwhite / my-pmpro-custom-email-varialbe.php
Created September 9, 2024 18:06
This recipe creates an email variable for the current date.
<?
/**
* This recipe creates an email variable for the current date.
* !!current_date!! will show the current date in the confirmation 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/
*/
@kimwhite
kimwhite / one_time_trial_delay_pmpro_registration_checks.php
Last active September 5, 2024 13:12 — forked from travislima/one_time_trial_delay_pmpro_registration_checks.php
Offer one-time trials using the Subscription Delays Add On - updated for an array of Level IDs
<?php
/**
* This code stores data when a user checks out for a level. Updated for an array of Level IDs
* If that user tries to checkout for the same level, the Subscription Delay is removed.
* The user is instead charged for their first subscription payment at checkout.
*
*/
// Record when users gain the trial level.
function one_time_trial_save_trial_level_used( $level_id, $user_id ) {
@kimwhite
kimwhite / pmpro_mailchimp_merge_fields.php
Last active August 21, 2024 19:14 — forked from dparker1005/pmpro_mailchimp_merge_fields.php
Creates a new merge field in Mailchimp if one doesn't already exist.
<?php
// Add Zip to Mailchimp
// Copy from below here...
/*
* Creates a new merge field in Mailchimp if one doesn't already exist.
*/
function my_pmpro_mailchimp_merge_fields( $merge_fields ) {
// Adds a "COMPANY" merge field to Mailchimp.
//$merge_fields[] = array('name' => 'COMPANY', 'type' => 'text');
@kimwhite
kimwhite / my_pmpro_require_group_code_to_register.php
Last active October 29, 2024 17:39 — forked from dwanjuki/my_pmpro_require_group_code_to_register.php
Require a group code to register for a level
<?php // copy from below
/**
* Set multiple levels to require Group code.
*
* 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/
*/
@kimwhite
kimwhite / pmpro-groupleader-child-expiration.php
Created July 26, 2024 14:39
This recipe will show the Group Leaders Expiration Date for the child's membership level.
<?php
/*
* Show the Group Leaders expiration for the child in various places on frontend and admin pages in PMPro.
*
* 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 line.
/**
* This recipe will send specific user fields to your Stripe payment description
* This will only appear on the initial payment, not recurring orders
*
* 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/
*/
@kimwhite
kimwhite / my-pmpro-generate-affiliate-code.php
Last active August 13, 2024 15:13
This function adds a default commissionrate when creating affiliate code at checkout.
<?php // do not copy this line.
/**
* This recipe will allow you to set a default commission when using "Automatically create affiliate code?".
* This setting can be found in your level settings.
*
* For use with Affiliate Add On https://www.paidmembershipspro.com/add-ons/pmpro-lightweight-affiliate-tracking/
* 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/