Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@kimwhite
kimwhite / show-expiration-date-for-child-in-directory.php
Last active April 20, 2026 14:02
Show enddate in directory pages for child accounts
<?php
/**
* On a child group member's Directory Profile page, replace the membership_enddate
* display value with the Group Leader's expiration date.
*
* Requires: Paid Memberships Pro, Member Directory Add On, Group Accounts Add On.
*
* 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.
@kimwhite
kimwhite / pmprodon_pmpro_donation_recurring.php
Created March 18, 2026 15:32 — forked from kimcoleman/pmprodon_pmpro_donation_recurring.php
Adds recurring donation functionality to the Donations Add On for Paid Memberships Pro: https://www.paidmembershipspro.com/add-ons/donations-add-on/
<?php
/*
* This gist adds recurring functionality to the Donations Add On for Paid Memberships Pro.
* It adds the user-entered 'donation amount' to their recurring billing amount.
*/
//add donation amount to recurring payment amount
function pmprodon_pmpro_donation_recurring( $level ) {
if ( ! isset( $_REQUEST['donation'] ) ) {
return $level;
@kimwhite
kimwhite / bulk-update-users-expiration-date-pmpro.php
Last active February 16, 2026 14:27 — forked from andrewlimaza/bulk-update-users-expiration-date-pmpro.sql
Function to Bulk update user's expiration dates via SQL - Paid Memberships Pro
<?php. // This is an example. Modify for your use. BACKUP your database before running
/**
* Added SQL to a function. Run once then disable.
*
* Bulk update all users to have an expiration date that belong to a specific membership level.
* Visit https://yoursite.com/wp-admin/?my_query=1 when logged in as an admin to have existing users updated.
* Remove this code when finished.
*
* Please update the wp_ prefix to match that of your database as well as the membership_id and enddate value (YYYY-MM-DD).
*
<?php // do not copy this line.
/**
* Force the discount code field to be open on 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.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_open_discount_code_on_checkout() {
@kimwhite
kimwhite / my_pmpro_bcc_membership_recurring_emails.php
Last active January 12, 2026 13:55 — forked from dwanjuki/my_pmpro_bcc_membership_recurring_emails.php
BCC the admin an additional emails on Membership Recurring emails.
<?php
/**
* BCC additional emails on Recurring Payment Receipt emails.
*
* 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/
*/
function my_pmpro_bcc_membership_recurring_emails( $headers, $email ) {
@kimwhite
kimwhite / duplicate_usermeta_to_xprofile.php
Last active January 9, 2026 19:12 — forked from kimcoleman/duplicate_usermeta_to_xprofile.php
Duplicate usermeta fields as xprofile fields. Sync BuddyPress and PMPro
<?php
/**
* This recipe runs a script to sync your PMPro User Fields (stored in usermeta) with BuddyPress xProfile fields.
*
* Add this recipe to a custom plugin, then run it by visiting:
* `/wp-admin/?pmpromm_process=1`
*
* Remove this recipe when finished.
*
* You can add this recipe to your site by creating a custom plugin
@kimwhite
kimwhite / change-set-expiration-date-programmatically.php
Last active December 30, 2025 18:03 — forked from andrewlimaza/change-set-expiration-date-programmatically.php
Programmatically change the Set Expiration Date from Y1 to Y2 when checkout is in October, November or December.
/**
* Adjust the Set Expiration Date Add On programmatically.
* Automatically adjust Y1-12-31 to be Y2-12-31 if the current month is December.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_programmatically_change_set_expiration_date( $raw_date ) {
// No Set Expiration Date, just bail.
if ( empty( $raw_date ) ) {
return $raw_date;
@kimwhite
kimwhite / option_pmpro_showexcerpts_on_pages.php
Last active December 3, 2025 15:43 — forked from kimcoleman/option_pmpro_showexcerpts_on_pages.php
Hide PMPro excerpts on pages, keep them enabled elsewhere.
<?php
/*
* Hide PMPro excerpts on pages, keep them enabled elsewhere.
*
* 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 / add-custom-column-to-post-page-list.php
Last active November 26, 2025 21:05 — forked from strangerstudios/requires_membership_pages_columns.php
Add a "Requires Membership" column to the All Pages and All Post dashboard page to show what levels are required to view. Raw
<?php
/**
* Add a “Requires Membership” column to the Posts and Pages lists in the WordPress admin.
*
* title: Add a “Requires Membership” Column to Posts and Pages
* - shows which membership levels are required to view each post or page.
* layout: snippet
* collection: admin-pages
* category: admin
* link: TBD
<?php // do not copy this line.
/**
* This recipe Changes Billing Address to custom wording
*
* 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/
*/