wp_delete_category( int $cat_id ): bool|int|WP_Error

Deletes one existing category.

Parameters

$cat_idintrequired
Category term 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.

Source

function wp_delete_category( $cat_id ) {
	return wp_delete_term( $cat_id, 'category' );
}

Changelog

VersionDescription
2.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.