get_all_category_ids

函数
get_all_category_ids ( No parameters )
返回值
  • (int[]) List of all of the category IDs.
相关
  • get_terms()
定义位置
相关方法
get_the_category_listget_all_page_idsget_categoriesget_category_linkget_the_category_by_id
引入
2.0.0
弃用
4.0.0

get_all_category_ids: 这个函数返回一个所有类别ID的数组。

检索所有类别的ID。

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

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2026-01-29 13:09:46

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: