query.insert_term
/
Database /
query.insert_term
By Amit Singh. Posted on
Title |
: |
query.insert_term |
Purpose |
: |
Adds a new term to the database. Optionally marks it as an alias of an existing term. |
Syntax |
: |
|
[query.insert_term terms="term_name" taxonomy="taxonomy_name" alias_of="value" description="value" parent="parent_id" slug="term_slug" /] |
|
Input Parameters |
: |
- term: (int|string) (required) The term to add or update. Default: None
- taxonomy: (string) (required) The taxonomy to which to add the term. Default: None
- alias_of: (string) (optional) There is no default, but if added, expected is the slug that the term will be an alias of. Default: None
- description: (string) (optional) If exists, will be added to the database along with the term. Default: None
- parent: (numeric) (optional) Will assign value of ‘parent’ to the term. Default: 0 (zero)
- slug: (string) (optional), Default: None
|
Return Value |
: |
It returns an array containing the term_id and term_taxonomy_id |
Example 1 |
: |
Code |
: |
|
[query.insert_term terms="term_name" taxonomy="category" /] |
|
Output |
: |
It returns an array containing the term_id and term_taxonomy_id |
Description |
: |
The above example code will output terms matching the term_id. As single param is not passed it has return array of single metadata value. |
|
Last Modified By abhishek.