Codex tools: Log in
Contents |
Deletes one existing category.
<?php wp_delete_category( $cat_ID ) ?>
<?php
$categ_ID = 3;
if ( wp_delete_category( $categ_ID ) ) {
echo "Category #$categ_ID was successfully deleted";
} else {
echo "Impossible to delete category #$categ_ID! Make sure it exists and that it's not the default category";
}
?>
Since: 2.0.0
wp_delete_category() is located in wp-includes/taxonomy.php.