Create and Manage Affiliates by Membership Level Using AffiliateWP

This code recipe creates affiliates or updates the status of existing affiliates based on their membership level when using AffiliateWP.

The affiliate is created after their membership level is changed to the appropriate level (in the recipe, this is level ID 1). When membership is cancelled or expires, the affiliate’s status is changed to “inactive”.

This page requires a Plus Account or higher.


Already have an account?

Log In

New to this site?

Register Now

Set a Member Author’s Posts to Draft When Membership is Cancelled

If you allow guest authors on your membership site as a feature of membership, this recipe will demonstrate how to automatically change their posts’ statuses to “draft” when membership is cancelled.

This page requires a Plus Account or higher.


Already have an account?

Log In

New to this site?

Register Now

Apply a BuddyPress “Member Type” on Membership Checkout or Level Change

The BuddyPress Add On for Paid Memberships Pro allows you to assign BuddyPress “Member Types” by Membership Level. The code recipe below demonstrates how to create a “member type” in BuddyPress.


The Code Recipe

You can add additional member types in the my_pmpro_bbg_register_member_types () function, then repeat lines 29-33 to define additional level<->member type relationships.

Copy and paste this code recipe into a helper PMPro Customizations plugin.


Assigning a Member Type by Membership Level

Follow the steps below to assign a Member Type (you must first install and configure the BuddyPress Add On for Paid Memberships Pro).

  1. Navigate to Memberships > Membership Levels.
  2. Select a level to edit or create a new level.
  3. Under “BuddyPress Member Types”, select the member types you would like to assign for members of this level.
    Assign BuddyPress Member Types by Membership Level with Paid Memberships Pro WordPress Plugin
  4. Save Settings.

Screenshot: BuddyPress User Profile with “Member Type” Selection

buddypress-member-type