Skip Navigation

[Resolved] post type automatically assigned to a category

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Beda 6 years, 10 months ago.

Assisted by: Beda.

Author
Posts
#605863
example22.jpg

I created a post type "creatures" I want each post to be automatically assigned to a category, without which the user can choose.

as it happens in the settings for the standard wordpress post.

#605965

It's not possible with Toolset or WordPress out of the box.

Uncategorized, added by WordPress Core to every single Post if no category is selected, is a special case.

To have this functionality as well in Custom Taxonomies you would need to add a code snippet which hooks for example into save_post() action.
https://codex.wordpress.org/Plugin_API/Action_Reference/save_post
You can use wp_set_post_terms() or wp_set_object_terms() to update the terms of the post.
https://codex.wordpress.org/Function_Reference/wp_set_post_terms
https://codex.wordpress.org/Function_Reference/wp_set_object_terms

There is no possibility from within the GUI to achieve this.

The forum ‘Types Community Support’ is closed to new topics and replies.