WordPress函数文档get_all_category_ids()
获取博客所有的分类id集合 描述 译文 检索所有类别编号。 原文 Retrieves all category…
获取博客所有的分类id集合
描述
译文
检索所有类别编号。
原文
Retrieves all category IDs.
用法
<?php get_all_category_ids() ?>
参数
None.
返回值
(array)
A list of all of the category IDs.
示例
To print a list of categories by id: name
| 
 1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
 | 
 /* ———————————- 
 * wordpress函数 kim收集 
 * ———————————- */ 
<?php 
$category_ids = get_all_category_ids();
 
foreach($category_ids as $cat_id) {
 
  $cat_name = get_cat_name($cat_id);
 
  echo $cat_id . ‘: ‘ . $cat_name;
 
} 
?> 
 | 
历史
添加于 版本: 2.0.0
Deprecated: 4.0.0
源文件
get_all_category_ids() 函数的代码位于 wp-includes/category.php.
- 原文:http://codex.wordpress.org/Function_Reference/get_all_category_ids
 
类别:WordPress函数文档、 
		本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论功能已经关闭!