Languages: English • 日本語 (Add your language)
Update term based on arguments provided.
<?php wp_update_term( $term_id, $taxonomy, $args ) ?>
<?php wp_update_term(1, 'category', array( 'name' => 'Non Catégorisé', 'slug' => 'non-categorise' )); ?>
The $args will indiscriminately override all values with the same field name. Care must be taken to not override important information need to update or update will fail (or perhaps create a new term, neither would be acceptable).
Defaults will set 'alias_of', 'description', 'parent', and 'slug' if not defined in $args already.
'alias_of' will create a term group, if it doesn't already exist, and update it for the $term.
If the 'slug' argument in $args is missing, then the 'name' in $args will be used. It should also be noted that if you set 'slug' and it isn't unique then a WP_Error will be passed back. If you don't pass any slug, then a unique one will be created for you.
Any of the following $args will be updated on the term:
Since: 2.3.0
wp_update_term() is located in wp-includes/taxonomy.php
.