diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 9b685edb11..68cd74c8e5 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -1148,14 +1148,18 @@ function get_the_terms( $post, $taxonomy ) { $terms = get_object_term_cache( $post->ID, $taxonomy ); if ( false === $terms ) { $terms = wp_get_object_terms( $post->ID, $taxonomy ); - $to_cache = array(); - foreach ( $terms as $key => $term ) { - $to_cache[ $key ] = $term->data; + if ( ! is_wp_error( $terms ) ) { + $to_cache = array(); + foreach ( $terms as $key => $term ) { + $to_cache[ $key ] = $term->data; + } + wp_cache_add( $post->ID, $to_cache, $taxonomy . '_relationships' ); } - wp_cache_add( $post->ID, $to_cache, $taxonomy . '_relationships' ); } - $terms = array_map( 'get_term', $terms ); + if ( ! is_wp_error( $terms ) ) { + $terms = array_map( 'get_term', $terms ); + } /** * Filter the list of terms attached to the given post. diff --git a/wp-includes/version.php b/wp-includes/version.php index 3a27e8f4e4..bdfd7df792 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4.1-alpha-35843'; +$wp_version = '4.4.1-alpha-35851'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.