mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Rather than adding a taxonomy arg to get_category(), convert all uses of get_category() in core to get_term(). By doing so, we negate the need to call _make_cat_compat() in a few places that are only looking for a single property.
Fixes #8722. git-svn-id: https://develop.svn.wordpress.org/trunk@25662 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -41,7 +41,7 @@ function get_category_link( $category ) {
|
||||
*/
|
||||
function get_category_parents( $id, $link = false, $separator = '/', $nicename = false, $visited = array() ) {
|
||||
$chain = '';
|
||||
$parent = get_category( $id );
|
||||
$parent = get_term( $id, 'category' );
|
||||
if ( is_wp_error( $parent ) )
|
||||
return $parent;
|
||||
|
||||
@@ -135,7 +135,7 @@ function _usort_terms_by_ID( $a, $b ) {
|
||||
*/
|
||||
function get_the_category_by_ID( $cat_ID ) {
|
||||
$cat_ID = (int) $cat_ID;
|
||||
$category = get_category( $cat_ID );
|
||||
$category = get_term( $cat_ID, 'category' );
|
||||
if ( is_wp_error( $category ) )
|
||||
return $category;
|
||||
return $category->name;
|
||||
|
||||
Reference in New Issue
Block a user