The default fields name, slug and description are not term metadata, so you should instead use wp_update_term() to update those fields.
So just replace those three add_term_meta() with:
wp_update_term( $term_id, 'codes', [
'name' => $name,
'slug' => $slug,
'description' => $desc,
] );
Additionally, instead of using $_POST, I would use get_term() to get the details of the term that has just been created. So for example,
$term = get_term( $term_id );
// Catch the term info
$name = $term->name;
$slug = $term->slug;
$desc = $term->description;
Related Posts:
- How to get post’s current parent term ID?
- Copy taxonomy terms from one post to another programmatically
- Hierarchical taxonomy list with modificated term links
- Exclude product attributes from taxonomy terms loop
- update_term_meta() only updating once on certain meta keys
- Show all terms of a custom taxonomy?
- How to find objects by terms
- Display certain amount of posts on taxonomy archive page
- Get used terms by an author as array of strings
- How to get the term before the last from a custom taxonomy?
- Get all taxonomies for all post types
- How do I get taxonomy terms by ID in a specific order
- WP_Query use for a filter with multiple Taxonomies and Terms
- Display Post co-authored in Author Page
- conditional statement for custom taxonomy
- Get taxonomy terms only of the WP_Query current posts
- get_the_terms – only top level
- get_terms orderby numeric
- Rename “Portfolio” slug?
- Query all posts of a custom taxonomy term
- get_term_link() returns incorrect url
- Create a hierarchical taxonomy list in WordPress
- 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?
- How to get original custom taxonomy slug after the slug has been rewritten?
- Get term siblings of current child taxonomy
- List taxonomy term slugs within shortcode (do_shortcode)
- Hide image if taxonomy term is empty
- Isotope Drop Down Categories Filter Function
- Show the section only if custom taxonomy was chosen
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- Create a a form for custom taxonomy terms
- WordPress custom taxonomy
- How to break up php code to avoid echo
- PHP displaying wrong custom taxonomy images
- Trying to display terms from custom taxonomy within function
- 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
- Show related products by attribute based and certain conditions
- Display acf taxonomy attachment
- How to hide a child category and show his parent category
- How do I edit the terms output args or array data?
- How to retrieve taxonomy Metabox fields in frontend
- ACF Taxonomy field values not select in backend
- ACF – Can’t get custom post type by taxonomy
- WordPress search query, how to modify the sql
- New term taxonomy and description in front page. Input’s
- how to display child terms with parent terms in custom taxonomy?
- How to display terms from two taxonomies in one php code?
- Custom Taxonomy as Link
- Pass custom value to custom taxonomy
- Get all the contents of taxonomy and sort by term
- Query specific posts per user selections from dropdown menus
- ISOTOPE – Missing/Invalid Arguement Get Terms
- WordPress different custom tag being displayed in on tag list
- Three different queries on same page
- WordPress taxonomy and terms question
- Put ACF function output code the_terms
- Allow HTML in custom taxonomy description, and show it on front end
- Inserting terms in an Hierarchical Taxonomy
- Modify Term Update Redirection
- How can I select a primary category?
- Check if current term is a child of another term
- Formating the_terms() function output
- WP_Query | Help me create a search term with an ‘OR’ relation?
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- How to get the top most term (top ancestor) of a custom taxonomy child term?
- Get terms ordered by post date
- Add attribute / custom attribute to product in woocommerce
- Show Custom Taxonomy Title
- How to check the terms in single custom post type template
- Get Current Custom Taxonomy ID by Post ID
- Function get_queried_object() return NULL in custom taxonomy
- Custom page archive query by url var calling page twice on one of my custom queries?
- Use get_the_terms to list subcategories of custom taxonomy
- Display Taxonomy Terms in an option tag with value being the slug
- Customising the search function?
- Grab posts by multiple categories
- How to split links generated into an xml sitemap to avoid exceeding 30 sec maximum execution time?
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- Custom Taxonomy Terms in Menu lead to which page?
- Taxonomy term count
- WP_Query – How to query all of post types categories
- WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field
- custom taxonomies not working
- Get Highest and Lowest get_term_meta() value from Taxonomy Term
- Resize $term attachment using url
- switch statement for taxonomy content
- Page 2+ of taxonomy archives does not recognise sort-order from dropdown
- Exclude Custom Post Type from shared Custom Taxonomy
- How to show all of aspecific post type that has taxonomy and a specific term
- get_the_term_list() wanting to loop through the returned values
- How do I organize posts based on their taxonomy?
- How to delete unused terms?
- Trying to add taxonomy terms to search results page
- How to limit number of posts in the certain category and exclude the oldest post automatically
- translating a custom taxonomy term in a shortcode
- how can I get the selected term of a custom taxonomy
- How to list custom taxonomy terms without the hyperlinks?