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 lists an account's sponsored members on the Membership Account page. | |
* | |
* It is intended for use with the Sponsord Members Add On: | |
* https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/ | |
* | |
* 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 restrict someone with level 1 changing to level 2. | |
* change line 25 for other level numbers | |
* 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 // Do not copy this line. | |
// Please add this code to your site following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
/** | |
* Parent/Child setup. | |
* Parent = Level ID 1. Child = Level ID 2. | |
* Automatically create 10 uses for the discount code to be shared with parent/child accounts. | |
*/ | |
global $pmprosm_sponsored_account_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 | |
/** | |
* If a user is a parent/sponsor member, set the QR code to the child checkout URL. | |
* This will get the first sponsored level checkout URL and discount code. | |
* Only set the QR code to the checkout URL if there are available seats. | |
* Add this code to your site by visiting - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_membership_card_sponsored_members( $card_user, $option ) { |
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 | |
/** | |
* Set a default membership level when a user expires (only). | |
* This does not set the default level when a user cancels. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_set_default_level_only_when_expiring( $user_id, $level_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
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( |
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
<?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 // 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 // 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'); |