函数原型
get_all_category_ids(): int[]
函数描述
Retrieves all category IDs.
是否弃用
Warning: This function has been deprecated. Use get_terms() instead.
函数参数
无
函数返回值
int[] List of all of the category IDs.
函数位置
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;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 4.0.0 | Use get_terms() |
| 2.0.0 | Introduced. |

