WordPress at a glance
function is not described

category_exists() WP 2.0.0

Check whether a category exists.

  • See: term_exists()

No Hooks.

Return

Mixed.

Usage

category_exists( $cat_name, $parent );
$cat_name(int/string) (required)
Category name.
$parent(int)
ID of parent term.
Default: null

Code of category exists: wp-admin/includes/taxonomy.php VER 5.0.3

<?php
function category_exists( $cat_name, $parent = null ) {
	$id = term_exists($cat_name, 'category', $parent);
	if ( is_array($id) )
		$id = $id['term_id'];
	return $id;
}