2

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!

1 Answer 1

4

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

2
  • I remember using name in args to change the name
    – Bainternet
    Commented Jan 31, 2011 at 19:10
  • 2
    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
    Commented Jan 31, 2011 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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