WordPress.org

Make WordPress Core

Ticket #16505: check-false-get-object-terms.diff

File check-false-get-object-terms.diff, 1.2 KB (added by wonderboymusic, 3 years ago)
  • wp-includes/taxonomy.php

     
    31023102                        $t['template'] = $template; 
    31033103 
    31043104                $terms = get_object_term_cache($post->ID, $taxonomy); 
    3105                 if ( empty($terms) ) 
     3105                if ( false === $terms ) 
    31063106                        $terms = wp_get_object_terms($post->ID, $taxonomy, $t['args']); 
    31073107 
    31083108                $links = array(); 
     
    31523152                return new WP_Error( 'invalid_object', __( 'Invalid object ID' ) ); 
    31533153 
    31543154        $object_terms = get_object_term_cache( $object_id, $taxonomy ); 
    3155         if ( empty( $object_terms ) ) 
     3155        if ( false === $terms ) 
    31563156                 $object_terms = wp_get_object_terms( $object_id, $taxonomy ); 
    31573157 
    31583158        if ( is_wp_error( $object_terms ) ) 
  • wp-admin/includes/media.php

     
    973973                        $t['args'] = array(); 
    974974 
    975975                $terms = get_object_term_cache($post->ID, $taxonomy); 
    976                 if ( empty($terms) ) 
     976                if ( false === $terms ) 
    977977                        $terms = wp_get_object_terms($post->ID, $taxonomy, $t['args']); 
    978978 
    979979                $values = array();