Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@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/
*/
@kimwhite
kimwhite / my_pmpro_require_url_param_for_checkout.php
Last active March 7, 2022 18:37 — forked from dparker1005/my_pmpro_require_url_param_for_checkout.php
Redirect away from the checkout page if a specific parameter is not in the URL
<?php
<?php // do not copy this line.
/**
* This recipe will send a user with no level straight to the LEVEL 1 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/
@kimwhite
kimwhite / stop-renewing-members-multiple-levels.php
Created March 4, 2022 13:25 — forked from MaryOJob/stop-renewing-members-multiple-levels.php
Stop different members on different levels from renewing their current membership level [Paid Memberships Pro].
<?php // Do not copy this line
/**
* Stop members from renewing their current membership level.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
/**
* Stop members from renewing their current membership level.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
@kimwhite
kimwhite / make_old_posts_free.php
Last active February 23, 2022 20:27 — forked from strangerstudios/make_old_posts_free.php
Make any post older than 7 days, form a specific category available for free with Paid Memberships Pro.
<?
/*
Make any post older than 7 Days available for free.
*/
function make_old_posts_free($hasaccess, $post, $user, $post_membership_levels)
{
//if they already have access, let them at it
if($hasaccess)
@kimwhite
kimwhite / generate_member_number.php
Last active February 23, 2022 16:11 — forked from strangerstudios/generate_member_number.php
Modified: Generate a "Member Number" for PMPro users at checkout and show it on the PMPro account page.
<?php
/*
Member Numbers
* Change the generate_member_number function if your member number needs to be in a certain format.
* Member numbers are generated when users are registered or when the membership account page is accessed for the first time.
*/
//Generate member_number when a user is registered.
function generate_member_number($user_id)
{
@kimwhite
kimwhite / hide_prices_woo_pmpro.php
Last active February 7, 2022 14:39 — forked from andrewlimaza/hide_prices_woo_pmpro.php
Hide prices + add to cart button for non members and some levels Paid Memberships Pro and WooCommerce
/**
* Hide prices + add to cart from non members and some levels Paid Memberships Pro.
* Modify line 29 - Add Level ID of user who CAN purchase from your store
* Add this custom code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*
*/
function remove_my_woo_prices( $price, $product ) {
global $pmprowoo_product_levels;
@kimwhite
kimwhite / my_pmpro_change_text_page_example.php
Last active February 2, 2022 15:55 — forked from MaryOJob/my_pmpro_change_text_page_example.php
Change PMPro Wording on Edit Profile Page
<?php
/**
* This recipe changes the text 'Cancel' only on the Edit Profile Page because the word also appears on the Membership accounts page
* This should be added to a PMPro Customizations or Code Snippets Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Thank you to Ronald, for assisting in writing this snippet.
**/
function pmpro_init_cancel_gettext() {
add_filter( 'gettext', 'pmpro_change_cancel_text_gettext', 10, 3 );
@kimwhite
kimwhite / hide_discount_code_checkout.php
Last active January 31, 2022 13:25 — forked from andrewlimaza/hide_discount_code_checkout.php
Hide Discount Code For Multiple PMPro Level
<?php
/**
* Hide discount code link on checkout for a specific levels Paid Memberships Pro.
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Visit www.paidmembershipspro.com for more info.
*/
function pmpro_hide_discount_level() {
global $pmpro_pages;