Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
<?php
/**
* Change the text for PMPro BuddyPress using the gettext filter.
*
* 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-clear-stats.php
Last active September 8, 2023 13:48 — forked from femiyb/clear_stats.php
Clear out all PMPro member and report data.
<?php // do not copy this line
/*
Clear out all PMPro member and report data. (Back up your database first. Use at your own risk!!!)
This will delete all orders, members/level data, and reporting data.
Your levels, discount codes, and settings will remain in place.
All users will remain users (without memberships).
All subscriptions at the gateway will remain active.
To Use:
* Copy this code into your active theme's functions.php or a custom WP plugin.
@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/
*/