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 enddate for members added to level 5 via Zapier | |
* | |
* You can add this recipe to your site by creating a PMPro customizations plugin. | |
* Read this companion article for step-by-step instructions: | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmproza_change_level( $level, $user_id, $old_level_status, $cancel_level ) { | |
if ( empty( $_REQUEST['pmpro_zapier_webhook'] ) ) { |
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 from below here... | |
/** | |
* Changes startdates that are retrieved for members. Useful for implementing custom | |
* content drip schedules when using the PMPro Series Add On. | |
* | |
* @param string $startdate in a timestamp format. | |
* @param int $user_id to get startdate for. |
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 | |
/** | |
* Stop non-approved members from logging in and display a message when using the Approvals Add On | |
* | |
* 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 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 recipe will add a percentage based fee to the initial and recurring value when using PayPal Express | |
* | |
* 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/ | |
*/ | |
function my_pmpro_increase_level_cost_by_percentage_for_gateway( $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
<?php | |
/** | |
* Restricts pages based on category. | |
* Add categories to pages via a plugin: https://wordpress.org/plugins/pages-with-category-and-tag/ | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_restrict_page_categories( $hasaccess, $post, $user, $post_membership_levels ) { | |
global $wpdb; |
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 | |
/** | |
* Remove columns from the Members Export CSV | |
* | |
* 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 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
/* | |
Tell PMPro to filter the_content a bit later. | |
This will sometimes fix issues where theme or plugin elements (e.g. videos) | |
are not being filtered by PMPro. Note that this sometimes will cause | |
some things (e.g. share links) to be filtered that you don't want to be | |
filtered... and sometimes edits to the theme or a child theme are | |
required to get the desired effect. | |
Add this to your active theme's fucntions.php or a custom plugin. |
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 from below here | |
/** | |
* Password visibility toggle on the Member Profile reset password 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/ | |
*/ | |
function my_pmpro_show_password_toggle_member_profile() { |
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 | |
/** | |
* Send trial ending soon emails 3 days before trial ends. | |
* Add this code to your Code Snippet/Custom Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_adjust_trial_ending_email( $days ) { | |
return 3; | |
} | |
add_filter( 'pmpro_email_days_before_trial_end', 'my_pmpro_adjust_trial_ending_email', 10, 1 ); |