WordPress.org

Make WordPress Core

Changeset 28679


Ignore:
Timestamp:
06/05/2014 04:25:01 PM (6 years ago)
Author:
SergeyBiryukov
Message:

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

props winterDev, MikeHansenMe.
fixes #21200.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/category.php

    r27521 r28679  
    55 * @package WordPress
    66 */
    7 
    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 }
    247
    258/**
  • trunk/src/wp-includes/deprecated.php

    r28548 r28679  
    13071307    }
    13081308    return $chain;
     1309}
     1310
     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 */
     1321function 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;
    13091330}
    13101331
Note: See TracChangeset for help on using the changeset viewer.