Sorted using this:
To set to active:
<?php $post_id = 58;
$tag = array( 661 );
wp_set_post_terms( $post_id, $tag, 'status' ); ?>
To set to inactive:
<?php $post_id = 58;
$tag = array( 662 );
wp_set_post_terms( $post_id, $tag, 'status' ); ?>
Related Posts:
- Show all terms of a custom taxonomy?
- How to Add Custom Fields to Custom Taxonomies in WordPress CLEANLY
- Creating custom Woocommerce attribute taxonomies from a plugin
- How to paginate a list of custom taxonomy terms?
- WP_Query | Help me create a search term with an ‘OR’ relation?
- Get used terms by an author as array of strings
- How to get the term before the last from a custom taxonomy?
- WP_Query use for a filter with multiple Taxonomies and Terms
- Display Post co-authored in Author Page
- Include a specific post to the query_posts and remove it if it is already in the returned list
- Add attribute / custom attribute to product in woocommerce
- How to add custom taxonomy slug in CPT permalink?
- Show Custom Taxonomy Title
- get_the_terms – only top level
- Get Custom URL For Custom Taxonomy
- get_terms orderby numeric
- Sum custom field values of particular taxonomy
- Query all posts of a custom taxonomy term
- get_term_link() returns incorrect url
- Create a hierarchical taxonomy list in WordPress
- Randomly Assign an Image’s Alt Text Based on Data From Post
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- Grab posts by multiple categories
- How to get original custom taxonomy slug after the slug has been rewritten?
- Displaying custom taxonomy on WooCommerce product page
- How to split links generated into an xml sitemap to avoid exceeding 30 sec maximum execution time?
- How to get post’s current parent term ID?
- multiple taxonomy select display only one in front end
- Display parent and child taxonomies in separate drop down select fields
- How to show only subcategories in parent category not parent category?
- need help with existing code showing subpages
- Custom field values to taxonomy terms
- Pull Tags But Not as Links
- Copy taxonomy terms from one post to another programmatically
- working with term_relationships table
- How to filter custom taxonomy term name, slug, and description?
- Ajax filter button display all posts
- Hierarchical taxonomy list with modificated term links
- Use get() method to grab all categories and output inside another method
- Show the section only if custom taxonomy was chosen
- Exclude product attributes from taxonomy terms loop
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- Listing titles and custom fields of entries within subcategories
- fetch woocommerce product with custom taxonomy
- Create a a form for custom taxonomy terms
- Creating a Category Taxonomy
- Check in which custom taxonomy belongs and change the style
- WordPress custom taxonomy
- making php value numeric
- How to break up php code to avoid echo
- Taxonomy term description with style, only if the description exists?
- PHP displaying wrong custom taxonomy images
- WordPress: Displaying all the post tags from within a specific taxonomy’s term
- how to insert content into my taxonomy
- Woocommerce Custom Meta Boxes- How to only display if they actually have content
- Hi need update in my terms for other taxonomy
- How to change the author box selection on a post to a custom taxonomy
- WordPress: Export/Import Yoast meta title & description to custom taxonomy
- WP_Query – How to query all of post types categories
- Show related products by attribute based and certain conditions
- Display acf taxonomy attachment
- How to hide a child category and show his parent category
- Get taxonomy terms that share a common object property
- How to retrieve taxonomy Metabox fields in frontend
- WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field
- How to add Text before my Custom Term and hide it when empty
- Categories does not show Block editor WordPress
- ACF – Can’t get custom post type by taxonomy
- custom taxonomies not working
- Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error
- How to separate the taxonomies list from the form so that editing taxonmies is the same as pages and posts?
- WordPress search query, how to modify the sql
- Using Sprit-sheet on WordPress categories
- Add Custom Taxonomy into Script
- How to insert text into post based on category – via single.php file
- Get Posts by Custom Taxonomy on Custom Post
- str_replace not preserving whitespace
- How to replace hard-coded list of custom taxonomy terms based on custom field query [closed]
- enumerating custom taxonomies?
- how to display child terms with parent terms in custom taxonomy?
- Custom Taxonomy Link Text Echo Name Not Slug
- Custom Taxonomy as Link
- WordPress Rewrite Issue
- Limit Taxonomy Parents
- Page 2+ of taxonomy archives does not recognise sort-order from dropdown
- Get category id for a custom category and display it in a class
- Saving category as insert post
- How to show all of aspecific post type that has taxonomy and a specific term
- Query specific posts per user selections from dropdown menus
- How do I change the Go To Categories link in the term_updated_messages
- Display terms on product page with shotrcode
- Query posts by custom taxonomy slug in WP REST API?
- How can I change the URL via add_rewrite_rule()
- WordPress different custom tag being displayed in on tag list
- Get category name of current post (CPT UI)
- Three different queries on same page
- I want to show image from custom field image on my custom page template
- How do I organize posts based on their taxonomy?
- How to make multiple custom taxonomies sit under custom post type slug?