Skip to content

Instantly share code, notes, and snippets.

@michaelbeil
michaelbeil / my-pmpro-strong-passwords.php
Last active March 7, 2022 18:16 — forked from ipokkel/my-pmpro-strong-passwords.php
Change the required password length to 8 for Require Strong Passwords
<?php // Do NOT copy this line
/**
* Change pmpro-strong-passwords to require a minimum of 8 characters.
*/
add_filter( 'pmpro_registration_checks', 'my_pmpro_strong_password_check' );
function my_pmpro_strong_password_check( $pmpro_continue_registration ) {
// Don't load this script at all if user is logged in.
if ( is_user_logged_in() ) {
@michaelbeil
michaelbeil / redirect-users-after-logout-wordpress.php
Last active November 10, 2021 14:45 — forked from andrewlimaza/redirect-users-after-logout-wordpress.php
Redirect users to home page after logging out of WordPress
<?php
/**
* Redirect users to home page after logging out of WordPress.
*/
function my_redirect_after_logout_wp(){
wp_redirect( home_url() );
exit;
}
add_action('wp_logout','my_redirect_after_logout_wp');
@michaelbeil
michaelbeil / my_pmpro_payment_method.css
Last active June 8, 2021 09:59 — forked from kimcoleman/legacy_my_pmpro_payment_method.css
Adds credit card logos to the "Select Payment Method" box on membership checkout.
/* CSS Document */
#pmpro_payment_method span {
display: inline-block;
}
#pmpro_payment_method span a {
background-position: bottom left;
background-repeat: no-repeat;
background-size: contain;
border: none;
display: inline-block;
@michaelbeil
michaelbeil / update_currency_per_level.php
Created June 2, 2021 10:54 — forked from strangerstudios/update_currency_per_level.php
Change currencies depending on Paid Memberships Pro level. Add this code to your active theme's functions.php or a custom plugin. This is just an example that will need to be tweaked for your needs.
/*
Change currencies depending on Paid Memberships Pro level.
Add this code to your active theme's functions.php or a custom plugin.
This is just an example that will need to be tweaked for your needs.
Other places to look into swapping currencies:
* Levels page.
* Invoices page.
* In emails.
* In membership levels table in admin.
@michaelbeil
michaelbeil / custom_pmpro_upcoming_recurring_payment_reminder.php
Last active June 23, 2021 08:57 — forked from kimcoleman/custom_pmpro_upcoming_recurring_payment_reminder.php
Filter to modify the days prior to renewal that the Recurring Payment Email Reminders Add On sends members the membership_recurring email notifcation.
<?php
/**
* Filter to modify the days prior to renewal that the Recurring Payment Email Reminders Add On
* sends members the membership_recurring email notifcation.
*
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function custom_pmpro_upcoming_recurring_payment_reminder( $rec_array ) {
$rec_array = array ( 30 => 'membership_recurring', 14 => 'membership_recurring', 7 => ' membership_recurring' );
return $rec_array;