wp_delete_term()从数据库中删除一个分类的信息

目录

描述

Removes a term from the database.

wp_delete_term() 描述

用法

<?php wp_delete_term$term_id$taxonomy$args )  ?>

wp_delete_term() 用法

参数

$term_id

(int) (必填) The ID of the term.

默认值: None

$taxonomy

(string) (必填) The context in which to relate the term to the object.

默认值: None

$args

(array) (可选) Overwrite term field values.

默认值: None

wp_delete_term() 参数

返回值

bool | WP_Error 

Returns false if not term; true if completes delete action.

wp_delete_term() 返回值

注意

If the term is a parent of other terms, then the children will be updated to that term's parent.

The $args 'default' will only override the terms found, if there is only one term found. Any other and the found terms are used.

The $args 'force_default' will force the term supplied as default to be assigned even if the object was not going to be termless.

wp_delete_term() 注意

历史

添加于 版本: 2.3.0

wp_delete_term() 历史

源文件

wp_delete_term() 函数的代码位于 wp-includes/taxonomy.php.

wp_delete_term() 源文件

相关