Skip Navigation

[Resolved] Reusing taxonomy "Person" within other fields

This support ticket is created 7 years, 2 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)

Author
Posts
#569007

Hi,
I am trying to build a historical website, where certain persons are tagged and connected to different pictures and can be searched etc.
I also have more detailed pages where the persons relationsship is shown (mother, father, childs etc.)

So I created custom posts and fields.
I also created a taxonomy "person" - which I would like to reuse.
Say for example the person is in the picturexx - I just get the person from the taxonomy list.
But If I use fields in order to input the relationship e.g a field for "wife" - I would like to show the same list of persons in order to choose the right person.
Is it possible to use taxonomy entries within fields - in order to choose?

I hope you understand what I want to do / mean.

best regards
Michael

#569146

Dear Michael,

There isn't such a built-in feature within Types plugin or CRED plugin.
If your custom field is a custom select/radio field created with Types plugin, you can setup some custom PHP codes with Types filter hook "wpt_field_options", in this PHP function, get the terms of taxonomy "person":
https://developer.wordpress.org/reference/functions/get_terms/

Then setup the options of the custom select field, see similar thread here:
https://toolset.com/forums/topic/i-wish-i-could-load-a-custom-select-with-options-from-a-custom-taxonomy/#post-284584

#570908

Thanks