public static function get_instance( $term_id, $taxonomy = null ) {
global $wpdb;
- $term_id = (int) $term_id;
- if ( ! $term_id ) {
+ if ( ! is_numeric( $term_id ) || $term_id != floor( $term_id ) || ! $term_id ) {
return false;
}
+ $term_id = (int) $term_id;
+
$_term = wp_cache_get( $term_id, 'terms' );
// If there isn't a cached version, hit the database.
}
return sanitize_term( $data, $data->taxonomy, 'raw' );
- break;
}
}
}