Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@kimwhite
kimwhite / pmpro_currencies_Azerbaijani.php
Last active May 1, 2024 18:15 — forked from strangerstudios/pmpro_currencies_ruble.php
Add Custom Currency to PMPro currencies.
<?php
/**
* This recipe will add the Papua New Guinean Kina (K) to the currency dropdown.
*
* 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 / pmpromd-disable-oembed.php
Last active May 1, 2024 13:44 — forked from ipokkel/pmpromd-disable-oembed.php
Remove embeds on the PMPro Member Directory pages. #oembed
<?php
/**
* Remove embeds on the PMPro Member Directory pages.
*
* 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 / sell-courses-addon-packages.php
Last active April 22, 2024 12:34 — forked from andrewlimaza/sell-series-addon-packages.php
Sell PMPro Series through AddOn Packages
<?php
/**
* Adds the AddOn Package post meta to 'Courses' post type.
* Give access if they purchased "Courses" parent container.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function add_pmpro_courses_to_AP( $types ) {
$types[] = 'courses';
@kimwhite
kimwhite / french-canadian-price-format.php
Last active March 27, 2024 15:22 — forked from ipokkel/french-canadian-price-format.php
Change the display format of a price. This example will change the price format display to a Hungary format.
<?php
/**
* Change the display format of a price for a specific currency.
*
* 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-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 / pmpro-billing-fields-optional.php
Last active March 26, 2024 15:51 — forked from andrewlimaza/pmpro-bstate-optional.php
Make some billing fields optional
<?php
/**
* Remove the bstate baddress2 requirement from billing fields generated by PMPro or Address for Free Levels then hide them with CSS
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_remove_bstate_required( $pmpro_required_billing_fields ){
//remove field ID's from array to make fields required
$remove_field = array('bstate,baddress2');
@kimwhite
kimwhite / gettext_checkout_email_in_logged_in_message.php
Last active March 25, 2024 13:21 — forked from ipokkel/gettext_checkout_email_in_logged_in_message.php
Show user's email address in place of the login name in the "Your are logged in as" message on the PMPro checkout page.
<?php
/**
* Replace user's login displayed to email address in the "You are logged in as"
* on the PMPro checkout 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 / generate-username-from-email-pmpro.php
Created February 28, 2024 21:35 — forked from andrewlimaza/generate-username-from-email-pmpro.php
Generate a username during checkout for user [Paid Memberships Pro]
<?php
/**
* Make user name email address the same
* Hide your 'username' field using custom CSS.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_generate_username_at_checkout() {
//check for level as well to make sure we're on checkout page
@kimwhite
kimwhite / remove_confirm_email_password.php
Last active February 23, 2024 13:25 — forked from femiyb/remove_confirm_email_password.php
Remove Confirm Email and Password
<?php
/**
* This recipe will Remove Confirm Email and Confirm Password
*
* 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-tax-pmpro-emails.php
Last active February 21, 2024 08:27 — forked from andrewlimaza/add-tax-pmpro-emails.php
Email Variable Add !!tax!! and !!subtotal!! variable for Paid Memberships Pro email templates
<?php
/**
* Adds an email variable !!tax!! to Paid Memberships Pro emails.
* Only works for email templates that has the !!invoice_id!! variable available.
* Use the Email Templates Admin Editor to add !!tax!! to your email templates.
* Follow this guide to add this code to your site: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*
* Difficulty: Easy
*/
function my_pmpro_email_variable( $data, $email ) {