WordPress.org

Make WordPress Core

Changeset 22412


Ignore:
Timestamp:
11/06/2012 11:47:14 PM (6 years ago)
Author:
nacin
Message:

Check for WP_Error in get_the_category(). props batmoo. fixes #21155.

File:
1 edited

Legend:

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

    r22117 r22412  
    7474function get_the_category( $id = false ) {
    7575    $categories = get_the_terms( $id, 'category' );
    76     if ( ! $categories )
     76    if ( ! $categories || is_wp_error( $categories ) )
    7777        $categories = array();
    7878
Note: See TracChangeset for help on using the changeset viewer.