WordPress.org

Make WordPress Core

Ticket #16464: 16464.2.patch

File 16464.2.patch, 750 bytes (added by hakre, 3 years ago)

Not that invasive for existing code.

  • wp-includes/taxonomy.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress
     
    887887                $value = stripslashes($value); 
    888888                $field = 't.name'; 
    889889        } else { 
    890                 return get_term( (int) $value, $taxonomy, $output, $filter); 
     890                $term = get_term( (int) $value, $taxonomy, $output, $filter); 
     891                if ( is_wp_error( $term ) ) 
     892                        $term = false; 
     893                return $term; 
    891894        } 
    892895 
    893896        $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 $field = %s LIMIT 1", $taxonomy, $value) );