Skip to content

Commit 504f5ad

Browse files
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
1 parent 2ed8b85 commit 504f5ad

2 files changed

Lines changed: 21 additions & 17 deletions

File tree

src/wp-includes/category.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,6 @@
55
* @package WordPress
66
*/
77

8-
/**
9-
* Retrieves all category IDs.
10-
*
11-
* @since 2.0.0
12-
* @link http://codex.wordpress.org/Function_Reference/get_all_category_ids
13-
*
14-
* @return object List of all of the category IDs.
15-
*/
16-
function get_all_category_ids() {
17-
if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) {
18-
$cat_ids = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') );
19-
wp_cache_add( 'all_category_ids', $cat_ids, 'category' );
20-
}
21-
22-
return $cat_ids;
23-
}
24-
258
/**
269
* Retrieve list of category objects.
2710
*

src/wp-includes/deprecated.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,27 @@ function get_category_children( $id, $before = '/', $after = '', $visited = arra
13081308
return $chain;
13091309
}
13101310

1311+
/**
1312+
* Retrieves all category IDs.
1313+
*
1314+
* @since 2.0.0
1315+
* @deprecated 4.0.0 Use get_terms() instead.
1316+
* @see get_terms()
1317+
* @link http://codex.wordpress.org/Function_Reference/get_all_category_ids
1318+
*
1319+
* @return object List of all of the category IDs.
1320+
*/
1321+
function get_all_category_ids() {
1322+
_deprecated_function( __FUNCTION__, '4.0', 'get_terms()' );
1323+
1324+
if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) {
1325+
$cat_ids = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') );
1326+
wp_cache_add( 'all_category_ids', $cat_ids, 'category' );
1327+
}
1328+
1329+
return $cat_ids;
1330+
}
1331+
13111332
/**
13121333
* Retrieve the description of the author of the current post.
13131334
*

0 commit comments

Comments
 (0)