query.insert_term

/ Database / query.insert_term

Title : query.insert_term
Purpose : Adds a new term to the database. Optionally marks it as an alias of an existing term.
Syntax :
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 :
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.

 

Categories
Most Popular

Leave a Reply

Your email address will not be published. Required fields are marked *