get_all_category_ids

函数


get_all_category_ids ( No parameters )
返回值
  • (int[]) List of all of the category IDs.
相关
  • get_terms()
定义位置
  • wp-includes/deprecated.php
    , line 1308
引入
2.0.0
弃用
4.0.0

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