Simple Membership Plugin › Forums › Simple Membership Plugin › Insert [extra_info] parameter from SWPM API
Tagged: api, create, extra_info, Member
- This topic has 9 replies, 3 voices, and was last updated 5 years, 2 months ago by
jaume.
-
AuthorPosts
-
January 13, 2021 at 12:52 pm #21929
jaume
ParticipantHi, Hey, Good morning, good afternoon, good night to everyone,
I’ve been looking in the forum but haven’t found an answer, so I’ve decided to post a question.
Following the code example in Simple Membership API – Creating A Member Account Using HTTP POST Request I’m able to insert new members from my own code.
It works great, now I would like to add a string into the [extra_info] field of the swpm_members_tbl, as you say in the API documentation page
Parameter names are equal to members_tbl column names and format. Example: if you want to set company name for the user, you just pass company_name parameter
but when I add extra_info optional parameter to the array:
$post_arr = array( 'swpm_api_action' => 'create', 'key' => $my_key, 'first_name' => 'John', 'last_name' => 'Smith', 'email' => 'johns@example.com', 'extra_info' => $my_50_char_string, 'company_name' => $my_50_char_string, );It doesn’t seems to work, the new member is created, but the extra_info field remains empty, but not the company_name that have the same value.
Am I doing something wrong? Didn’t I understand something?
Thank you very much for any help you can provide me.
January 14, 2021 at 9:23 am #21939mbrsolution
ModeratorHi,
The parameter name extra_info is not currently available.
Thank you
January 14, 2021 at 2:03 pm #21941jaume
ParticipantJanuary 14, 2021 at 9:39 pm #21944mbrsolution
ModeratorWhich parameters are you looking for?
Regards
January 15, 2021 at 8:22 am #21951jaume
ParticipantI need to save to every membership an integer value and a string value.
I’m registering the members from a custom code using SWPM membership API.My first think was using the extra_info to store a json array with this data, but The parameter name extra_info is not currently available. What about the column notes.
The member should not see/edit this values.
Thank you very much.
January 15, 2021 at 12:11 pm #21955mbrsolution
ModeratorHi, I have submitted a message to the developers to investigate further your request.
Thank you
January 15, 2021 at 12:18 pm #21956jaume
ParticipantI appreciate it, thank you very much
January 20, 2021 at 1:32 pm #21982jaume
ParticipantSorry to bother you, do you get some information about this?
Thank you very muchJanuary 21, 2021 at 3:10 am #21987admin
KeymasterSorry, What you are looking for is not available in this plugin. What you can potentially do is the following:
Use your own databases table to store the value and keep a reference of the member ID in that table. So it will be like a relational table that can cross reference additional custom data. Alternatively, you can create custom post type and use that to store additional custom data and use the member’s ID as a reference (so you know which data is for which member’s profile).
January 21, 2021 at 9:16 am #21989jaume
Participantok, create my own table it’s a good option, now I need to know how to show the data of my own table on the member edit page, so the administrator can see it.
Regards,
-
AuthorPosts
- You must be logged in to reply to this topic.