Added the line to link to parent ID for Form adding new RFG in custom post, but cannot get the link to work.
<div class="form-group" style= "display:none;">
<label>Opportunity</label>
[cred_field field='@volunteerv2.parent' class='form-control' output='bootstrap' value ='[wpv-post-id]' select_text='--- not set ---' required='true']
</div>
I am displaying the form on a View that displays the parent posts in the loop.
I have pre-populated values on a range of RFG fields above this line and ultimately just want the submit button visible. They are posting to the database, just not linking to the parent post.
Problem is that you're unable to set the parent information from the view itself. I did a sample test here as a proof of concept hidden link
As you can see the form gets the ID of the current page and correctly sets the parent information.
In your view I know there are issues with forms being added to a view loop so I doubt this setup will work.
I would suggest putting the volunteer form on the opportunity page itself and allow the users to click to the Opportunity single page from the listings page.
This will pose an issue given that it doesn't work. What I can do is to perform some replication steps of the issue on my end and see if the is replicable.
If it is then I will escalate to our 2nd tier supporters for further checks and forwarding to our dev team. If a fix is to be provided I won't be able to give an estimate as this can take some time.
Let me know what you think of this. For now the alternative will need to be used.
I'd appreciate that, as it would be great to have this level of functionality. I expected it to work that way, so was quite surprised it is referring to the main post rather that the post in the view loop.
I did a check on this and it works fine in my testing. See screenshot
Can you completely remake your form as a test. Leave the form in its default configuration and just add the [wpv-post-id] shortcode to the parent field like my screenshot
Try it like this and then let me know if the issue still remains. If it does then its perhaps an issue specific to your actual website.
I've managed to find the issue. It is when you are adding the form using the Block Editor and using the Fields and Text container and then adding the form from there.
If you do it outside the block editor the form works.
It can perhaps be something to be looked at by the team, however the correct way to add the form is to use the forms block when using our the gutenburg editor.