Skip Navigation

[Resolved] Relationship meta key for frontend posting

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

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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by timM-9 4 years, 7 months ago.

Assisted by: Waqar.

Author
Posts
#1611959

Hello!

I'm using the Fluent Forms plugin to let users place reviews on the frontend. The form creates post in the post type 'reviews', which is in a post relationship with the page where the form is shown. Connecting the types custom fields with the form works great, but setting up the post relationship is a bit more complicated. I can use the post ID where the form is shown as meta value, but I'm not sure which meta key to use to connect the review to the right page.

What meta key do I have to use to achieve this?

Thanks a lot for your help in advance 🙂

#1613397

Hi,

Thank you for contacting us and I'd be happy to assist.

The updated post relationship feature that was introduced in Type 3.0, no longer relies on custom field values to store the related post's information.

To programmatically connect posts in a relationship, the "toolset_connect_posts" function can be used:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts

You can consult the Fluent Forms plugin's documentation or support team, to see if it offers any hook that can be used to process this function, whenever the review form is submitted.

If you're open to a solution that doesn't use a post relationship feature between the pages and review post types, you can simply create a new custom field in your review post type and store the ID of the current page, in that to form a connection.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1613427

Hello Waqar,

Thank you for your fast reply!

That's great, I didn't think about the option of creating a relationship with a custom field. I saved the post id in a new custom field, and created a view filter with a shortcode attribute in which I pass the post id of the page where the view is shown. This works great.

Thanks for your support 🙂