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' ); |
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 //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
/* CSS Document */ | |
#pmpro_payment_method span a { | |
background-position: left bottom; | |
background-size: contain; | |
background-repeat: no-repeat; | |
display: inline-block; | |
margin-left: 1%; | |
max-width: 300px; | |
padding-bottom: 60px; | |
text-align: left; |
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 | |
/* | |
* This gist adds recurring functionality to the Donations Add On for Paid Memberships Pro. | |
* It adds the user-entered 'donation amount' to their recurring billing amount. | |
*/ | |
//add donation amount to recurring payment amount | |
function pmprodon_pmpro_donation_recurring( $level ) { | |
if( isset( $_REQUEST['donation'] ) ) { | |
$donation = preg_replace( '[^0-9\.]', '', $_REQUEST['donation'] ); |
NewerOlder