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 | |
// Adds the BGN currency to currency list. | |
function pmpro_currencies_bulgarian( $currencies ) { | |
$currencies['BGN'] = __( 'Bulgarian Lev', 'pmpro' ); | |
return $currencies; | |
} | |
add_filter( 'pmpro_currencies', 'pmpro_currencies_bulgarian' ); |
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. | |
/** | |
* This recipe adds custom CSS for non-logged in users on screens larger then 768px. | |
* | |
* 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/ | |
*/ |
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 | |
// Add this code below to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
add_filter( 'gettext', 'change_my_text_example', 20, 3 ); | |
/** | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
*/ | |
function change_my_text_example( $translated_text, $text, $domain ) { |
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 function simply edits the text 'Make a Gift' for PMPRO Donations Add-On | |
Please paste this function in your functions.php or custom plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_donations_change_text( $change_text, $text, $domain ) { | |
switch ( $change_text ) { | |
case 'Make a Gift' : | |
$change_text = __( 'Make A Legislative Contributionn', 'pmpro-donations' ); //edit 'Make A Legislative Contribution' to edit the text output of 'Make a Gift' |
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 | |
/** | |
* By default cancelled members are changed to level 0. This recipe changes that behavior to give them a "cancelled" level that | |
* you have created for that purpose. Can be used to downgrade someone to a free level if they cancel. | |
*/ | |
/** | |
* [pmpro_after_change_membership_level_default_level description] | |
* | |
* @param [type] $level_id [description] | |
* @param [type] $user_id [description] |
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 |
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 | |
/** | |
* 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 | |
// 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 ) ) { |