Skip Navigation

[Closed] Questions about categories & tags

This support ticket is created 4 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 4 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#1791641

Is it possible to automatically assign a post in a custom post type to an item in a custom taxonomy (category) based on the selection that a user makes on a custom field?

For example, on my site I have a CPT for "Objects," which will include a wide range of different types of content. Because there are so many different types of objects, I will need to have a wide range of custom fields that display based on the selection a user makes on a select menu, such as "doors," "windows," "fences," etc. Additionally, I have a custom taxonomy set up for Objects which includes numerous categories and subcategories, which mirror the options on the select menu. So if a user selects "Doors" from the select menu custom field, can the post automatically be assigned the "Doors" category?

Also, is it possible to automatically add items placed in a child category to its respective parent category?

Additionally, in regard to tags, is it possible to restrict users to using only specific tags that have been specifically set up for a respective CPT? Or is it possible to display the pre-set tag options for users to easily see and select before adding any additional tags?

#1792009

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I would like to clarify first that at what action you want to set the taxonomy value based on the selected custom field value. Is it when you are trying to add/edit the post from backend or using Toolset form?

If you aim to set the taxonomy term dynamically based on the custom field value you select while add/edit post from backed, you will require to use the default WordPress action save_post.

Please check the following Doc:
=> https://toolset.com/documentation/customizing-sites-using-php/updating-types-fields-using-php/

Regarding :
Also, is it possible to automatically add items placed in a child category to its respective parent category?
==>
No, there is no such feature available. This will require custom programming.

Additionally, in regard to tags, is it possible to restrict users to using only specific tags that have been specifically set up for a respective CPT? Or is it possible to display the pre-set tag options for users to easily see and select before adding any additional tags?
==>
Do you talk about admin section or for frontend.

#1792261

I would like for the category to be assigned when adding / editing posts from either the front end or the back end. Most of my site's users will be adding posts from the front end, but myself and a few other admins will add things from the back end when necessary. So to answer your question, front end via a form is most important, if only one of the options is available.

#1792705

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - lets take the question and issue one by one.

I will entertain the ticket here with the issue of frontend.

Toolset forms offers the hook "cred_save_data" that you can use in this case.
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

If you can share problem URL and access details and tell me what custom field value you want to assign to what taxonomy that will help me to write the correct code for the cred_save_data hook.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

The topic ‘[Closed] Questions about categories & tags’ is closed to new replies.