Skip to content

Instantly share code, notes, and snippets.

@ipokkel
ipokkel / pmpro-reveal-password.php
Last active March 20, 2024 17:54
Toggle the password visibility on PMPro Checkout, Login, and Signup Shortcode pages by clicking on the FontAwesome eye icon to reveal or hide the password.
<?php
/**
* Password visibility toggle with Fontawesome eye icon.
*
* Adds an eye icon which on click reveals the password.
* This also works for the Signup Shortcode Add On.
*
* This code recipe assumes that the Fontawesome font library is already enqueued.
*
* You can add this recipe to your site by creating a custom plugin
@andrewlimaza
andrewlimaza / mmpu-woocommerce-enable.php
Created April 29, 2021 11:46
Allow user's to hold multiple levels with MMPU and WooCommerce for Paid Memberships Pro.
<?php
/**
* This allows user's to have multiple levels when purchasing via WooCommerce.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
add_filter( 'pmprowoo_mmpu_force_add_level', '__return_true' );
@ipokkel
ipokkel / change-pmprosp-required-password-strength.php
Last active September 27, 2023 00:57
Change PMPro Strong Password's minimum required password strength.
<?php
/**
* This recipe sets the required password strength or length for PMPro Strong Passwords *
* depending on the PHP version and the settings below.
*
* You should set your password strength or length in the SETTINGS section below
* inside the my_pmprosp_password_strength function.
*
* 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.
@ipokkel
ipokkel / my-persistent-login.php
Last active September 30, 2022 16:07
Extend the user's login period if the remember me option was checked at login so users stay logged in for longer periods.
<?php
/**
* This recipe extends the user login period if remember me was checked.
*
* @link https://developer.wordpress.org/reference/hooks/auth_cookie_expiration/
*
* 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/
@dparker1005
dparker1005 / logout_url_redirect_pmpro.php
Created November 20, 2020 16:53
Redirect logout to PMPro login page.
<?php
// Copy from below here...
/*
* Redirect logout to PMPro login page.
*/
function my_logout_url_redirect_pmpro( $logout_url ) {
global $pmpro_pages;
if ( ! empty( $pmpro_pages['login'] ) ) {