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

props winterDev, MikeHansenMe.
fixes #21200.
Built from https://develop.svn.wordpress.org/trunk@28679


git-svn-id: http://core.svn.wordpress.org/trunk@28497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-06-05 16:25:14 +00:00
parent 5b26bda6ea
commit 6d5b7ea58f
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.
*