You’ll want to hook onto the wp_insert_post
action. Once the new post is created, you can then assign it to the taxonomy/term you wish.
It might look something like this:
add_action('wp_insert_post', function($postId, $post, $updatingExisting) {
if( $updateExisting )
return;
// read up on these params at http://developer.wordpress.org/reference/functions/wp_set_post_terms/
wp_set_post_terms( $postId, 'main_podcast', 'qtserie', true);
}, 10, 3);
Depending on what else is happening on your site, you might need to do some checking inside the filter to make sure you’re only updating the posts you want to (this will run on creation of all posts, pages, custom-post-types, etc.
Related Posts:
- Can’t custom taxonomies have same terms (slugs) as categories?
- get_categories for custom post type with a specific custom taxonomy attached
- Order get_terms() By Custom Field
- How can I add the featured image functionality to a custom taxonomy?
- Combine two taxonomies in a hierarchical tree
- Use tag interface for hierarchical taxonomy?
- How to make custom taxonomy check boxes like ‘Categories’
- Different templates for parent and children categories/taxonomies
- cat_is_ancestor_of() for custom taxonomies
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- How to create non-unique sub-category slugs?
- Show Post from parent category (custom taxonomy) ONLY!
- How to convert regular categories to custom taxonomy?
- How to get next previous category in same taxonomy?
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- Getting WordPress custom taxonomy/category?
- Are Custom Taxonomy Templates Possible?
- Display empty taxonomy terms with get_terms()
- Get a list of Terms for a specific category
- Order Taxonomy Term by date created
- How to display a description of a given category from a custom taxonomy
- How to get the number of child categories a specific parent category has?
- How can I convert some categories to a custom taxonomy?
- Category tree is flattened inside admin upon saving
- Get multidimensional array that reflects category hierarchy
- PHP Fatal error: Cannot use object of type WP_REST_Response as array in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
- If statement within PHP echo
- How to know if it’s a child taxonomy?
- Taxonomies for WordPress Media Library [duplicate]
- wp_dropdown_categories and custom taxonomy + custom post type
- Should the actual /category/ directory be 404? Is that normal WP behaviour
- Can you pre-check wordpress categories?
- How to get the id from the custom category?
- One Specific Category To Permalink
- add_rewrite_endpoint returns 404 on archives
- How to organize custom categories for filtering and selecting
- Custom sub taxonomy order by
- Add category only if post has custom taxonomy category
- Categories overview that links to page displaying posts
- How can I edit the ‘Most Used’ tab in the categories meta-box to show another custom taxonomy?
- Get all media categories
- Add child category to parent on post creation and save
- Get Number of total Parent Categories for Custom Taxonomy
- Get posts from specific taxonomy term
- Display custom taxonomy attached to the post on post single page
- Why custom taxomony not showing when create a post?
- Limit categories and it’s subcategories for specific group of users
- Ive got a term (get_term_by) but now I want to filter it by a category it is in?
- Question on using custom structures for categories
- add slug beside name in Admin Category Checklists
- Target a specific category from a custom taxonomy?
- Having a template per category? Bad for server overhead?
- Echo text using is_tag
- custom page for custom Taxonomy
- Custom page category taxonomy 404
- Filter By Category Dropdown List With Custom Taxonomies
- query_posts by category_name and custom taxonomy
- Is it possible to create an alias/custom taxonomy for a category name?
- Showing HTML if Post is In Certain Taxonomy Term
- I need to exclude from a query a category and a few custom taxonomies
- Category link redirect to custom template page instead of index.php?
- How to load several hierarchical categories from functions.php
- Assign a custom post to a custom taxonomy based on custom field value
- Posts not listing out sub category in hierarchy
- Post to inherit custom category background image from parent
- Custom Fields Value As Taxonomy
- How to get posts using category slug in ClassiPress?
- 3.1 post formats and specific categories/custom taxonomies
- Link posts together (relative, not grouped)
- How to fix select filter on category
- Migrate the posts of a category to another blog as a custom taxonomy
- List of post categories only associated to another custom taxonomy
- Page category filter in admin dashboard
- How to set the same base url for two different taxonomies?
- Taxonomy custom check box meta field not getting saved
- Ordering terms whilst in loop
- When creating a new product, auto assign it to all custom taxonomy woocommerce
- Grab all the posts for particular category
- How can i echo next and previous custom category from a Taxonomy
- How to load terms of a custom taxonomy of a product in woocommerce cart page
- Using heirarchial tags or Custom taxonomies
- How to assign Categories and tags inside the TinyMCE Editor for each Image?
- Why use hierarchical taxonomies instead of many custom taxonomies?
- Renaming default category taxonomy?
- Most efficient way to display current post subcategories?
- How to Manage and link certain custom taxonomy?
- Dynamically creating content on custom URL without getting 404
- Display List of Categories Within a Custom Taxonomy
- How to exclude category and post_tag taxonomy while displaying custom taxonomy?
- New Category – custom taxonomy
- How to add a post with new Taxonomy without assigning to default category?
- List Terms by category
- How to create default categories in new installs?
- Most efficient use of custom taxonomies, categories, and pages
- Create Cross Promoting Categories in WordPress Using ‘pre_get_posts’
- Check if value is a custom taxonomy category name
- finding out the top 5 source ( source is a custom taxonomy ), in a given category
- How to Organize my Photo Albums?
- Converting Categories (with ACF fields) to custom taxonomies
- Taxonomy page wpml dropdown not working