Only call wp_get_object_terms() if get_object_term_cache() says there is no cache (false), which is different than no terms. props wonderboymusic, fixes #16505.

git-svn-id: https://develop.svn.wordpress.org/trunk@22433 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-11-07 20:00:51 +00:00
parent 2dc1a1d97f
commit 51f16233ac
2 changed files with 3 additions and 3 deletions

View File

@ -985,7 +985,7 @@ function get_attachment_fields_to_edit($post, $errors = null) {
$t['args'] = array();
$terms = get_object_term_cache($post->ID, $taxonomy);
if ( empty($terms) )
if ( false === $terms )
$terms = wp_get_object_terms($post->ID, $taxonomy, $t['args']);
$values = array();

View File

@ -3111,7 +3111,7 @@ function get_the_taxonomies($post = 0, $args = array() ) {
$t['template'] = $template;
$terms = get_object_term_cache($post->ID, $taxonomy);
if ( empty($terms) )
if ( false === $terms )
$terms = wp_get_object_terms($post->ID, $taxonomy, $t['args']);
$links = array();
@ -3161,7 +3161,7 @@ function is_object_in_term( $object_id, $taxonomy, $terms = null ) {
return new WP_Error( 'invalid_object', __( 'Invalid object ID' ) );
$object_terms = get_object_term_cache( $object_id, $taxonomy );
if ( empty( $object_terms ) )
if ( false === $terms )
$object_terms = wp_get_object_terms( $object_id, $taxonomy );
if ( is_wp_error( $object_terms ) )