[Membership] Custom code to add phone field to registration form

I'm trying to add a custom field to the Membership registration form, but haven't had any success with any plugins designed for that; Membership simply does not recognize the added fields.
During a live chat session earlier today, we discovered a custom plugin that one of your developers had made for another member.
But there are several additional fields in there that we don't need. Could you help me adapt that custom plugin so it only adds a Phone field? That would be awesome!

  • ido
    • The Incredible Code Injector

    I’ve “cleaned” the plugin and it adds only the Phone number field to the registration now.
    But the Phone number that is entered is not available to site admin.
    Not in the Account Personal details, Not in the WordPress all Users or the membership-2 members page.
    It will be great if we can add the info that is collected on registration (phone number & first name) to the membership-2 members page
    I’m attaching the Plugin (cleaned) and a picture of page I want to add the info too
    Thanks in advance
    Ido

  • Adam Czajczyk
    • Support Gorilla

    Hello ido

    I hope you're well today and thank you for your question!

    I just tested this plugin and all the fields that it adds are automatically available on "/wp-admin/profile.php" page (or "Users -> Your profile":wink: if you're checking your own profile and on "Users -> All users -> Edit (for a selected user)" if you're checking a profile of some other user.

    They are visible under the "Membership Custom Fields" section (screenshot with original plugin installed):

    They should also be visible in "Personal details" section of user's "Account" page

    and can also be edited if a member click on "Edit" link enxt to "Personal details" on "Account" page

    Take a look at these screenshots above, please. Doesn't it work like this for you or it does but you would want them to be also displayed in some other places? Please advice.

    Kind regards,
    Adam

  • ido
    • The Incredible Code Injector

    Hey Adam,
    Thanks for your reply and effort.
    Yes, all the fields are automatically added just the information did not show.

    I just tried it on a different site and the info is showing on the user’s profile page, so that might have been some conflict or a bug I’ve created (I’ve tested more than 10 other options).

    Is there any way to show the Phone Number on the Membership-2 members page?
    This page:

  • Predrag Dubajic
    • Support

    Hi Ido,

    I'm afraid that there's no easy way of expanding the Members page in the backend in order to add more information and it would require custom development.

    Something like this was done for BuddyPress Xprofile fields so with some changes it should work for your case as well I believe:
    https://gist.github.com/bappi-d-great/5a82e6143a2b057c2c473bba8df90808

    I have also attached API Docs for M2 below and that might help to get started with this.

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.