Changeset 1649700
- Timestamp:
- 05/02/2017 02:05:49 PM (9 years ago)
- Location:
- category-thumbnails/trunk
- Files:
-
- 3 edited
-
category-thumbnails.php (modified) (2 diffs)
-
public_api.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
category-thumbnails/trunk/category-thumbnails.php
r879146 r1649700 6 6 Author: Adrian Preuss 7 7 Author URI: mailto:support@hovida-design.de?Subject=WordPress%20category-thumbnails 8 Version: 1.0. 58 Version: 1.0.6 9 9 Text Domain: category-thumbnails 10 10 Domain Path: /languages … … 211 211 } 212 212 213 $wpdb->query(sprintf('UPDATE `%sterm_taxonomy` SET `term_thumbnail`=%s WHERE `term_id`=\'%s\' LIMIT 1', $wpdb->prefix, (empty($data) ? 'NULL' : sprintf('\'%s\'', base64_decode($data))), $category)); 213 if($data !== NULL) { 214 $data = base64_decode($data); 215 } 216 217 $wpdb->update($wpdb->prefix . 'term_taxonomy', array( 218 'term_thumbnail' => $data 219 ), array( 220 'term_id' => $category 221 )); 214 222 } 215 223 } -
category-thumbnails/trunk/public_api.php
r879146 r1649700 18 18 } 19 19 20 $result = $wpdb->get_row( sprintf('SELECT `term_thumbnail` FROM `%sterm_taxonomy` WHERE `term_id`=\'%d\'LIMIT 1', $wpdb->prefix, $cat));20 $result = $wpdb->get_row($wpdb->prepare('SELECT `term_thumbnail` FROM `%sterm_taxonomy` WHERE `term_id`=%d LIMIT 1', $wpdb->prefix, $cat)); 21 21 return $result->term_thumbnail != null ? true : false; 22 22 } … … 35 35 36 36 $attributes = array(); 37 $result = $wpdb->get_row( sprintf('SELECT `term_thumbnail` FROM `%sterm_taxonomy` WHERE `term_id`=\'%d\'LIMIT 1', $wpdb->prefix, $cat));37 $result = $wpdb->get_row($wpdb->prepare('SELECT `term_thumbnail` FROM `%sterm_taxonomy` WHERE `term_id`=%d LIMIT 1', $wpdb->prefix, $cat)); 38 38 $data = json_decode($result->term_thumbnail); 39 39 … … 64 64 } 65 65 66 $result = $wpdb->get_row( sprintf('SELECT `term_thumbnail` FROM `%sterm_taxonomy` WHERE `term_id`=\'%d\'LIMIT 1', $wpdb->prefix, $cat));66 $result = $wpdb->get_row($wpdb->prepare('SELECT `term_thumbnail` FROM `%sterm_taxonomy` WHERE `term_id`=%d LIMIT 1', $wpdb->prefix, $cat)); 67 67 $data = json_decode($result->term_thumbnail); 68 68 -
category-thumbnails/trunk/readme.txt
r879149 r1649700 1 1 === Category Thumbnails === 2 2 Contributors: Adrian Preuss 3 Version: 1.0. 53 Version: 1.0.6 4 4 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=H56DKPMQE49NJ 5 5 Tags: category, thumbnail, taxonomy, custom
Note: See TracChangeset
for help on using the changeset viewer.