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。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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;
}
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; }
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
查看更多 >