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'm using this code. I cannot figure out what the heck is wrong with it?

$args = array(  
    'description',"My Desc",
    'slug' => "My Slug",
    'parent' => 0   
);  
$result = wp_insert_term("Term1", "category", $args);

The result is that term is added, term_taxonomy is added. Slug is added. But the darn description is skipped.

wp_terms:

term_id name            slug            term_group
1       Uncategorized   uncategorized   0
2       Blogroll        blogroll        0
3       Term1           my-slug         0

wp_term_taxonomy:

TT_id  T_id tax        description  parent  count
1      1    category                0           0
2      2    link_category           0           0
3      3    category                0           0
share|improve this question

closed as too localized by toscho Feb 13 '13 at 18:51

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 1 down vote accepted

I was having the same problem the other day, due to a completely different typo ;)

$args = array(  
    'description' =>"My Desc",
    'slug' => "My Slug",
    'parent' => 0   
);  
$result = wp_insert_term("Term1", "category", $args);

Note the corrected 'description' element in the $args array.

share|improve this answer

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