Skip Navigation

[Resolved] autofill post id in cred

This support ticket is created 8 years 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by shirlyk 7 years, 12 months ago.

Assisted by: Luo Yang.

Author
Posts
#381885

I am trying to: i have a content template. inside that i have a view that show random post, and inside the view there is a CRED form.
i want to do a similar thing as in this link: https://toolset.com/forums/topic/auto-fill-parent-field-in-cred-form/page/2/#post-320324

but- instead autofill the Page id, i want to autofill the post id of the current post in the loop.
is that possible?

I visited this URL: https://toolset.com/forums/topic/auto-fill-parent-field-in-cred-form/page/2/#post-320324

#381910

Dear shirly,

In your case, you do not need other custom shortcode, just use the Views shortcode [wpv-post-id] int the CRED form field, for example:

[cred_generic_field field="_wpcf_belongs_parent-slug_id" type="hidden" class="" urlparam=""]
{
"required":0,
"validate_format":0,
"persist":1,
"default":"[wpv-post-id]"
}
[/cred_generic_field]

Please replace "parent-slug" with the slug of the parent post type.

#394018

thanks!

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