WordPress.org

Make WordPress Core

Changeset 12200


Ignore:
Timestamp:
11/17/09 20:51:32 (4 years ago)
Author:
ryan
Message:

Return null if no term queried. fixes #11112

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r11971 r12200  
    302302function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') { 
    303303    global $wpdb; 
     304    $null = null; 
    304305 
    305306    if ( empty($term) ) { 
     
    322323        if ( ! $_term = wp_cache_get($term, $taxonomy) ) { 
    323324            $_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND t.term_id = %s LIMIT 1", $taxonomy, $term) ); 
     325            if ( ! $_term ) 
     326                return $null; 
    324327            wp_cache_add($term, $_term, $taxonomy); 
    325328        } 
Note: See TracChangeset for help on using the changeset viewer.