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 line | |
/** | |
* Add this to a PMPro customizations or Code Snippets Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
**/ | |
add_action( 'pmpro_mailchimp_listsubscribe_fields', 'my_pmpro_mailchimp_listsubscribe_fields', 10, 2 ); | |
function my_pmpro_mailchimp_listsubscribe_fields( $fields, $user ) { | |
// Get user level | |
$level = pmpro_getMembershipLevelForUser( $user->ID ); |
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 line please | |
/** | |
* This recipe creates a Terms & Conditions checkbox on checkout | |
* with a link to the checkout page instead of displaying | |
* the Terms & Conditions page content on the page. | |
* | |
* This recipe requires that "Require Terms of Service on signups?" | |
* setting in Membershps > Settings > Advanced settings | |
* under "Checkout Settings" is set to "No". |
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 line | |
/* | |
* Customizations to remove all mention of payments/fees/price for a 100% no-charge membership site. | |
* Add this to a PMPro customizations or Code Snippets Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_level_cost_text($text, $level) { | |
if(pmpro_isLevelFree($level)) | |
return ""; |
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 "select all" option inside the Require Membership box | |
* 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_add_select_all_levels() { | |
?> |
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 line. | |
/** | |
* Shortcode [member_content_list] to display pages a current member has access to. | |
* Only shows those pages with explicit membership settings. ie those set with the | |
* "Require Membership" box on pages, CPTs (if the PMPro CPTs plugin is used), and posts. | |
* It does not show those posts restricted by categories. | |
* | |
* 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. |
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 LINE | |
//copy lines 5 onwards into your active theme's function.php or custom plugin for code snippets. | |
function mypmpro_redirect_logout(){ | |
// wp_safe_redirect( '/contact/' ); // use this line to redirect to a specific page on your site | |
wp_safe_redirect( home_url() ); // use this to redirect to your website home page | |
exit(); | |
} | |
add_action('wp_logout','mypmpro_redirect_logout'); |
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 line | |
/* | |
* Remove "Membership Level" on the BuddyPress profile page, and instead only show the membership level name | |
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-* * * customizations/ | |
*/ | |
function my_pmpro_bp_show_level_on_bp_profile() { | |
if ( !function_exists('pmpro_getMembershipLevelForUser') ) { |
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 adds extra checkout data to the Zapier Add On's after_checkout_data trigger payload. | |
* | |
* It is intended for use with the Zapier Integration Add On: | |
* https://www.paidmembershipspro.com/add-ons/pmpro-zapier/ | |
* | |
* 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. |
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 widget to the member directory where users can filter | |
* members based on location and distance. | |
* Requires PMPro Membership Directory > v1.0 + PMPro Membership Maps Add Ons | |
* | |
* 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
function my_pmprorh_init() | |
{ | |
//don't break if Register Helper is not loaded | |
if(!function_exists( 'pmprorh_add_registration_field' )) { | |
return false; | |
} | |
//define the fields | |
$fields = array(); | |
$fields[] = new PMProRH_Field( |