get_all_category_ids() - WordPress 函数参考中文文档

返回介绍

get_all_category_ids()

发布于 2017-09-10 字数1497 浏览 892 评论 0

Warning: This function has been deprecated. Use get_terms() instead.

get_all_category_ids()

Retrieves all category IDs.


描述


返回值

(object) 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()' );

	if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) {
		$cat_ids = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') );
		wp_cache_add( 'all_category_ids', $cat_ids, 'category' );
	}

	return $cat_ids;
}

更新日志

Version 描述
4.0.0 Use get_terms()
2.0.0 Introduced.

相关函数

Uses

  • wp-includes/cache.php:
    wp_cache_get()
  • wp-includes/cache.php:
    wp_cache_add()
  • wp-includes/functions.php:
    _deprecated_function()
  • wp-includes/taxonomy.php:
    get_terms()

Used By

  • wp-includes/deprecated.php:
    get_category_children()

User Contributed Notes

上一篇:get_allowed_themes()

下一篇:get_all_page_ids()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!