WPDev.one
Core Function
View Source on Trac ↗

category_exists()

category_exists( mixed $cat_name, mixed $category_parent = null )

Checks whether a category exists.

Parameters 1 required

Name / Type Description
(int

| string) $cat_name Category name.

Required
$category_parent
int

Optional. ID of parent category.

Return Value

((string)
| null) Returns the category ID as a numeric string if the pairing exists, null if not.

Function Information

Since Version
2.0.0
Source File
wp-admin/includes/taxonomy.php
Advertisement