function wp_delete_category($cat_ID) {}

Deletes one existing category.


  • int $cat_ID

Return values

returns:Returns true if completes delete action; false if term doesnt exist; Zero on attempted deletion of default Category; WP_Error object is also a possibility.

Source code

function wp_delete_category($cat_ID) {

	$cat_ID = (int) $cat_ID;

	$default = get_option('default_category');

	// Don't delete the default cat

	if ( $cat_ID == $default )

		return 0;

	return wp_delete_term($cat_ID, 'category', array('default' => $default));



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: