更新现有类别或创建新类别。
原型
wp_insert_category( array $catarr, bool $wp_error = false )
参数
$catarr
(array)
(Required)
插入新类别的参数数组。 ‘cat_ID’(int)类别ID。非零值会更新现有类别。默认值为0。 ‘taxonomy’(字符串)分类法slug。默认’类别’。 ‘cat_name’(字符串)类别名称。默认为空。 ‘category_description’(字符串)类别说明。默认为空。 ‘category_nicename’(字符串)类别不错(显示)名称。默认为空。 ‘category_parent’(int | string)类别父ID。默认为空。
源文件
路径:“
<?php
...
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/wp_insert_category/