Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@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
<?php
/**
* This recipe will let you change the text when a password has been reset
* Line 20 should be changed for your message.
* 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 / 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 / reset_the_default_avatar_size_on_a_page.php
Last active February 22, 2024 12:12
Change the Default Avatar Size when using the Basic Avatar Shortcode
<?php
/*
* by default the WordPress Avatar default size is 96x96
* this code will change default WP size for page 56 (you can change this)
* you can choose a size that is available.
* check your Media settings in WordPress Settings Area.
*/
function my_get_avatar( $avatar, $id_or_email, $size, $default, $alt ) {
// Check if we're on page 56
@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 ) {
@kimwhite
kimwhite / font-awesome-icons-for-member-directory-and-profile-pages.php
Last active February 19, 2024 12:54 — forked from ipokkel/font-awesome-icons-for-member-directory-and-profile-pages.php
Add a Fontawesome 5 icon before a URL link on the PMPro Member Directory and Profile pages.
<?php
/**
* This recipe adds a Fontawesome 5 icon before a custom field containing
* a URL on the Member Directory and Profile pages.
*
* This recipe assumes that Fontawesome 5 support is made available either
* via the active theme or a plugin.
*
* WordPress auto-embeds feeds from certain oEmbed providers, e.g. Twitter.
* https://wordpress.org/support/article/embeds/
@kimwhite
kimwhite / gettext-multiple-memberships-per-user.php
Created September 13, 2023 18:27 — forked from ipokkel/gettext-multiple-memberships-per-user.php
Change or translate text strings for PMPro Multiple Memberships Per User.
<?php
/**
* Change or translate text strings for PMPro Multiple Memberships Per User.
*
* This recipe assumes and requires that both PMPro core and PMPro Multiple Memberships Per User are active.
*
* 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_remove_change_level_link.php
Created January 31, 2024 18:57 — forked from dparker1005/my_pmpro_remove_change_level_link.php
Removes the 'change' button from the PMPro membership account page