From d845973d7b7ca2d1d0072e1a33af7f24ae5f69a0 Mon Sep 17 00:00:00 2001 From: ryan Date: Sat, 19 Jul 2008 19:00:56 +0000 Subject: [PATCH] Revert accidental bits that snuck in with [8376]. see #7227 git-svn-id: http://svn.automattic.com/wordpress/trunk@8377 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 30 +++++++----------------------- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 57033a46a0..8ed744cd07 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -761,36 +761,20 @@ function &get_terms($taxonomies, $args = '') { function is_term($term, $taxonomy = '') { global $wpdb; - $select = "SELECT term_id FROM $wpdb->terms as t WHERE "; - $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE "; - if ( is_int($term) ) { if ( 0 == $term ) return 0; $where = 't.term_id = %d'; - if ( !empty($taxonomy) ) - return $wpdb->get_row( $wpdb->prepare( $tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy ), ARRAY_A ); - else - return $wpdb->get_var( $wpdb->prepare( $select . $where, $term ) ); + } else { + if ( '' === $term = sanitize_title($term) ) + return 0; + $where = 't.slug = %s'; } - if ( '' === $slug = sanitize_title($term) ) - return 0; + if ( !empty($taxonomy) ) + return $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); - $where = 't.slug = %s'; - $else_where = 't.name = %s'; - - if ( !empty($taxonomy) ) { - if ( $result = $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $slug, $taxonomy), ARRAY_A) ) - return $result; - - return $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $else_where AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); - } - - if ( $result = $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $slug) ) ) - return $result; - - return $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $else_where", $term) ); + return $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $term) ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 721f5d96a7..06eb3317d4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -15,6 +15,6 @@ $wp_version = '2.7-bleeding'; * * @global int $wp_db_version */ -$wp_db_version = 8370; +$wp_db_version = 8202; ?>