Core Function
View Source on Trac ↗ wp_insert_category()
wp_insert_category( mixed $catarr, mixed $wp_error = false ) Updates an existing Category or creates a new Category.
Parameters 1 required
| Name / Type | Description |
|---|---|
| array | $catarr { Array of arguments for inserting a new category. Required |
| $wp_error bool | Optional. Default false. |
Return Value
((int)
(int | WP_Error) The ID number of the new or updated Category on success. Zero or a WP_Error on failure,
depending on param `$wp_error`.
Function Information
Since Version
2.0.0
Source File
wp-admin/includes/taxonomy.php
Advertisement