Creating a new taxonomy term dynamically using PHP
goron - September 6, 2009 - 02:35
Hi,
I'm trying to write a script that saves a new taxonomy term. How should I do this? taxonomy_save_term? taxonomy_term_submit?
thanks.
Hi,
I'm trying to write a script that saves a new taxonomy term. How should I do this? taxonomy_save_term? taxonomy_term_submit?
thanks.
check out these modules
check out these modules:
taxonomy_csv - function
taxonomy_csv_import_lineinstall_profile_api - function
install_taxonomy_add_termboth of them use
taxonomy_save_termYes, that helped. Thanks.
Yes, that helped. Thanks.
Sample Code
Here is the sample code you can use
$new_term_cat = array();$new_term_cat['name'] = 'category name';
$new_term_cat['vid'] = $vid; / / vocab id
$new_term_cat['parent'] = 0;
$new_term_cat['weight'] = 0;
taxonomy_save_term($new_term_cat);
Thanks,
Suro
http://www.drupalextras.com/
Thanks both of you that
Thanks both of you that worked.