I’ve got 2x CPT – ‘pre-jobs’ and ‘quotes’ which are connected via a relationship field ‘linked_pre_job’
What I’d like to do is have a link on the pre-job post; ‘add new quote’ that takes the user to the ‘quote’ CPT front end form, which automatically links the two instead of relying on the user to make the connection (which I’m sure will increase the chance of user errors).
I thought about passing the pre-job title into the ‘linked_pre_job’ field and hiding that from the end user, but I’m not too sure about how to go about it, I’m not too familiar using GET & if anyone can point me in the right direction that would be great.
I’m assuming that each quotes post will have a number of pre-jobs posts selected under the linked_pre_job relationship field.
So in order to make the connection from the quotes post, you’ll need to search through those fields in each of the pre-jobs posts to make a match with your current quotes post. You’re essentially reversing how things typically work, you’d probably call this a reverse relationship query.
If I’ve interpreted the question correctly, it looks like someone has done exactly this on this question:
No really but thanks for your response, always appreciated.
What I’m trying to do is pre-populate the relationship field so that on the front-end form of the quotes page, it already has the pre-job page connected to it, so that the user doesn’t have to search and click the wrong one by mistake.
Last but not least, we built a 100% PHP based Gutenberg Block API designed specifically for theme developers in the real world creating bespoke and maintainable blocks for future driven projects!https://t.co/bx8HrCwkjF