Deprecate get_all_category_ids(). Suggest get_terms() as a replacement.

props winterDev, MikeHansenMe.
fixes #21200.

git-svn-id: https://develop.svn.wordpress.org/trunk@28679 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2014-06-05 16:25:01 +00:00
parent 2ed8b8578c
commit 504f5ad680
2 changed files with 21 additions and 17 deletions

View File

@ -5,23 +5,6 @@
* @package WordPress
*/
/**
* Retrieves all category IDs.
*
* @since 2.0.0
* @link http://codex.wordpress.org/Function_Reference/get_all_category_ids
*
* @return object List of all of the category IDs.
*/
function get_all_category_ids() {
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;
}
/**
* Retrieve list of category objects.
*

View File

@ -1308,6 +1308,27 @@ function get_category_children( $id, $before = '/', $after = '', $visited = arra
return $chain;
}
/**
* Retrieves all category IDs.
*
* @since 2.0.0
* @deprecated 4.0.0 Use get_terms() instead.
* @see get_terms()
* @link http://codex.wordpress.org/Function_Reference/get_all_category_ids
*
* @return object List of all of the category IDs.
*/
function get_all_category_ids() {
_deprecated_function( __FUNCTION__, '4.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;
}
/**
* Retrieve the description of the author of the current post.
*