get_all_category_ids

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

WordPress Version: 5.6

/**
 * Retrieves all category IDs.
 *
 * @since 2.0.0
 * @deprecated 4.0.0 Use get_terms()
 * @see get_terms()
 *
 * @link https://developer.wordpress.org/reference/functions/get_all_category_ids/
 *
 * @return int[] List of all of the category IDs.
 */
function get_all_category_ids()
{
    _deprecated_function(__FUNCTION__, '4.0.0', 'get_terms()');
    $cat_ids = get_terms(array('taxonomy' => 'category', 'fields' => 'ids', 'get' => 'all'));
    return $cat_ids;
}

WordPress Version: 5.4

/**
 * Retrieves all category IDs.
 *
 * @since 2.0.0
 * @deprecated 4.0.0 Use get_terms()
 * @see get_terms()
 *
 * @link https://developer.wordpress.org/reference/functions/get_all_category_ids/
 *
 * @return object List of all of the category IDs.
 */
function get_all_category_ids()
{
    _deprecated_function(__FUNCTION__, '4.0.0', 'get_terms()');
    $cat_ids = get_terms(array('taxonomy' => 'category', 'fields' => 'ids', 'get' => 'all'));
    return $cat_ids;
}

WordPress Version: 5.3

/**
 * Retrieves all category IDs.
 *
 * @since 2.0.0
 * @deprecated 4.0.0 Use get_terms()
 * @see get_terms()
 *
 * @link https://developer.wordpress.org/reference/functions/get_all_category_ids/
 *
 * @return object List of all of the category IDs.
 */
function get_all_category_ids()
{
    _deprecated_function(__FUNCTION__, '4.0.0', 'get_terms()');
    if (!$cat_ids = wp_cache_get('all_category_ids', 'category')) {
        $cat_ids = get_terms(array('taxonomy' => 'category', 'fields' => 'ids', 'get' => 'all'));
        wp_cache_add('all_category_ids', $cat_ids, 'category');
    }
    return $cat_ids;
}

WordPress Version: 4.6

/**
 * Retrieves all category IDs.
 *
 * @since 2.0.0
 * @deprecated 4.0.0 Use get_terms()
 * @see get_terms()
 *
 * @link https://codex.wordpress.org/Function_Reference/get_all_category_ids
 *
 * @return object List of all of the category IDs.
 */
function get_all_category_ids()
{
    _deprecated_function(__FUNCTION__, '4.0.0', 'get_terms()');
    if (!$cat_ids = wp_cache_get('all_category_ids', 'category')) {
        $cat_ids = get_terms('category', array('fields' => 'ids', 'get' => 'all'));
        wp_cache_add('all_category_ids', $cat_ids, 'category');
    }
    return $cat_ids;
}

WordPress Version: 4.4

/**
 * Retrieves all category IDs.
 *
 * @since 2.0.0
 * @deprecated 4.0.0 Use get_terms()
 * @see get_terms()
 *
 * @link https://codex.wordpress.org/Function_Reference/get_all_category_ids
 *
 * @return object List of all of the category IDs.
 */
function get_all_category_ids()
{
    _deprecated_function(__FUNCTION__, '4.0', 'get_terms()');
    if (!$cat_ids = wp_cache_get('all_category_ids', 'category')) {
        $cat_ids = get_terms('category', array('fields' => 'ids', 'get' => 'all'));
        wp_cache_add('all_category_ids', $cat_ids, 'category');
    }
    return $cat_ids;
}

WordPress Version: 4.2

/**
 * Retrieves all category IDs.
 *
 * @since 2.0.0
 * @deprecated 4.0.0 Use get_terms() instead.
 * @see get_terms()
 * @link https://codex.wordpress.org/Function_Reference/get_all_category_ids
 *
 * @return object List of all of the category IDs.
 */
function get_all_category_ids()
{
    _deprecated_function(__FUNCTION__, '4.0', 'get_terms()');
    if (!$cat_ids = wp_cache_get('all_category_ids', 'category')) {
        $cat_ids = get_terms('category', array('fields' => 'ids', 'get' => 'all'));
        wp_cache_add('all_category_ids', $cat_ids, 'category');
    }
    return $cat_ids;
}

WordPress Version: 4.0

/**
 * Retrieves all category IDs.
 *
 * @since 2.0.0
 * @deprecated 4.0.0 Use get_terms() instead.
 * @see get_terms()
 * @link http://codex.wordpress.org/Function_Reference/get_all_category_ids
 *
 * @return object List of all of the category IDs.
 */
function get_all_category_ids()
{
    _deprecated_function(__FUNCTION__, '4.0', 'get_terms()');
    if (!$cat_ids = wp_cache_get('all_category_ids', 'category')) {
        $cat_ids = get_terms('category', array('fields' => 'ids', 'get' => 'all'));
        wp_cache_add('all_category_ids', $cat_ids, 'category');
    }
    return $cat_ids;
}

WordPress Version: 3.7

/**
 * WordPress Category API
 *
 * @package WordPress
 */
/**
 * Retrieves all category IDs.
 *
 * @since 2.0.0
 * @link http://codex.wordpress.org/Function_Reference/get_all_category_ids
 *
 * @return object List of all of the category IDs.
 */
function get_all_category_ids()
{
    if (!$cat_ids = wp_cache_get('all_category_ids', 'category')) {
        $cat_ids = get_terms('category', array('fields' => 'ids', 'get' => 'all'));
        wp_cache_add('all_category_ids', $cat_ids, 'category');
    }
    return $cat_ids;
}