Changeset 2746630
- Timestamp:
- 06/22/2022 07:23:08 PM (2 years ago)
- Location:
- timber-library/trunk/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
timber-library/trunk/lib/Term.php
r2103523 r2746630 156 156 /** 157 157 * @internal 158 * @param int $tid158 * @param int $tid 159 159 * @return mixed 160 160 */ … … 164 164 } 165 165 $tid = self::get_tid($tid); 166 167 168 169 170 171 172 173 174 175 176 177 178 166 179 167 180 if ( isset($this->taxonomy) && strlen($this->taxonomy) ) { … … 182 195 * @internal 183 196 * @param int $tid 184 * @return int 185 */ 186 protected function get_tid( $tid ) {197 * @return int 198 */ 199 protected function get_tid( $tid ) { 187 200 global $wpdb; 188 201 if ( is_numeric($tid) ) { … … 193 206 } 194 207 if ( is_numeric($tid) ) { 195 $query = $wpdb->prepare("SELECT *FROM $wpdb->terms WHERE term_id = %d", $tid);208 $query = $wpdb->prepare("SELECT FROM $wpdb->terms WHERE term_id = %d", $tid); 196 209 } else { 197 $query = $wpdb->prepare("SELECT * FROM $wpdb->terms WHERE slug = %s", $tid); 198 } 199 $result = $wpdb->get_row($query); 200 if ( isset($result->term_id) ) { 201 $result->ID = $result->term_id; 202 $result->id = $result->term_id; 203 return $result->ID; 210 $query = $wpdb->prepare("SELECT term_id FROM $wpdb->terms WHERE slug = %s", $tid); 211 } 212 $result = $wpdb->get_col($query); 213 if ( $result ) { 214 if ( count($result) == 1) { 215 return $result[0]; 216 } 217 return $result; 204 218 } 205 219 return 0; -
timber-library/trunk/lib/Timber.php
r2616192 r2746630 36 36 class Timber { 37 37 38 public static $version = '1.19. 1';38 public static $version = '1.19.'; 39 39 public static $locations; 40 40 public static $dirname = 'views';
Note: See TracChangeset
for help on using the changeset viewer.