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

get_all_category_ids() WordPress Function

The get_all_category_ids() function in WordPress returns an array of all the categories that have been created on the site. This can be useful for various purposes, such as loops or custom functions.

get_all_category_ids() #

Retrieves all category IDs.


Description

Top ↑

See also


Top ↑

Return

(int[]) List of all of the category IDs.


Top ↑

Source

File: wp-includes/deprecated.php

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


Top ↑

Changelog

Changelog
VersionDescription
4.0.0Use get_terms()
2.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More