wp_delete_category

The timeline below displays how wordpress function wp_delete_category has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Deletes one existing category.
 *
 * @since 2.0.0
 *
 * @param int $cat_id 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.
 */
function wp_delete_category($cat_id)
{
    return wp_delete_term($cat_id, 'category');
}

WordPress Version: 6.1

/**
 * Deletes one existing category.
 *
 * @since 2.0.0
 *
 * @param int $cat_ID 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.
 */
function wp_delete_category($cat_ID)
{
    return wp_delete_term($cat_ID, 'category');
}

WordPress Version: 5.1

/**
 * Deletes one existing category.
 *
 * @since 2.0.0
 *
 * @param int $cat_ID 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.
 */
function wp_delete_category($cat_ID)
{
    return wp_delete_term($cat_ID, 'category');
}

WordPress Version: 4.9

/**
 * Deletes one existing category.
 *
 * @since 2.0.0
 *
 * @param int $cat_ID 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.
 */
function wp_delete_category($cat_ID)
{
    return wp_delete_term($cat_ID, 'category');
}

WordPress Version: 4.3

/**
 * Deletes one existing category.
 *
 * @since 2.0.0
 *
 * @param int $cat_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.
 */
function wp_delete_category($cat_ID)
{
    return wp_delete_term($cat_ID, 'category');
}

WordPress Version: 4.1

/**
 * Deletes one existing category.
 *
 * @since 2.0.0
 *
 * @param int $cat_ID
 * @return mixed 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.
 */
function wp_delete_category($cat_ID)
{
    return wp_delete_term($cat_ID, 'category');
}

WordPress Version: 3.7

/**
 * Deletes one existing category.
 *
 * @since 2.0.0
 * @uses wp_delete_term()
 *
 * @param int $cat_ID
 * @return mixed 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.
 */
function wp_delete_category($cat_ID)
{
    return wp_delete_term($cat_ID, 'category');
}