Skip Navigation

[Resolved] How to create custom field with Field type -> Taxonomy like ACF ?

This thread is resolved. Here is a description of the problem and solution.

Problem:

Populate custom field with values from another CPT

Solution:

The user was able to find the solution here
https://toolset.com/forums/topic/dynamically-populate-select-field-with-custom-taxonomy/page/2/#post-820284

This support ticket is created 5 years, 11 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 3 replies, has 2 voices.

Last updated by davidB-40 5 years, 11 months ago.

Assisted by: Shane.

Author
Posts
#1195571
demo-1.JPG

Tell us what you are trying to do?
I'm trying to create a custom field with the field type -> taxonomy to populate this field with the taxonomy terms associated.
In ACF you can simply choose Field type: Taxonomy and after select which taxonomy to display in the custom field.

Is there a similar example that we can see?
Yes the screenshot linked. The custom field is a dropdown linked to the taxonomy by the field type-> taxonomy. If I changed the value in the dropdown and update the post, the taxonomy will changed accordingly to the custom field value.

Note that I don't want to use the checkbox on the side of the screen where the taxonomies are to select it, that's why I want it in a custom field.

#1195580

I found this and it work perfectly,

https://toolset.com/forums/topic/dynamically-populate-select-field-with-custom-taxonomy/page/2/#post-820284

but why don't you put this option in the Custom Field Type instead of having to insert custom PHP to make this work ?

#1195610

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

Thank you for contacting our support forum.

This solution actually works, however it is an undocumented hook. There are talks about either adding it to the docs as there are many requests for it.

However this is not something I can say if will happen or not.

Thanks,
Shane

#1195614

Hi Shane, thank you for your reply.

I discovered that taxonomy can be added from the front-end (add or assign existing taxonomy from post forms).

So I'm alright with that. I was thinking I needed to use custom field for that, my mistake..

Thank you again!