Custom registration/profile fields for Membership2

How can I add custom profile fields for Membership2? It should be also in the registration form.

  • Katya Tsihotska

    Hi Robert

    Hope you had a good day!

    Since this is dealing with more advanced coding topics, I'm going to ping our SLS Team (code experts) to get their valuable feedback on this issue. One of our SLS members will reply back here as soon as more information is available.

    Please keep in mind that our SLS Team deals with more complicated issues, thus it may take a little longer for them to reply here. Thank you for your patience while we look into this further.

    Kind regards,
    Katya

  • Panos

    Hey there Robert ,

    Membership plugin provides several ways to override these pages.

    1. With BuddyPress. In the add-ons you will find a BuddyPress Integration add-on. This requires that you have installed and activated BuddyPress plugin.

    2. With Gravity Forms, please read here : https://premium.wpmudev.org/forums/topic/gravity-forms-and-membership-pro-2 and this snippet might be handy:
    https://gist.github.com/bappi-d-great/cd8edd4aa6406c1543306d3c596ed59b

    3. The plugin provides a templating system so you can override default files. To make this work copy the files you need from membership/app/view/templates. In your case these would be membership_account.php and membership_registration_form.php.

    In your theme folder create a new folder and name it membership2 and paste the files you want to override in this folder. Then you can modify as you wish, thought it might require careful coding here.

    4. And my favorite, using hooks. I prepared a mu-plugin which uses plugin's hooks. You can download it from here:
    https://gist.github.com/wpmudev-sls/62350b236e2753c3a434d54beb50d8fa
    and upload it to your wp-content/mu-plugins folder ( you can simply create it if it doesn't exist ).

    In that snippet you can add your custom fields in the
    form_fields()
    function. This is the only coding it needs (modify the fields array), there are also some instructions at the bottom as a comment. This is mean to be used as a guide which you can modify as you wish to fit your needs.

    Hope this helped :slight_smile:

    Cheers!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.