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:
parent
5b26bda6ea
commit
6d5b7ea58f
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue