I have a post type called "Unidade", and it has a child post type called "Reserva". The "Reserva" post type is, too, child of the "Cliente" post type. So, when you click, inside the "Unidade" single content type on the link to create the child post, it just cant connect to the right Unidade.
I think it happens because while it has no "Unidade" selector, it has a "Cliente" selector.
How can I create a form that you have a selector for one oh its relations but has the other relation pre selected?
If you need access to the admin, please, tell me and I will send you a login.
Thanks
How can I create a form that you have a selector for one oh its relations but has the other relation pre selected?
Hi, you can specify the ID of the known parent post in the parent field shortcode. Here's an example:
[cred_field field='@volume-chapter.parent' select_text='--- not set ---' class='form-control' output='bootstrap' value='[wpv-post-id id="$current_page"]']
The wpv-post-id shortcode can be modified to insert the ID of the current page, or the ID of the current post in the loop, or any specific post ID.
*Please note, there is currently an issue with setting parent posts in a Form when the Form is displayed in a Layout. If your site uses Layouts, it's recommended to disable the Layout temporarily while we work to resolve this issue.
The form is showed after clicking the create child post link, but for some reason, it does not atomatically set the post as a child of the previous page. I need a shortcode to insert the parent (previous) page, not the current.
Is it possible? If not, I might be able to do it using cookies.
1. Does your site use Layouts? If so, please see the note above.
2. Did you remove the parent field from the form?
3. Is the correct parent post shown as "selected" in the parent field?
I solved using the URL parameter set by the create child post link. I retrieved the parent ID from the URL and used to set the right parent post inside the form. Thanks for yout help!