| 645 | | $term_id = $wpdb->get_var("SELECT term_id FROM $wpdb->terms as t WHERE $where"); |
|---|
| 646 | | |
|---|
| 647 | | if ( empty($taxonomy) || empty($term_id) ) |
|---|
| 648 | | return $term_id; |
|---|
| 649 | | |
|---|
| 650 | | $taxonomy = $wpdb->escape( $taxonomy ); |
|---|
| 651 | | return $wpdb->get_row("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 = '$taxonomy'", ARRAY_A); |
|---|
| | 645 | if ( !empty($taxonomy) ) |
|---|
| | 646 | return $wpdb->get_row("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 = '$taxonomy'", ARRAY_A); |
|---|
| | 647 | |
|---|
| | 648 | return $wpdb->get_var("SELECT term_id FROM $wpdb->terms as t WHERE $where"); |
|---|