Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@kimwhite
kimwhite / change-account-page-text-with-gettext.php
Last active July 7, 2023 12:38 — forked from ipokkel/change-account-page-text-with-gettext.php
Change text strings on PMPro Account page using gettext filter. #pmpro #gettext #account #translate #internatiolization
<?php
/**
* This recipe changes text strings for the PMPro Account Page.
* Can be used to change text or translate specific text strings.
*
* 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/
<?php
// Add this code below to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
add_filter( 'gettext', 'change_my_text_example', 20, 3 );
/**
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function change_my_text_example( $translated_text, $text, $domain ) {
@kimwhite
kimwhite / pmpromd_hide_from_directory_checkout_field.php
Last active June 21, 2021 18:56 — forked from kimcoleman/pmpromd_hide_from_directory_checkout_field.php
This code will add a "Exclude my profile from the member directory" field at membership checkout.
<?php
/**
* This code will add a "Exclude my profile from the member directory" field at membership checkout.
*
* Requires: Member Directory and Profile Pages Add On - https://www.paidmembershipspro.com/add-ons/pmpro-member-directory/
* Requires: Register Helper Add On - https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/
*
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Note: When adding to your Customizations Plugin, be careful not to include the opening php tag on line 1 above.
*/
@kimwhite
kimwhite / change-text-for-checkout-page.php
Last active June 16, 2021 17:38 — forked from ipokkel/change-text-for-checkout-page.php
Change Card Fields on Checkout Page #pmpro #gettext #creditcard
<?php // do not copy this line.
/**
* This recipe will change the credit card text
*
* 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_level_expiring_soon_example.php
Last active June 15, 2021 14:31 — forked from andrewlimaza/pmpro_level_expiring_soon_example.php
Change when user can renew their membership PMPro
<?php // do not copy this line.
/**
* Allow members to only renew if their membership expires in 45 days or less.
*
* 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_move_billing_fields.php
Last active August 20, 2021 12:32 — forked from dparker1005/my_pmpro_move_billing_fields.php
Add message before shipping address fields
<?php // do not copy this line.
/**
* Add a custom Message before the billing info.
*
* 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 / shipping_fields_optional.php
Last active June 10, 2021 18:26 — forked from andrewlimaza/shipping_fields_optional.php
make shipping fields optional PMPro
<?php
/**
* This recipe will unset shipping fields so they are not required
* let you ask custom CSS to hide the asterisk
*
* 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-auto-password-generation.php
Last active March 4, 2025 16:54 — forked from strangerstudios/pmpro-auto-password-generation.php
Auto generate passwords with Paid Memberships Pro
<?php
/*
* Automatically generate password on checkout page.
* Using a snippet from here: https://www.paidmembershipspro.com/increase-conversion-rates-with-a-simplified-checkout/
*/
function my_generate_passwords()
{
if(empty($_REQUEST['password']))
@kimwhite
kimwhite / exclude-discount-woocommerce-categories.php
Last active May 24, 2021 12:43 — forked from andrewlimaza/exclude-discount-woocommerce-categories.php
Change or exclude membership discount by certain category for WooCommerce and Paid Memberships Pro.
<?php // do not copy this line.
/**
* This will give a different global discount or exclude specific category from the membership discount.
* Edit line 15/16 with your category slug. Edit line 34 for your discount.
*
* 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_hide_discount_code_checkout.php
Last active May 20, 2021 20:29 — forked from dparker1005/my_pmpro_hide_discount_code_checkout.php
Hide discount code fields and text regarding discount codes at checkout.
<?php
// Copy from below here
/**
* This recipe hides discount code fields and text
* regarding discount codes at PMPro 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.