This file contains hidden or 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
/* | |
Don't send membership expiring or expired emails for certain levels. | |
Place this code in your active theme's functions.php or a custom plugin. | |
*/ | |
function disable_membership_expiring_emails_for_some_levels($recipient, $email) | |
{ | |
//check template | |
if($email->template == "membership_expiring" || $email->template == "membership_expired") | |
{ |
This file contains hidden or 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 | |
require_once( get_template_directory() . esc_attr( "/options_divi.php" ) ); | |
global $options; | |
$epanel_key = "name"; | |
$epanel_value = "Show RSS Icon"; | |
$custom_options = array ( | |
array( "name" => esc_html__( "Show GitHub Icon", $themename ), | |
"id" => $shortname."_show_github_icon", |
This file contains hidden or 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
/* | |
Note the commented out lines below. This is setup now to only disable the expiration warnings email, | |
but if you uncomment the other lines it will disable those scripts. | |
Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
function init_disable_pmpro_crons() | |
{ | |
//remove_action("pmpro_cron_expire_memberships", "pmpro_cron_expire_memberships"); | |
remove_action("pmpro_cron_expiration_warnings", "pmpro_cron_expiration_warnings"); |
This file contains hidden or 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
function my_pmpro_checkout_level($level) | |
{ | |
$current_day = date('j'); | |
$days_in_month = date('t'); | |
$level->initial_payment = $level->initial_payment*(($days_in_month - $current_day)/$days_in_month); | |
return $level; | |
} |
This file contains hidden or 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
/*Creates a PMPro email shortcode for the sponsored members message to use for greater control over location of message. | |
Use !!sponsored_message!! in email checkout body to display. | |
Removes the automatic insertion of message at the top of the email. | |
*/ | |
function my_sponsored_email_shortcode($pmpro_email) | |
{ | |
global $wpdb, $pmprosm_sponsored_account_levels; | |
$user_id = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_email = '" . $pmpro_email->data['user_email'] . "' LIMIT 1"); |
This file contains hidden or 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 | |
//copy lines 5 onwards into your active theme's function.php or custom plugin for code snippets. | |
function my_logout_go_home(){ | |
wp_redirect( home_url() ); | |
exit(); | |
} | |
add_action( 'wp_logout', 'my_logout_go_home' ); |
This file contains hidden or 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: Paid Memberships Pro: Extend membership by new level duration | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: On change of level, modify the end date to add the new level's time | |
Version: 1.0 | |
Requires: 4.5.3 | |
Author: Thomas Sjolshagen <[email protected]> | |
Author URI: http://www.eighty20results.com/thomas-sjolshagen/ | |
License: GPL2 |
This file contains hidden or 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 | |
//Copy lines 5 onwards into your PMPro Customizations plugin -> https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
/** | |
* Add days left to members list | |
*/ | |
function my_pmpro_days_left_members_list_col_header( $theusers ) | |
{ | |
?> |