Make WordPress Core


Ignore:
Timestamp:
01/29/2014 06:45:54 AM (12 years ago)
Author:
wonderboymusic
Message:

get_comment(), wp_get_post_revision(), and get_term() all used to return by reference. Because of this, $null was set to null so the return value would be a variable where applicable. This has not been necessary since [21792], so the $nulls have been removed.

Props toszcze.
Fixes #24768.

File:
1 edited

Legend:

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

    r26912 r27057  
    936936function get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') {
    937937    global $wpdb;
    938     $null = null;
    939938
    940939    if ( empty($term) ) {
     
    955954            $term = $term->term_id;
    956955        if ( !$term = (int) $term )
    957             return $null;
     956            return null;
    958957        if ( ! $_term = wp_cache_get($term, $taxonomy) ) {
    959958            $_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 = %d LIMIT 1", $taxonomy, $term) );
    960959            if ( ! $_term )
    961                 return $null;
     960                return null;
    962961            wp_cache_add($term, $_term, $taxonomy);
    963962        }
Note: See TracChangeset for help on using the changeset viewer.