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 | |
$args = array( | |
'labels' => $labels, | |
'description' => __( 'Paid Memberships Pro Add Ons', 'pmpro' ), | |
'public' => true, | |
'publicly_queryable' => true, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'add-ons' ), |
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 //Do not copy this PHP tag into your code. | |
/** | |
* Modify the Theme My Login widget title and user links displayed when using the Memberlite theme | |
* https://memberlitetheme.com | |
* | |
* This code recipe changes the widget's title to "Welcome, Display_Name" for logged in users. | |
* | |
* It also removes the default user links included in the widget and replaces it with | |
* the same links as your "Members" menu as assigned under Appearance > Menus when using Memberlite. | |
* under Memberships > Pages. |
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: Memberlite Customizations | |
Plugin URI: https://memberlitetheme.com/create-a-plugin-for-customizations-to-your-memberlite-site/ | |
Description: A plugin for customizations to your Memberlite setup. | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: https://www.strangerstudios.com | |
*/ |
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 | |
/** | |
* 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', ); | |
return $rec_array; |
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 | |
/* | |
* Code to collect additional donations to specific categories or causes using the | |
* Register Helper Add On for Paid Memberships Pro. | |
* This is a different/independent approach from using the Donations Add On for Paid Memberships Pro. | |
*/ | |
function my_pmpro_checkout_level($level) | |
{ | |
$donation = 0; |
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 | |
/** | |
* Add an excerpt more string to manually created excerpts. | |
*/ | |
function my_memberlite_manual_excerpt_more( $excerpt ) { | |
$excerpt_more = ''; | |
if ( has_excerpt() ) { | |
$excerpt_more = ' <a href="' . get_permalink( ) . '" rel="nofollow">(more...)</a></a>'; | |
} | |
return $excerpt . $excerpt_more; |
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 //Do not copy this PHP tag into your code. | |
/** | |
* Define groups of levels and allow members to select from both levels at checkout. | |
* Useful for offering multiple pricing structures for membership (i.e. Monthly, Annually) | |
* | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
// Define the groups of levels. array(1,2) means that levels 1 and 2 are in a group and options will be shown for both levels at checkout for those levels. | |
global $pmpro_level_groups; |
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 | |
/** | |
* When users cancel (are changed to membership level 0) we give them another "cancelled" level. | |
* Can be used to downgrade someone to a free level when they cancel. | |
* Will allow members to the "cancel level" to cancel from that though. | |
*/ | |
function my_pmpro_after_change_membership_level_default_level( $level_id, $user_id ) { | |
// Set this to the id of the level you want to give members when they cancel. | |
$cancel_level_id = 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 | |
/** | |
* When users expire (and the system changes them to membership level 0) we give them another downgraded level. | |
*/ | |
function my_pmpro_membership_post_membership_expiry( $user_id, $level_id ) { | |
// Set this to the id of the level you want to give members when they cancel. | |
$downgrade_level_1 = array( | |
'user_id' => $user_id, | |
'membership_id' => 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 | |
/** | |
* Hide widgets by widget area ID for protected members only contnet. | |
* Update the $hide_sidebars_array with the array of sidebar IDs you want to filter. | |
* Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
function my_pmpro_widget_display_callback( $instance, $widget, $args ) { | |
// Set an array of widget areas by ID to filter. | |
$hide_sidebars_array = array( 'sidebar-1', 'sidebar-2' ); |