Core Function
View Source on Trac ↗ wp_insert_term()
wp_insert_term( mixed $term, mixed $taxonomy, mixed $args = array() ) Adds a new term to the database.
Parameters 3 required
| Name / Type | Description |
|---|---|
| $term string | The term name to add. Required |
| $taxonomy string | The taxonomy to which to add the term. Required |
| mixed | (array | string) $args { Optional. Array or query string of arguments for inserting a term. Required |
Return Value
((array)
(array | WP_Error) {
An array of the new term data, WP_Error otherwise.
Function Information
Since Version
2.3.0
Source File
wp-includes/taxonomy.php
Advertisement