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 | |
/** | |
* The function below will disable any email sent to the Member/User by Paid Memberships Pro. | |
* The admin emails will still be sent as intended. | |
* | |
* 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 a Custom Report to the Memberships > Reports Screen in Paid Memberships Pro. | |
* | |
* For each report, add a line like: | |
* global $pmpro_reports; | |
* $pmpro_reports['slug'] = 'Title'; | |
* | |
* For each report, also write two functions: | |
* pmpro_report_{slug}_widget() to show up on the report homepage. |
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 | |
/** | |
* Dynamically display certain levels on the Membership Levels page based on the current user's active level | |
* This example allows you to show/hide specific levels on the Membership Levels page. | |
*/ | |
/** | |
* Dynamically display certain levels on the Membership Levels page based on the current user's active level | |
* This example allows you to show/hide specific levels on the Membership Levels page. | |
*/ | |
function dynamic_pmpro_levels_array( $levels ) { |
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 | |
/** | |
* Modify the application fee percentage that is charged on Stripe transactions. | |
* | |
* 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 | |
/* | |
* 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'] ); |
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 | |
/** | |
* Use this recipe in conjunction with PMPro bbPress Add On to show the expiration date on single forum user profile. | |
* | |
* 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. | |
* | |
*/ | |
function my_bbp_template_before_user_profile_pmpro_expiration_date() { | |
$user_id = bbp_get_user_id( 0, true, false ); |
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 last payment date and next payment date to the members list and export CSV. | |
* Note that "last payment" value will get the last order in "success", "cancelled", or "" status. (Oddly enough, cancelled here means that the membership was cancelled, not the order.) | |
* | |
* The "next payment" value is an estimate based on the billing cycle of the subscription and the last order date. It may be off from the actual recurring date set at the gateway, especially if the subscription was updated at the gateway. | |
* | |
* 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 | |
/* | |
* Don't show confirm password or email fields on the checkout page. | |
* | |
* 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/ | |
*/ | |
add_filter( 'pmpro_checkout_confirm_password', '__return_false' ); |
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 | |
/** | |
* Example of how to add links to the Member Links list on the Membership Account page. | |
* | |
*/ | |
// Add links to the top of the list | |
function my_pmpro_member_links_top() { | |
//Add the level IDs here | |
if ( pmpro_hasMembershipLevel( array(1,2,3 ) ) ) { |