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_registration_checks.php
Last active July 19, 2024 15:25 — forked from strangerstudios/my_pmpro_registration_checks.php
Require a certain level before registering for another level with Paid Memberships Pro.
<?php // do not copy this line.
/**
* This recipe Requires a certain level before registering for another 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.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*
* Edit lines 19,20,33,34 with your site levels. Update message line 22
@kimwhite
kimwhite / pmpro_move_name_fields.php
Created June 1, 2022 13:44 — forked from femiyb/pmpro_move_name_fields.php
Move Name And Last Name fields
<?php
/**
* Add the following code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Move Email And Confirm Email fields before password
*/
function pmpro_move_name_fields() {
global $pmpro_pages;
if(is_page($pmpro_pages['checkout'])) {
@kimwhite
kimwhite / prevent_oembed.php
Last active May 20, 2022 20:35 — forked from dparker1005/prevent_oembed.php
Prevent oembeds from running on a particular page. KEEP Label as url link
<?php
// Copy from below here...
/*
* Prevent oembeds from running on a particular page.
* Can clear oembed cache with steps here: https://siteorigin.com/clearing-oembed-cache/
*/
function my_pmpro_prevent_oembed($result, $url, $args) {
if ( strpos( $_SERVER['REQUEST_URI'] , '/directory/') !== false ) {
@kimwhite
kimwhite / pmpro_set_enddates.sql
Last active May 16, 2022 13:35 — forked from ideadude/pmpro_set_enddates.sql
Set an enddate for active subscriptions with PMPro
# BACKUP FIRST
# This SQL query will set the expiration date
# to 2023-02-01 for ALL active membership including users with active subscriptions who are marked NEVER.
# a different current enddate.
# BACKUP FIRST
UPDATE wp_pmpro_memberships_users
SET enddate = '2023-02-01 00:00:00'
WHERE status = 'active'
@kimwhite
kimwhite / orders-print.php
Created May 13, 2022 20:14 — forked from ipokkel/example-admin-print-invoice-template.php
Custom email print invoice for invoices printed from the administrative page Memberships > Orders. This custom template adds some HTML to show the "Paid To" address on the invoice.
<?php
/**
* Custom Template for Print Invoices
*
* Copy this file into the paid-memberships-pro/pages/ folder of your active theme's directory.
* If that folder does not exist, create it.
* Keep the name orders-print.php
*/
?>
<!doctype html>
@kimwhite
kimwhite / add_password_to_pmpro_checkout_email.php
Last active May 7, 2025 07:36 — forked from andrewlimaza/add_password_to_pmpro_checkout_email.php
Add Password to checkout email for Paid Memberships Pro.
<?php
/**
* Add the user's password to the checkout email for PayPal Express.
* Please be sure to take proper precautions when dealing with user's passwords and sending out emails.
* This is for demonstrative purposes.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function add_password_to_pmpro_checkout_email( $body, $email ) {
@kimwhite
kimwhite / pmpro_after_change_membership_level_default_level.php
Last active April 8, 2022 13:33 — forked from strangerstudios/pmpro_after_change_membership_level_default_level.php
Place a PMPro member in another level when they cancel... unless they are cancelling from that level.
<?
/*
When users cancel (are changed to membership level 0) we give them another "default" level.
Can be used to downgrade someone to a free level when they cancel or expire.
Will allow members to the "default level" to cancel from that though.
*/
function my_pmpro_after_change_membership_level_default_level($level_id, $user_id)
{
//set this to the id of the level you want to give members when they cancel
@kimwhite
kimwhite / pmpro-uk-taxes.php
Created April 4, 2022 14:47 — forked from MaryOJob/pmpro-uk-taxes.php
Gist UK Taxes on Checkout / Invoice / Etc.
<?php
/**
* 1. Adds 20% tax text to the level cost text.
* 2. Adds 20% tax to invoice if checking out as UK customer.
* 3. Adds 20% tax if UK to checkout and invoice.
*
* 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-pmprodon-change-text-for-donation-only-level.php
Last active April 24, 2023 12:38 — forked from ipokkel/my-pmprodon-change-text-for-donation-only-level.php
This recipe changes the level selection text and hides the level cost text if level is a donations only level. $pmpro-donations
<?php
/**
* This recipe changes the level selection text and hides the
* level cost text if level is a donations only level.
* KIM - uplated to include changing the wording of "Membership Level" on the checkout page. line 56
* EDIT line 31 with the ID's of your donation only level(s).
*
* This recipe assumes PMPro Donations is set up and configured.
* @link https://www.paidmembershipspro.com/add-ons/donations-add-on/
*
@kimwhite
kimwhite / pmpro-defult-country-code.php
Last active March 27, 2024 13:52 — forked from pbrocks/pmpro-defult-country-code.php
Code to add to pmpro-customizations.php to adjust default country for Billing and for PMPro VAT
<?php // do not copy this line.
/**
* This recipe Default to country code for Germany AND add Default VAT country
* When using VAT TAX Add On https://www.paidmembershipspro.com/add-ons/vat-tax/
*
* 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/
*/