Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I was just looking at wp_update_term and haven't found any possibility to update the "name" of the term. My scenario is pretty simple: I got some predefined taxonomy terms in a config file like this (just an example):

$taxonomy_terms = array(
  'taxonomy_a' => array( 'term_a', 'term_b', 'term_c' )
 ,'taxonomy_b' => array( 'term_d', 'term_e', 'term_f' )
);

Now i'm trying to update these terms based on their id. So if the id exists, i change just the name.

But here does my problem start: wp_update_term doesn't offer any possibility to update the name of term... Does anybody know of some work around, or do i just oversee something?

Thanks!

share|improve this question

2 Answers 2

up vote 4 down vote accepted

According to wp_update_term() in Codex you pass fields you want to override in $args argument, try passing name in there?

share|improve this answer
    
I remember using name in args to change the name –  Bainternet Jan 31 '11 at 19:10
    
Works. In the meanwhile i checked the core code and found the description in codex beeing wrong. The decribed allowed values for $args is originally just the list of default values from core. It's allowed to pass any term argument, that may exist in a term object there. Thanks! –  kaiser Jan 31 '11 at 21:33

http://stackoverflow.com/questions/1363783/mysql-and-wordpress-query-syntax

share|improve this answer
1  
Please don't just place links without an explanation. Is there a solution on this page? Additional information? You're not actually answering the question. –  EAMann Feb 26 '11 at 14:55
    
@EAMann: i voted it up again. Not because you're not right, but it was one of his first answers. Give him a chance to learn. –  kaiser Feb 26 '11 at 15:15
1  
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. –  Brian Fegter Aug 29 '12 at 16:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.