Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@kimwhite
kimwhite / reset-pmpro-visits-views-logins.php
Last active January 10, 2023 21:34 — forked from ipokkel/reset-pmpro-visits-views-logins.php
Reset visits, views logins and sales and Revenue for Paid Memberships Pro.
<?php
/**
* Add http://yoursite.com/wp-admin/admin.php?&pmpro_reset_analytics=1 to your url while logged in.
* Add this code to your Code Snippets / Custom Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* You may remove this code from your site when you don't need it any longer.
*/
function my_pmpro_reset_visit_data() {
// Check if URL parameter pmpro_reset_analytics is set
if ( isset( $_REQUEST['pmpro_reset_analytics'] ) ) {
@kimwhite
kimwhite / show-renewal-link-after-X-days-or-less.php
Last active January 3, 2023 15:20 — forked from travislima/show-renewal-link-after-X-days-or-less.php
Change when to show the renewal link on Paid Memberships Pro account page.
@kimwhite
kimwhite / pmpro_after_checkout_gift_level_set_expiration.php
Last active January 2, 2023 19:33 — forked from strangerstudios/pmpro_after_checkout_gift_level_set_expiration.php
Code to get PMPro Gift Levels and PMPro Set Expiration Dates to play together nicely.
<?php
/*
This should allow you to set a calendar end date to work with Gift Memberships.
Use at your own risk.
If a gift level is purchased, copy the set expiration date if applicable.
Must have Gift Membership Add On and with Set Expiration Date being used.
*/
function pmpro_after_checkout_gift_level_set_expiration($user_id)
{
@kimwhite
kimwhite / show-renewal-link-on-30-days-or-less.php
Created December 15, 2022 14:36 — forked from andrewlimaza/show-renewal-link-on-30-days-or-less.php
Change when to show the renewal link on Paid Memberships Pro account page.
@kimwhite
kimwhite / stop_users_from_logging_in_pmpro.php
Last active November 23, 2022 14:13
Stop users from logging in if they are not validated (PMPro Email Confirmation)
<?php
/**
* This function will stop any user's that aren't validated from logging into your WordPress website.
* This requires PMPro Email Confirmation - https://www.paidmembershipspro.com/add-ons/email-confirmation-add-on/
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Visit https://paidmembershipspro.com for further assistance.
*/
function my_pmpro_check_login( $user, $password ) {
<?php //do not copy
/**
* This code recipe references the custom fields you use on your member profiles
* to ensure that they are geocoded and not the default billing fields.
*
* 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
/**
* This recipe will geocode the custom billing fields we've created during 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 / strike-pmpro-woo-exclude-cats.php
Last active October 27, 2022 20:19 — forked from andrewlimaza/strike-pmpro-woo.php
Strike pricing for WooCommerce and Paid Memberships Pro pricing, with code to exclude categories from being sticked
<?php
/**
* This will add strike through pricing if the membership pricing is available for currrent user viewing Woo store.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
/**
* This will add strike through pricing if the membership pricing is available for currrent user viewing Woo store.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@kimwhite
kimwhite / pmpro-restrict-levels.php
Last active October 24, 2022 19:06 — forked from greathmaster/pmpro-restrict-levels.php
Only show levels on levels page which the original referral page belonged to.
<?php // do not copy this line.
/**
* 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/
*/
/*
Only show levels on level page which the original content belonged to. For example if a site has 3 levels: Bronze, Silver, Gold and
@kimwhite
kimwhite / pmpro-grace-period.php
Last active April 19, 2023 16:15 — forked from travislima/pmpro-grace-period.php
Add a "Grace Period" to a Paid Memberships Pro Membership (After expiration date is met). by level
<?php
/*
* The Code Recipe will add a 15-day grace period to a members membership once the membership expires.
* for specific levels, change line 13 to your level ID
* Add this Code Recipe to a PMPro Customization Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* For more information on Paid Memberships Pro - www.paidmembershipspro.com
*/
function my_pmpro_membership_post_membership_expiry( $user_id, $level_id ) {
// Make sure we aren't already in a grace period for this level