Simple Membership Plugin › Forums › Simple Membership Plugin › Custom field using filter..
Tagged: filter for custom field
- This topic has 5 replies, 3 voices, and was last updated 8 years, 4 months ago by
vinaysamant.
-
AuthorPosts
-
January 16, 2018 at 6:21 pm #13001
vinaysamant
ParticipantFilter documentation says :
swpm_before_registration_submit_button : This filter is triggered just before the registration form’s submit button is rendered. It can be used to add extra inputs, HTML code or text to the registration form of the plugin.I just want to add mobile number in registration form using filter. Dont want to use Form Builder module just for this one specific need. Can you kindly guide about this?
January 16, 2018 at 10:25 pm #13005mbrsolution
ModeratorHi, simply add the following code to your themes functions.php file. Make sure you replace the following line I have highlighted in bold with your own text. $output .= ‘This text will get shown just above the submit button.’.
add_filter('swpm_before_registration_submit_button', 'my_custom_code'); function my_custom_code($output) { //Add any extra text or HTML code $output .= 'This text will get shown just above the submit button.'; return $output; }Let me know if you need more help.
Kind regards
January 17, 2018 at 9:50 am #13016vinaysamant
Participanthii…
i know about text.
The documentation says it allows “extra input” on the form. Is it possible to add just one field like mobile that will be captured in process of registration.**i dont want to use form builder module only for this one small requirement.
January 17, 2018 at 10:05 pm #13019mbrsolution
ModeratorHi, I understand your point of view. However at present the only way to achieve this is by the Form Builder addon.
I have submitted a message to the developers to investigate further your request.
Thank you
January 18, 2018 at 4:41 am #13023admin
KeymasterIts a little bit tricky as you also need to use the action hook to insert the data in the database table after the form is submitted. I have never handled this before so I don’t really have a ready-made solution for it unfortunately. You are free to modify the code as you need.
January 19, 2018 at 3:05 am #13038vinaysamant
Participantwhich action hook should be used to insert in data in database? or which function to be modified?
-
AuthorPosts
- You must be logged in to reply to this topic.