Skip to content

Commit

Permalink
Use get_the_terms(), which offers some natural cachy goodness
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Jan 3, 2014
1 parent dbb3bf4 commit 186c6fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/calendar/calendar.php
Expand Up @@ -1017,7 +1017,11 @@ function get_post_information_fields( $post ) {
// Sometimes taxonomies skip by, so let's make sure it has a label too
if ( !$taxonomy->public || !$taxonomy->label )
continue;
$terms = wp_get_object_terms( $post->ID, $taxonomy->name );

$terms = get_the_terms( $post->ID, $taxonomy->name );
if ( ! $terms || is_wp_error( $terms ) )
continue;

$key = 'tax_' . $taxonomy->name;
if ( count( $terms ) ) {
$value = '';
Expand Down

0 comments on commit 186c6fb

Please sign in to comment.