Categories Images - Version 2.4.2

Version Description

  • Update code to reduce db queries. Thanks to fburatti [http://profiles.wordpress.org/fburatti/].
Download this release

Release Info

Developer elzahlan
Plugin Icon 128x128 Categories Images
Version 2.4.2
Comparing to
See all releases

Code changes from version 2.4.1 to 2.4.2

Files changed (2) hide show
  1. categories-images.php +10 -8
  2. readme.txt +5 -2
categories-images.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://zahlan.net/blog/2012/06/categories-images/
5
  * Description: Categories Images Plugin allow you to add an image to category or any custom term.
6
  * Author: Muhammad Said El Zahlan
7
- * Version: 2.4.1
8
  * Author URI: http://zahlan.net/
9
  */
10
  ?>
@@ -181,13 +181,15 @@ function z_taxonomy_image_url($term_id = NULL, $size = NULL, $return_placeholder
181
  }
182
 
183
  $taxonomy_image_url = get_option('z_taxonomy_image'.$term_id);
184
- $attachment_id = z_get_attachment_id_by_url($taxonomy_image_url);
185
- if(!empty($attachment_id)) {
186
- if (empty($size))
187
- $size = 'full';
188
- $taxonomy_image_url = wp_get_attachment_image_src($attachment_id, $size);
189
- $taxonomy_image_url = $taxonomy_image_url[0];
190
- }
 
 
191
 
192
  if ($return_placeholder)
193
  return ($taxonomy_image_url != '') ? $taxonomy_image_url : Z_IMAGE_PLACEHOLDER;
4
  * Plugin URI: http://zahlan.net/blog/2012/06/categories-images/
5
  * Description: Categories Images Plugin allow you to add an image to category or any custom term.
6
  * Author: Muhammad Said El Zahlan
7
+ * Version: 2.4.2
8
  * Author URI: http://zahlan.net/
9
  */
10
  ?>
181
  }
182
 
183
  $taxonomy_image_url = get_option('z_taxonomy_image'.$term_id);
184
+ if(!empty($taxonomy_image_url)) {
185
+ $attachment_id = z_get_attachment_id_by_url($taxonomy_image_url);
186
+ if(!empty($attachment_id)) {
187
+ if (empty($size))
188
+ $size = 'full';
189
+ $taxonomy_image_url = wp_get_attachment_image_src($attachment_id, $size);
190
+ $taxonomy_image_url = $taxonomy_image_url[0];
191
+ }
192
+ }
193
 
194
  if ($return_placeholder)
195
  return ($taxonomy_image_url != '') ? $taxonomy_image_url : Z_IMAGE_PLACEHOLDER;
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: elzahlan
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=G8LC4VSYKYSGA
4
  Tags: Category Image, Category Images, Categories Images, taxonomy image, taxonomy images, taxonomies images, category icon, categories icons, category logo, categories logos, admin, wp-admin, category image plugin, categories images plugin
5
  Requires at least: 2.8
6
- Tested up to: 3.8
7
- Stable tag: 2.4.1
8
 
9
  The Categories Images Plugin allow you to add image with category or taxonomy.
10
 
@@ -57,6 +57,9 @@ Please check the documentation page:
57
 
58
  == Changelog ==
59
 
 
 
 
60
  = 2.4.1 =
61
  * Fix placeholder bug in backend.
62
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=G8LC4VSYKYSGA
4
  Tags: Category Image, Category Images, Categories Images, taxonomy image, taxonomy images, taxonomies images, category icon, categories icons, category logo, categories logos, admin, wp-admin, category image plugin, categories images plugin
5
  Requires at least: 2.8
6
+ Tested up to: 3.9.1
7
+ Stable tag: 2.4.2
8
 
9
  The Categories Images Plugin allow you to add image with category or taxonomy.
10
 
57
 
58
  == Changelog ==
59
 
60
+ = 2.4.2 =
61
+ * Update code to reduce db queries. Thanks to fburatti [http://profiles.wordpress.org/fburatti/].
62
+
63
  = 2.4.1 =
64
  * Fix placeholder bug in backend.
65