View Categories

Developer section

2 min read

DEVELOPERS #

*When new update drops and you do the update, even the MINOR ONES you should redo the whole checkout flow just to ensure that something is not visually broken.
In most cases after update the checkout page is changed.

Child theme #

  1. Frontend #

    1. Locations:
      • In the child theme there is a template folder which is copied from PMPRO Membership plugin:
        /paid-memberships-pro/pages
      • Everything you edit there will be affected on the frontend.
      • For the CSS it is in /src/sass/paid-memberships-pro
      • JOIN page or the page that is the first interaction between anonymous user and the platform in order to register is a template located in /tpl-membership-levels-beta-info.php
        • When you/client create a new level and it should be shown in the JOIN page you must add it manually within the “Block/Allow facing certain levels” loop.
    2. I’m dequeueing the pmpro frontend style because we use rem system instead of px.
      That function is written in /inc/theme-setup.php – look for wp_dequeue_style(‘pmpro_frontend’);
  2. Location backend
    1. Most functions /inc/buddyboss-extend/functions/membership_extend.php
    2. In here I will explain it like separation of two parts (also in that file you will have PART 2)
      1. Part 1:
        • Restrict User Profile Access
          • Limits the number of profile views for non-members to 2 per day using cookies.
          • Redirects users to a membership page if they exceed the allowed views.
        • Check Public Profile Access
          • Determines if a user’s profile is public based on whether:
            • The profile belongs to the logged-in user.
            • The user is listed in a predefined “featured creatives” list.
        • Membership Verification
          • Verifies if the current user is a paid member (Level 2) or has basic membership (Level 1).
          • Administrators are granted unrestricted access.
        • Back to Membership Account Link
          • Renders a “Back to Membership Account” button for easy navigation.
        • Invite Link Generation
          • Provides an interface for generating public profile share links, styled as a button.
        • Community Filter Access
          • Checks if a logged-in user has a specific membership level (Level 1) to access community features.
        • Invite Management
          • Fetches and displays invitations sent by the current user:
            • Includes email of the invitee, date invited, and whether the invite was accepted.
            • Filters out group invitations for processing individual invites.
      2. Part 2
        • Inviting New Users:
          • Users can invite others via email.
          • Invitations are logged in a repeater field (membership_invites) in ACF, including metadata such as the invite date and status.
        • Handling Email Invitations:
          • Emails are sent with personalized messages and encrypted URLs containing the inviter’s ID and the invitee’s email.
          • The email templates are customizable and include placeholders for user data.
        • Tracking Invited User Activity:
          • When an invited user registers, their details are updated in the inviter’s membership_invites field.
          • Additional fields track whether the invited user has joined or published their profile.
        • Reward System:
          • If an inviter has successfully referred three members (who also publish their profiles), a discount code is generated for a free month of membership.
          • This resets the count (invited_members_passed_steps) for future reward cycles.
        • Integration with Paid Memberships Pro (PMPro):
          • The system integrates seamlessly with PMPro to assign discounts and handle membership levels.
    3. Other functions are written in /inc/theme-functions.php like:
      • set_beta_tester_cookie
      • my_change_meta_on_payment_received
      • check_user_pmpro_level
      • check_user_pmpro_level_no_admin
      • locked_access_pmpro_custom
      • store_membership_level_and_discount_code_in_acf (hooked on pmpro_after_checkout)
      • process_invite_data_on_pmpro_checkout (checks if user is invited by the client)
      • my_pmpro_applydiscountcode_return_js
      • handle_stripe_payment_errors
    4. As the membership is really crucial part of the platform it goes all around the theme like header.php and footer.php where certain pages are blocked or labels are changed.

Powered by BetterDocs