Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@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;
@kimwhite
kimwhite / pmpro-columns-grid-payment-method-select-checkout.css
Last active June 20, 2022 22:17 — forked from kimcoleman/pmpro-columns-grid-payment-method-select-checkout.css
(with conditionals) Custom CSS for Membership Checkout page with Payment Method Select using CSS Grid: 2 Column Layout for "Account Information" and "Billing Information" sections.
<?php // do not copy this line.
/**
* This recipe adds custom CSS for non-logged in users on screens larger then 768px.
*
* 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_state_country_to_account.php
Created January 20, 2022 19:05 — forked from femiyb/add_state_country_to_account.php
Add State and Country to Account Information
<?php
/**
* This recipe does Add State and Country to Account Information.
*
* 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_member_number.php
Last active December 5, 2022 19:22 — forked from strangerstudios/generate_member_number.php
Code to generate incremental Member Number values for PMPro users/members.
<?php // do not copy this line.
/**
* This recipe creates 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.
*
* 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.
@kimwhite
kimwhite / my-pmpro-change-seat-to-student.php
Last active January 13, 2022 19:36 — forked from femiyb/my-pmpro-change-seat-to-student.php
Change the word "Seat(s)" to "student(s)" for Paid Memberships Pro Sponsored Members Add On.
<?php // do not copy this line.
/**
* This will change all instances of seat(s) to student(s) for the Sponsored Members Add On
* https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/
*
* 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_canadian_tax.php
Last active May 11, 2022 20:33 — forked from dparker1005/my_pmpro_canadian_tax.php
Apply Canadian taxes to Checkouts with PMPro - DEFAULT CHECKED
<?php
/*
* Plugin Name: Paid Memberships Pro - Canadian Tax
* Description: Apply Canadian taxes to Checkouts with PMPro
* Version: .1
* Author: Stranger Studios
* Author URI: http://www.strangerstudios.com
*/
/*
@kimwhite
kimwhite / bulk-update-users-expiration-date-pmpro.php
Last active January 6, 2022 15:00 — forked from andrewlimaza/bulk-update-users-expiration-date-pmpro.sql
Function to Bulk update user's expiration dates via SQL - Paid Memberships Pro
<?php. // TESTING
/**
* Added SQL to a function. Run once then disable.
*
* Bulk update all users to have an expiration date that belong to a specific membership level.
* Visit https://yoursite.com/wp-admin/?my_query=1 when logged in as an admin to have existing users updated.
* Remove this code when finished.
*
* Please update the wp_ prefix to match that of your database as well as the membership_id and enddate value (YYYY-MM-DD).
*
@kimwhite
kimwhite / my_pmprowoo_checkout_level.php
Last active January 4, 2022 14:17 — forked from strangerstudios/my_pmprowoo_checkout_level.php
Get PMPro WooCommerce to work with PMPro Set Expiration Dates
<?php // do not copy this line.
/**
* Get PMPro WooCommerce to work with PMPro Set Expiration Dates
* Mostly assumes annually expiring levels. Use at your own risk.
*
* 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/