W3cubDocs

/WordPress

get_all_category_ids()

This function has been deprecated. Use get_terms() instead.

Retrieves all category IDs.

Description

See also

Return

(object) List of all of the category IDs.

Source

File: wp-includes/deprecated.php

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;
}

Changelog

Version Description
4.0.0 Use get_terms()
2.0.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_all_category_ids