From 6d5b7ea58fd6e86673b575eb66f6112e39efbee9 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 5 Jun 2014 16:25:14 +0000 Subject: [PATCH] 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 --- wp-includes/category.php | 17 ----------------- wp-includes/deprecated.php | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/wp-includes/category.php b/wp-includes/category.php index 24cf6e8ad3..fddaa6f66d 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -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. * diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 2687137842..5e5c19f17c 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -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. *