Last active
April 14, 2021 03:23
-
-
Save kimcoleman/8112c3ba49ecd556434dd94028f4369e to your computer and use it in GitHub Desktop.
Register BuddyPress member types to be assigned based on Membership Level when using the BuddyPress Add On for Paid Memberships Pro
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 | |
/* | |
* Register BuddyPress member types to be assigned based on Membership Level when using the | |
* BuddyPress Add On for Paid Memberships Pro (https://www.paidmembershipspro.com/add-ons/buddypress-integration/). | |
* | |
* If you are using BuddyPress v2.3+ and would like to use the Member Specific Directory option, | |
* update this function to use the bp_register_member_types hook. | |
* See: https://codex.buddypress.org/developer/member-types/ | |
*/ | |
function my_pmpro_bbg_register_member_types() { | |
bp_register_member_type( 'student', array( | |
'labels' => array( | |
'name' => 'Students', | |
'singular_name' => 'Student', | |
), | |
) ); | |
bp_register_member_type( 'faculty', array( | |
'labels' => array( | |
'name' => 'Faculty', | |
'singular_name' => 'Faculty', | |
), | |
) ); | |
} | |
add_action( 'bp_init', 'my_pmpro_bbg_register_member_types' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "Apply a BuddyPress “Member Type” on Membership Checkout or Level Change" at Paid Memberships Pro here: https://www.paidmembershipspro.com/apply-a-buddypress-member-type-on-membership-checkout-or-level-change/