This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: PMPro Member Count Shortcode | |
Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Show the number of members in a level w/a status | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: https://www.strangerstudios.com | |
*/ | |
function pmpro_member_count_shortcode( $attrs = null ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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() ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Define the groups of levels. array(2,3) means that levels 2 and 3 are in a group and options will be shown for both levels at checkout for those levels. | |
global $pmpro_level_groups; | |
$pmpro_level_groups = array( array( 2,3 ) ); | |
// Show the "Select a Payment Plan" box with options at checkout. | |
function pmpro_level_groups_pmpro_checkout_boxes() { | |
global $pmpro_level_groups, $pmpro_level, $discount_code, $wpdb; | |
// No groups found? return. | |
if ( empty( $pmpro_level_groups) || empty( $pmpro_level ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This gist updates the "cancel all memberships" link on the cancel page | |
* to pass the level ids into the page instead of "all". | |
* This will ensure that all the levels are cancelled one by one. | |
* In addition to sending a separate email for each cancellation, | |
* this also ensures the $old_level parameter is sent to the | |
* pmpro_cancelMembershipLevel() function so Add Ons like the | |
* Cancel on Next Payment Date one continue to work. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This recipe is an example of how to change or translate | |
* localized text strings for PMPro Advanced Levels Shortcode. | |
* | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
* | |
* 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //do not copy | |
/** | |
* This recipe lock members into their existing membership. | |
* They won't be able to cancel or sign up for a different membership level. | |
* | |
* Change lines 21 and 45 to the level ID that requires you to be locked in. | |
* | |
* If you don't want to prevent them from cancelling, comment out line 30 with // | |
* | |
* You can add this recipe to your site by creating a custom plugin |
OlderNewer