wp_delete_category()
wp_delete_category( int $cat_ID )
删除一个现有类别。
Deletes one existing category.
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$cat_ID | (int) | 类别术语ID。 |
源码(Source)
/** * Deletes one existing category. * * @since 2.0.0 * * @param int $cat_ID * @return bool|int|WP_Error Returns true if completes delete action; false if term doesn't exist; * Zero on attempted deletion of default Category; WP_Error object is also a possibility. */ function wp_delete_category( $cat_ID ) { return wp_delete_term( $cat_ID, 'category' ); }
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
2.0.0 | wp-includes/taxonomy.php | 5 | 18 |
笔记(Notes)
例子
wp_delete_category() 为WP2原创文章,链接:https://www.wp2.cn/functions/wp_delete_category/