Skip Navigation

[Resolved] Add custom field to dropdown connection relation title

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

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 simchaH 2 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#2369691

Hello,

When I go to a post in one of my custom post types, and I want to connect it to another post and create a relationship, I have an issue. Since some of the related posts are duplicated names, the title of the same exact name will show up, and I don't know which to select. Example: Custom Post Type is "Person", there can be 2 people with the same name "John Doe". When I go to connect, it only shows the title which is the persons name - John Doe - so I don't know which is correct.

I have a solution, but I am not sure if it is simple? Each Person post has their own unique address custom field, if I can have the address field display together with the title of the post (IE the persons name), then I will always be able to see which is the correct Person to connect in the relationship. Is there any way to accomplish this?

Thank You,
Sim

#2369839

Hello,

There isn't such kind of built-in feature within Toolset plugins, you can add a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
Our developers will evaluate it

Currently, you might consider to add the "unique address custom field" into post title.
For example, after user save the post, use action hook "save_post" to trigger a PHP function
https://developer.wordpress.org/reference/hooks/save_post/

in this PHP function get the "unique address custom field" value, and change the post title.

More help:
https://developer.wordpress.org/reference/functions/get_post_meta/
https://developer.wordpress.org/reference/functions/wp_update_post/

#2370495

My issue is resolved now. Thank you!