Skip to content

Instantly share code, notes, and snippets.

@kimcoleman
Last active April 14, 2021 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimcoleman/8112c3ba49ecd556434dd94028f4369e to your computer and use it in GitHub Desktop.
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
<?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' );
@laurenhagan0306
Copy link

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment