Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@kimwhite
kimwhite / pmpro-renew-membership-shortcode.php
Last active December 22, 2021 20:23 — forked from travislima/pmpro-renew-membership-shortcode.php
Paid Memberships Pro Renew Membership Shortcode - with options to show within so many days of renewal
<?php
/**
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* The my_pmpro_renew_membership_shortcode is a custom function creating a renew link for members.
* Use the shortcode [pmpro_renew_button] to display the button anywhere on your site where shortcodes are recognized.
*
* @return string A link containing the URL string to renew.
*/
@kimwhite
kimwhite / my_pmpro_has_membership_access_filter.php
Last active December 20, 2021 21:15 — forked from strangerstudios/my_pmpro_has_membership_access_filter.php
Have a Paid Memberships Pro level with access to EVERYTHING for multiple levels
<?php
/*
Give level 1 members access to everything.
Add this to your active theme's functions.php or a custom plugin.
*/
function my_pmpro_has_membership_access_filter($access, $post, $user)
{
if(!empty($user->membership_level) && in_array( $user->membership_level->ID, array( 12, 14 ) ) )
@kimwhite
kimwhite / my_pmpro_email_headers_bcc.php
Created December 13, 2021 22:23 — forked from femiyb/my_pmpro_email_headers_bcc.php
BCC a second email address on PMPro admin emails.
/*
Add bcc for PMPro admin emails.
Change [email protected],[email protected] below to the addresses you want to use.
Add this code to your active theme's functions.php or a custom plugin
a la http://www.paidmembershipspro.com/2012/08/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_email_headers_bcc($headers, $email)
{
//bcc emails going to admins
if(strpos($email->template, "admin") !== false)
@kimwhite
kimwhite / my_pmpro_ipn_check_receiver_email.php
Created December 8, 2021 16:05 — forked from strangerstudios/my_pmpro_ipn_check_receiver_email.php
Allow other receiver/business email addresses for PMPro IPN Messages.
function my_pmpro_ipn_check_receiver_email($check, $email)
{
if($email == '[email protected]' || in_array('[email protected]', $email)) //change email here to the old email
$check = true;
return $check;
}
add_filter('pmpro_ipn_check_receiver_email', 'my_pmpro_ipn_check_receiver_email', 10, 2);
@kimwhite
kimwhite / my-pmpro-account-example.php
Last active December 6, 2021 14:13 — forked from andrewlimaza/my-pmpro-account-example.php
Custom shortcode for account page
<?php
/**
* Copy the function below into your custom plugin / Code Snippets plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Replace [pmpro_account] with [my_pmpro_account]
* This example replaces "Change Password" link to point to site's password-reset URL.
*/
/*
my custom Shortcode to show membership account information
*/
@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 / next_payment_date_account.php
Last active November 30, 2021 19:20 — forked from andrewlimaza/next_payment_date_account.php
Show next payment date under the 'Expiration' field on any page (removed if for account page)
<?php
/**
* Show next payment date under 'Expiration' field on My Membership box
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Works for PayPal Express and Stripe payment gateways.
* www.paidmembershipspro.com
*/
// Change the expiration text to show the next payment date instead of the expiration date
// This hook is setup in the wp_renewal_dates_setup function below
function my_pmpro_expiration_text($expiration_text) {
<?php // do not copy this line.
/**
* This recipe will add a message before the submit button
*
* 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_redirect_places.php
Last active November 3, 2021 18:23 — forked from dparker1005/my_pmpro_redirect_places.php
Will redirect non members from your cpt pages. Useful to lock down the archive page and CPTs
<?php
// Copy from below here
/**
* Will redirect users without a $required_levels away from pages where the request uri begins with '/places/'.
* Useful to lock down the archive page and CPTs of GeoDirectory plugin.
*/
function my_pmpro_redirect_places() {
$request_uri_to_redirect = '/dog-profile';
@kimwhite
kimwhite / pmpro-stripe-order-description.php
Created October 26, 2021 18:05 — forked from greathmaster/pmpro-stripe-order-description.php
Add the membership level ID and name to the Stripe description
<?php // do not copy this line.
/**
* Add the membership level ID and name to the Stripe description
*
* 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/
*/