wp_insert_category


wp_insert_category ( $catarr, $wp_error = false )

Parameters:
  • (array) catarr { Array of arguments for inserting a new category. @type int $cat_ID Category ID. A non-zero value updates an existing category. Default 0. @type string $taxonomy Taxonomy slug. Default 'category'. @type string $cat_name Category name. Default empty. @type string $category_description Category description. Default empty. @type string $category_nicename Category nice (display) name. Default empty. @type int|string $category_parent Category parent ID. Default empty. }
  • (bool) wp_error Optional. Default false.
Returns:
  • (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`.
Defined at:
Change Log:
  • 2: .
  • 3: .

Description

Updates an existing Category or creates a new Category.

Related Functions

wp_insert_term, wp_delete_category, wp_list_categories, wp_create_category, in_category

Top Google Results

User discussions

wpseek mobile