Skip Navigation

[Resolved] How to use custom fields from 3rd-party plugins in CRED forms

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to use custom fields from 3rd-party plugins in CRED forms

Solution:
Use generic fields with the same slug. If you need the value of the field to be saved to the database, add the option "persist":1

Relevant Documentation:
https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/

This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by dmitryK-2 6 years, 2 months ago.

Assisted by: Nigel.

Author
Posts
#608321
Screen4.jpg
Screen3.jpg
Screen2.jpg
Screen1.jpg

I am trying to: Add user-meta fields by 3rd party plugin which are stored in wordpress db as to metafields (screen 1) - cjl_birthday and cjl_birthmonth (both are numbers from 1-31 or 1-12 respectively). I need user updates them by CRED form.

For some reasons I can't see them in Toolset>Settings>Front-End Content> Hidden Custom Value (screen3).

I've tried to add them with shortcodes (screen 2 ) no luck.

my CRDE frm looks like this ('your-bdate' field works fine via User Fields settings, problem is with cjl* fields):

[creduserform class='cred-user-form cred-keep-original']

	[cred_field field='form_messages' value='' class='alert alert-warning']

	<div class="form-group">
		<label>Дата Вашего рождения</label>
		[cred_field field='your-bdate' post='user' value='' urlparam='' class='form-control' output='bootstrap']</div>

[types usermeta="cjl_birthday"][/types]
[types usermeta="cjl_birthmonth"][/types]

[cred_field usermeta="cjl_birthday"]
[cred_field usermeta="cjl_birthmonth"]

	[cred_field field='form_submit' value='Сохранить' urlparam='' class='btn btn-primary btn-lg' output='bootstrap']
[/creduserform]

A page where the issue can be seen: screen4

Please can you please help too find a solution.

#608445

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Dmitry

The option to show hidden fields doesn't help you here because hidden fields have a name beginning with underscore (e.g. "_hidden"), so your fields are not hidden.

The cred_field shortcode is intended for use with Types fields.

For 3rd-party custom fields you need to use generic fields: use the Add Generic Fields button and enter the field slug for it to generate the required markup with the options in JSON format.

Note, though, that generic fields are not normally saved to the database. If you want the field to be saved, you must add the option "persist" : 1, to the existing options inserted.

https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/

#616977

Great job! Thank you

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.