Version Description
- Fix compatibility with the latest Wordpress version
Download this release
Release Info
Developer | elzahlan |
Plugin | Categories Images |
Version | 2.5.4 |
Comparing to | |
See all releases |
Code changes from version 2.5.3 to 2.5.4
- categories-images.php +362 -356
- languages/categories-images-ca.po +63 -63
- languages/categories-images-sv_SE.po +85 -85
- readme.txt +146 -143
categories-images.php
CHANGED
@@ -1,357 +1,363 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name: Categories Images
|
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.5.
|
8 |
-
* Author URI: http://zahlan.net/
|
9 |
-
* Domain Path: /languages
|
10 |
-
* Text Domain: categories-images
|
11 |
-
*/
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
}
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
}
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
*
|
226 |
-
*
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
*
|
243 |
-
*
|
244 |
-
* @
|
245 |
-
* @
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
<?php
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: Categories Images
|
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.5.4
|
8 |
+
* Author URI: http://zahlan.net/
|
9 |
+
* Domain Path: /languages
|
10 |
+
* Text Domain: categories-images
|
11 |
+
*/
|
12 |
+
|
13 |
+
if (!defined('Z_PLUGIN_URL'))
|
14 |
+
define('Z_PLUGIN_URL', untrailingslashit(plugins_url('', __FILE__)));
|
15 |
+
|
16 |
+
define('Z_IMAGE_PLACEHOLDER', Z_PLUGIN_URL."/images/placeholder.png");
|
17 |
+
|
18 |
+
// l10n
|
19 |
+
load_plugin_textdomain('categories-images', FALSE, 'categories-images/languages');
|
20 |
+
|
21 |
+
add_action('admin_init', 'z_init');
|
22 |
+
function z_init() {
|
23 |
+
$z_taxonomies = get_taxonomies();
|
24 |
+
if (is_array($z_taxonomies)) {
|
25 |
+
$zci_options = get_option('zci_options');
|
26 |
+
|
27 |
+
if (!is_array($zci_options))
|
28 |
+
$zci_options = array();
|
29 |
+
|
30 |
+
if (empty($zci_options['excluded_taxonomies']))
|
31 |
+
$zci_options['excluded_taxonomies'] = array();
|
32 |
+
|
33 |
+
foreach ($z_taxonomies as $z_taxonomy) {
|
34 |
+
if (in_array($z_taxonomy, $zci_options['excluded_taxonomies']))
|
35 |
+
continue;
|
36 |
+
add_action($z_taxonomy.'_add_form_fields', 'z_add_texonomy_field');
|
37 |
+
add_action($z_taxonomy.'_edit_form_fields', 'z_edit_texonomy_field');
|
38 |
+
add_filter( 'manage_edit-' . $z_taxonomy . '_columns', 'z_taxonomy_columns' );
|
39 |
+
add_filter( 'manage_' . $z_taxonomy . '_custom_column', 'z_taxonomy_column', 10, 3 );
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
function z_add_style() {
|
45 |
+
echo '<style type="text/css" media="screen">
|
46 |
+
th.column-thumb {width:60px;}
|
47 |
+
.form-field img.taxonomy-image {border:1px solid #eee;max-width:300px;max-height:300px;}
|
48 |
+
.inline-edit-row fieldset .thumb label span.title {width:48px;height:48px;border:1px solid #eee;display:inline-block;}
|
49 |
+
.column-thumb span {width:48px;height:48px;border:1px solid #eee;display:inline-block;}
|
50 |
+
.inline-edit-row fieldset .thumb img,.column-thumb img {width:48px;height:48px;}
|
51 |
+
</style>';
|
52 |
+
}
|
53 |
+
|
54 |
+
// add image field in add form
|
55 |
+
function z_add_texonomy_field() {
|
56 |
+
if (get_bloginfo('version') >= 3.5)
|
57 |
+
wp_enqueue_media();
|
58 |
+
else {
|
59 |
+
wp_enqueue_style('thickbox');
|
60 |
+
wp_enqueue_script('thickbox');
|
61 |
+
}
|
62 |
+
|
63 |
+
echo '<div class="form-field">
|
64 |
+
<label for="taxonomy_image">' . __('Image', 'categories-images') . '</label>
|
65 |
+
<input type="text" name="taxonomy_image" id="taxonomy_image" value="" />
|
66 |
+
<br/>
|
67 |
+
<button class="z_upload_image_button button">' . __('Upload/Add image', 'categories-images') . '</button>
|
68 |
+
</div>'.z_script();
|
69 |
+
}
|
70 |
+
|
71 |
+
// add image field in edit form
|
72 |
+
function z_edit_texonomy_field($taxonomy) {
|
73 |
+
if (get_bloginfo('version') >= 3.5)
|
74 |
+
wp_enqueue_media();
|
75 |
+
else {
|
76 |
+
wp_enqueue_style('thickbox');
|
77 |
+
wp_enqueue_script('thickbox');
|
78 |
+
}
|
79 |
+
|
80 |
+
if (z_taxonomy_image_url( $taxonomy->term_id, NULL, TRUE ) == Z_IMAGE_PLACEHOLDER)
|
81 |
+
$image_url = "";
|
82 |
+
else
|
83 |
+
$image_url = z_taxonomy_image_url( $taxonomy->term_id, NULL, TRUE );
|
84 |
+
echo '<tr class="form-field">
|
85 |
+
<th scope="row" valign="top"><label for="taxonomy_image">' . __('Image', 'categories-images') . '</label></th>
|
86 |
+
<td><img class="taxonomy-image" src="' . z_taxonomy_image_url( $taxonomy->term_id, 'medium', TRUE ) . '"/><br/><input type="text" name="taxonomy_image" id="taxonomy_image" value="'.$image_url.'" /><br />
|
87 |
+
<button class="z_upload_image_button button">' . __('Upload/Add image', 'categories-images') . '</button>
|
88 |
+
<button class="z_remove_image_button button">' . __('Remove image', 'categories-images') . '</button>
|
89 |
+
</td>
|
90 |
+
</tr>'.z_script();
|
91 |
+
}
|
92 |
+
|
93 |
+
// upload using wordpress upload
|
94 |
+
function z_script() {
|
95 |
+
return '<script type="text/javascript">
|
96 |
+
jQuery(document).ready(function($) {
|
97 |
+
var wordpress_ver = "'.get_bloginfo("version").'", upload_button;
|
98 |
+
$(".z_upload_image_button").click(function(event) {
|
99 |
+
upload_button = $(this);
|
100 |
+
var frame;
|
101 |
+
if (wordpress_ver >= "3.5") {
|
102 |
+
event.preventDefault();
|
103 |
+
if (frame) {
|
104 |
+
frame.open();
|
105 |
+
return;
|
106 |
+
}
|
107 |
+
frame = wp.media();
|
108 |
+
frame.on( "select", function() {
|
109 |
+
// Grab the selected attachment.
|
110 |
+
var attachment = frame.state().get("selection").first();
|
111 |
+
frame.close();
|
112 |
+
if (upload_button.parent().prev().children().hasClass("tax_list")) {
|
113 |
+
upload_button.parent().prev().children().val(attachment.attributes.url);
|
114 |
+
upload_button.parent().prev().prev().children().attr("src", attachment.attributes.url);
|
115 |
+
}
|
116 |
+
else
|
117 |
+
$("#taxonomy_image").val(attachment.attributes.url);
|
118 |
+
});
|
119 |
+
frame.open();
|
120 |
+
}
|
121 |
+
else {
|
122 |
+
tb_show("", "media-upload.php?type=image&TB_iframe=true");
|
123 |
+
return false;
|
124 |
+
}
|
125 |
+
});
|
126 |
+
|
127 |
+
$(".z_remove_image_button").click(function() {
|
128 |
+
$(".taxonomy-image").attr("src", "'.Z_IMAGE_PLACEHOLDER.'");
|
129 |
+
$("#taxonomy_image").val("");
|
130 |
+
$(this).parent().siblings(".title").children("img").attr("src","' . Z_IMAGE_PLACEHOLDER . '");
|
131 |
+
$(".inline-edit-col :input[name=\'taxonomy_image\']").val("");
|
132 |
+
return false;
|
133 |
+
});
|
134 |
+
|
135 |
+
if (wordpress_ver < "3.5") {
|
136 |
+
window.send_to_editor = function(html) {
|
137 |
+
imgurl = $("img",html).attr("src");
|
138 |
+
if (upload_button.parent().prev().children().hasClass("tax_list")) {
|
139 |
+
upload_button.parent().prev().children().val(imgurl);
|
140 |
+
upload_button.parent().prev().prev().children().attr("src", imgurl);
|
141 |
+
}
|
142 |
+
else
|
143 |
+
$("#taxonomy_image").val(imgurl);
|
144 |
+
tb_remove();
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
$(".editinline").click(function() {
|
149 |
+
var tax_id = $(this).parents("tr").attr("id").substr(4);
|
150 |
+
var thumb = $("#tag-"+tax_id+" .thumb img").attr("src");
|
151 |
+
|
152 |
+
if (thumb != "' . Z_IMAGE_PLACEHOLDER . '") {
|
153 |
+
$(".inline-edit-col :input[name=\'taxonomy_image\']").val(thumb);
|
154 |
+
} else {
|
155 |
+
$(".inline-edit-col :input[name=\'taxonomy_image\']").val("");
|
156 |
+
}
|
157 |
+
|
158 |
+
$(".inline-edit-col .title img").attr("src",thumb);
|
159 |
+
});
|
160 |
+
});
|
161 |
+
</script>';
|
162 |
+
}
|
163 |
+
|
164 |
+
// save our taxonomy image while edit or save term
|
165 |
+
add_action('edit_term','z_save_taxonomy_image');
|
166 |
+
add_action('create_term','z_save_taxonomy_image');
|
167 |
+
function z_save_taxonomy_image($term_id) {
|
168 |
+
if(isset($_POST['taxonomy_image']))
|
169 |
+
update_option('z_taxonomy_image'.$term_id, $_POST['taxonomy_image'], NULL);
|
170 |
+
}
|
171 |
+
|
172 |
+
// get attachment ID by image url
|
173 |
+
function z_get_attachment_id_by_url($image_src) {
|
174 |
+
global $wpdb;
|
175 |
+
$query = $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid = %s", $image_src);
|
176 |
+
$id = $wpdb->get_var($query);
|
177 |
+
return (!empty($id)) ? $id : NULL;
|
178 |
+
}
|
179 |
+
|
180 |
+
// get taxonomy image url for the given term_id (Place holder image by default)
|
181 |
+
function z_taxonomy_image_url($term_id = NULL, $size = 'full', $return_placeholder = FALSE) {
|
182 |
+
if (!$term_id) {
|
183 |
+
if (is_category())
|
184 |
+
$term_id = get_query_var('cat');
|
185 |
+
elseif (is_tag())
|
186 |
+
$term_id = get_query_var('tag_id');
|
187 |
+
elseif (is_tax()) {
|
188 |
+
$current_term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
|
189 |
+
$term_id = $current_term->term_id;
|
190 |
+
}
|
191 |
+
}
|
192 |
+
|
193 |
+
$taxonomy_image_url = get_option('z_taxonomy_image'.$term_id);
|
194 |
+
if(!empty($taxonomy_image_url)) {
|
195 |
+
$attachment_id = z_get_attachment_id_by_url($taxonomy_image_url);
|
196 |
+
if(!empty($attachment_id)) {
|
197 |
+
$taxonomy_image_url = wp_get_attachment_image_src($attachment_id, $size);
|
198 |
+
$taxonomy_image_url = $taxonomy_image_url[0];
|
199 |
+
}
|
200 |
+
}
|
201 |
+
|
202 |
+
if ($return_placeholder)
|
203 |
+
return ($taxonomy_image_url != '') ? $taxonomy_image_url : Z_IMAGE_PLACEHOLDER;
|
204 |
+
else
|
205 |
+
return $taxonomy_image_url;
|
206 |
+
}
|
207 |
+
|
208 |
+
function z_quick_edit_custom_box($column_name, $screen, $name) {
|
209 |
+
if ($column_name == 'thumb')
|
210 |
+
echo '<fieldset>
|
211 |
+
<div class="thumb inline-edit-col">
|
212 |
+
<label>
|
213 |
+
<span class="title"><img src="" alt="Thumbnail"/></span>
|
214 |
+
<span class="input-text-wrap"><input type="text" name="taxonomy_image" value="" class="tax_list" /></span>
|
215 |
+
<span class="input-text-wrap">
|
216 |
+
<button class="z_upload_image_button button">' . __('Upload/Add image', 'categories-images') . '</button>
|
217 |
+
<button class="z_remove_image_button button">' . __('Remove image', 'categories-images') . '</button>
|
218 |
+
</span>
|
219 |
+
</label>
|
220 |
+
</div>
|
221 |
+
</fieldset>';
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* Thumbnail column added to category admin.
|
226 |
+
*
|
227 |
+
* @access public
|
228 |
+
* @param mixed $columns
|
229 |
+
* @return void
|
230 |
+
*/
|
231 |
+
function z_taxonomy_columns( $columns ) {
|
232 |
+
$new_columns = array();
|
233 |
+
$new_columns['cb'] = $columns['cb'];
|
234 |
+
$new_columns['thumb'] = __('Image', 'categories-images');
|
235 |
+
|
236 |
+
unset( $columns['cb'] );
|
237 |
+
|
238 |
+
return array_merge( $new_columns, $columns );
|
239 |
+
}
|
240 |
+
|
241 |
+
/**
|
242 |
+
* Thumbnail column value added to category admin.
|
243 |
+
*
|
244 |
+
* @access public
|
245 |
+
* @param mixed $columns
|
246 |
+
* @param mixed $column
|
247 |
+
* @param mixed $id
|
248 |
+
* @return void
|
249 |
+
*/
|
250 |
+
function z_taxonomy_column( $columns, $column, $id ) {
|
251 |
+
if ( $column == 'thumb' )
|
252 |
+
$columns = '<span><img src="' . z_taxonomy_image_url($id, 'thumbnail', TRUE) . '" alt="' . __('Thumbnail', 'categories-images') . '" class="wp-post-image" /></span>';
|
253 |
+
|
254 |
+
return $columns;
|
255 |
+
}
|
256 |
+
|
257 |
+
// Change 'insert into post' to 'use this image'
|
258 |
+
function z_change_insert_button_text($safe_text, $text) {
|
259 |
+
return str_replace("Insert into Post", "Use this image", $text);
|
260 |
+
}
|
261 |
+
|
262 |
+
// Style the image in category list
|
263 |
+
if ( strpos( $_SERVER['SCRIPT_NAME'], 'edit-tags.php' ) > 0 ) {
|
264 |
+
add_action( 'admin_head', 'z_add_style' );
|
265 |
+
add_action('quick_edit_custom_box', 'z_quick_edit_custom_box', 10, 3);
|
266 |
+
add_filter("attribute_escape", "z_change_insert_button_text", 10, 2);
|
267 |
+
}
|
268 |
+
|
269 |
+
// New menu submenu for plugin options in Settings menu
|
270 |
+
add_action('admin_menu', 'z_options_menu');
|
271 |
+
function z_options_menu() {
|
272 |
+
add_options_page(__('Categories Images settings', 'categories-images'), __('Categories Images', 'categories-images'), 'manage_options', 'zci-options', 'zci_options');
|
273 |
+
add_action('admin_init', 'z_register_settings');
|
274 |
+
}
|
275 |
+
|
276 |
+
// Register plugin settings
|
277 |
+
function z_register_settings() {
|
278 |
+
register_setting('zci_options', 'zci_options', 'z_options_validate');
|
279 |
+
add_settings_section('zci_settings', __('Categories Images settings', 'categories-images'), 'z_section_text', 'zci-options');
|
280 |
+
add_settings_field('z_excluded_taxonomies', __('Excluded Taxonomies', 'categories-images'), 'z_excluded_taxonomies', 'zci-options', 'zci_settings');
|
281 |
+
}
|
282 |
+
|
283 |
+
// Settings section description
|
284 |
+
function z_section_text() {
|
285 |
+
echo '<p>'.__('Please select the taxonomies you want to exclude it from Categories Images plugin', 'categories-images').'</p>';
|
286 |
+
}
|
287 |
+
|
288 |
+
// Excluded taxonomies checkboxs
|
289 |
+
function z_excluded_taxonomies() {
|
290 |
+
$options = get_option('zci_options');
|
291 |
+
$disabled_taxonomies = array('nav_menu', 'link_category', 'post_format');
|
292 |
+
foreach (get_taxonomies() as $tax) : if (in_array($tax, $disabled_taxonomies)) continue; ?>
|
293 |
+
<input type="checkbox" name="zci_options[excluded_taxonomies][<?php echo $tax ?>]" value="<?php echo $tax ?>" <?php checked(isset($options['excluded_taxonomies'][$tax])); ?> /> <?php echo $tax ;?><br />
|
294 |
+
<?php endforeach;
|
295 |
+
}
|
296 |
+
|
297 |
+
// Validating options
|
298 |
+
function z_options_validate($input) {
|
299 |
+
return $input;
|
300 |
+
}
|
301 |
+
|
302 |
+
// Plugin option page
|
303 |
+
function zci_options() {
|
304 |
+
if (!current_user_can('manage_options'))
|
305 |
+
wp_die(__( 'You do not have sufficient permissions to access this page.', 'categories-images'));
|
306 |
+
$options = get_option('zci_options');
|
307 |
+
?>
|
308 |
+
<div class="wrap">
|
309 |
+
<?php screen_icon(); ?>
|
310 |
+
<h2><?php _e('Categories Images', 'categories-images'); ?></h2>
|
311 |
+
<form method="post" action="options.php">
|
312 |
+
<?php settings_fields('zci_options'); ?>
|
313 |
+
<?php do_settings_sections('zci-options'); ?>
|
314 |
+
<?php submit_button(); ?>
|
315 |
+
</form>
|
316 |
+
</div>
|
317 |
+
<?php
|
318 |
+
}
|
319 |
+
|
320 |
+
// display taxonomy image for the given term_id
|
321 |
+
function z_taxonomy_image($term_id = NULL, $size = 'full', $attr = NULL, $echo = TRUE) {
|
322 |
+
if (!$term_id) {
|
323 |
+
if (is_category())
|
324 |
+
$term_id = get_query_var('cat');
|
325 |
+
elseif (is_tag())
|
326 |
+
$term_id = get_query_var('tag_id');
|
327 |
+
elseif (is_tax()) {
|
328 |
+
$current_term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
|
329 |
+
$term_id = $current_term->term_id;
|
330 |
+
}
|
331 |
+
}
|
332 |
+
|
333 |
+
$taxonomy_image_url = get_option('z_taxonomy_image'.$term_id);
|
334 |
+
if(!empty($taxonomy_image_url)) {
|
335 |
+
$attachment_id = z_get_attachment_id_by_url($taxonomy_image_url);
|
336 |
+
if(!empty($attachment_id))
|
337 |
+
$taxonomy_image = wp_get_attachment_image($attachment_id, $size, FALSE, $attr);
|
338 |
+
else {
|
339 |
+
$image_attr = '';
|
340 |
+
if(is_array($attr)) {
|
341 |
+
if(!empty($attr['class']))
|
342 |
+
$image_attr .= ' class="'.$attr['class'].'" ';
|
343 |
+
if(!empty($attr['alt']))
|
344 |
+
$image_attr .= ' alt="'.$attr['alt'].'" ';
|
345 |
+
if(!empty($attr['width']))
|
346 |
+
$image_attr .= ' width="'.$attr['width'].'" ';
|
347 |
+
if(!empty($attr['height']))
|
348 |
+
$image_attr .= ' height="'.$attr['height'].'" ';
|
349 |
+
if(!empty($attr['title']))
|
350 |
+
$image_attr .= ' title="'.$attr['title'].'" ';
|
351 |
+
}
|
352 |
+
$taxonomy_image = '<img src="'.$taxonomy_image_url.'" '.$image_attr.'/>';
|
353 |
+
}
|
354 |
+
}
|
355 |
+
else{
|
356 |
+
$taxonomy_image = '';
|
357 |
+
}
|
358 |
+
|
359 |
+
if ($echo)
|
360 |
+
echo $taxonomy_image;
|
361 |
+
else
|
362 |
+
return $taxonomy_image;
|
363 |
}
|
languages/categories-images-ca.po
CHANGED
@@ -1,63 +1,63 @@
|
|
1 |
-
msgid ""
|
2 |
-
msgstr ""
|
3 |
-
"Project-Id-Version: Categories Images\n"
|
4 |
-
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: Wed Jun 10 2015 19:06:10 GMT+0200 (CEST)\n"
|
6 |
-
"PO-Revision-Date: Wed Jun 10 2015 19:07:54 GMT+0200 (CEST)\n"
|
7 |
-
"Last-Translator: dms3 <dms3@demomentsomtres.com>\n"
|
8 |
-
"Language-Team: \n"
|
9 |
-
"Language: Catalan\n"
|
10 |
-
"Plural-Forms: nplurals=2; plural=n != 1\n"
|
11 |
-
"MIME-Version: 1.0\n"
|
12 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
13 |
-
"Content-Transfer-Encoding: 8bit\n"
|
14 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
15 |
-
"X-Poedit-Basepath: .\n"
|
16 |
-
"X-Poedit-SearchPath-0: ..\n"
|
17 |
-
"X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
|
18 |
-
"__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
|
19 |
-
"_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
|
20 |
-
"esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
|
21 |
-
"esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
|
22 |
-
"X-Loco-Target-Locale: ca_ES\n"
|
23 |
-
"X-Generator: Loco - https://localise.biz/"
|
24 |
-
|
25 |
-
#: ../categories-images.php:59 ../categories-images.php:80 ../categories-images.
|
26 |
-
#: php:227
|
27 |
-
msgid "Image"
|
28 |
-
msgstr "Imatge"
|
29 |
-
|
30 |
-
#: ../categories-images.php:62 ../categories-images.php:82 ../categories-images.
|
31 |
-
#: php:209
|
32 |
-
msgid "Upload/Add image"
|
33 |
-
msgstr "Puja/Afegeix imatge"
|
34 |
-
|
35 |
-
#: ../categories-images.php:83 ../categories-images.php:210
|
36 |
-
msgid "Remove image"
|
37 |
-
msgstr "Elimina la imatge"
|
38 |
-
|
39 |
-
#: ../categories-images.php:245
|
40 |
-
msgid "Thumbnail"
|
41 |
-
msgstr "Miniatura"
|
42 |
-
|
43 |
-
#: ../categories-images.php:265 ../categories-images.php:272
|
44 |
-
msgid "Categories Images settings"
|
45 |
-
msgstr "Configuració d'Imatges de Categoria"
|
46 |
-
|
47 |
-
#: ../categories-images.php:265 ../categories-images.php:303
|
48 |
-
msgid "Categories Images"
|
49 |
-
msgstr "Imatges de Categoria"
|
50 |
-
|
51 |
-
#: ../categories-images.php:273
|
52 |
-
msgid "Excluded Taxonomies"
|
53 |
-
msgstr "Taxonomies excloses"
|
54 |
-
|
55 |
-
#: ../categories-images.php:278
|
56 |
-
msgid ""
|
57 |
-
"Please select the taxonomies you want to exclude it from Categories Images "
|
58 |
-
"plugin"
|
59 |
-
msgstr "Escull les taxonomies que vulguis excloure d'aquesta extensió"
|
60 |
-
|
61 |
-
#: ../categories-images.php:298
|
62 |
-
msgid "You do not have sufficient permissions to access this page."
|
63 |
-
msgstr "No tens permís per accedir a aquesta pàgina"
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Categories Images\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: Wed Jun 10 2015 19:06:10 GMT+0200 (CEST)\n"
|
6 |
+
"PO-Revision-Date: Wed Jun 10 2015 19:07:54 GMT+0200 (CEST)\n"
|
7 |
+
"Last-Translator: dms3 <dms3@demomentsomtres.com>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"Language: Catalan\n"
|
10 |
+
"Plural-Forms: nplurals=2; plural=n != 1\n"
|
11 |
+
"MIME-Version: 1.0\n"
|
12 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
13 |
+
"Content-Transfer-Encoding: 8bit\n"
|
14 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
15 |
+
"X-Poedit-Basepath: .\n"
|
16 |
+
"X-Poedit-SearchPath-0: ..\n"
|
17 |
+
"X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
|
18 |
+
"__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
|
19 |
+
"_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
|
20 |
+
"esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
|
21 |
+
"esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
|
22 |
+
"X-Loco-Target-Locale: ca_ES\n"
|
23 |
+
"X-Generator: Loco - https://localise.biz/"
|
24 |
+
|
25 |
+
#: ../categories-images.php:59 ../categories-images.php:80 ../categories-images.
|
26 |
+
#: php:227
|
27 |
+
msgid "Image"
|
28 |
+
msgstr "Imatge"
|
29 |
+
|
30 |
+
#: ../categories-images.php:62 ../categories-images.php:82 ../categories-images.
|
31 |
+
#: php:209
|
32 |
+
msgid "Upload/Add image"
|
33 |
+
msgstr "Puja/Afegeix imatge"
|
34 |
+
|
35 |
+
#: ../categories-images.php:83 ../categories-images.php:210
|
36 |
+
msgid "Remove image"
|
37 |
+
msgstr "Elimina la imatge"
|
38 |
+
|
39 |
+
#: ../categories-images.php:245
|
40 |
+
msgid "Thumbnail"
|
41 |
+
msgstr "Miniatura"
|
42 |
+
|
43 |
+
#: ../categories-images.php:265 ../categories-images.php:272
|
44 |
+
msgid "Categories Images settings"
|
45 |
+
msgstr "Configuració d'Imatges de Categoria"
|
46 |
+
|
47 |
+
#: ../categories-images.php:265 ../categories-images.php:303
|
48 |
+
msgid "Categories Images"
|
49 |
+
msgstr "Imatges de Categoria"
|
50 |
+
|
51 |
+
#: ../categories-images.php:273
|
52 |
+
msgid "Excluded Taxonomies"
|
53 |
+
msgstr "Taxonomies excloses"
|
54 |
+
|
55 |
+
#: ../categories-images.php:278
|
56 |
+
msgid ""
|
57 |
+
"Please select the taxonomies you want to exclude it from Categories Images "
|
58 |
+
"plugin"
|
59 |
+
msgstr "Escull les taxonomies que vulguis excloure d'aquesta extensió"
|
60 |
+
|
61 |
+
#: ../categories-images.php:298
|
62 |
+
msgid "You do not have sufficient permissions to access this page."
|
63 |
+
msgstr "No tens permís per accedir a aquesta pàgina"
|
languages/categories-images-sv_SE.po
CHANGED
@@ -1,85 +1,85 @@
|
|
1 |
-
msgid ""
|
2 |
-
msgstr ""
|
3 |
-
"Project-Id-Version: Categories Images\n"
|
4 |
-
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: Fri Dec 04 2015 14:03:51 GMT+0100 (CET)\n"
|
6 |
-
"PO-Revision-Date: 2016-03-10 23:56+0200\n"
|
7 |
-
"Last-Translator: Munamamad El Zahlan <zahlan@theplanet.com.eg>\n"
|
8 |
-
"Language-Team: \n"
|
9 |
-
"Language: sv\n"
|
10 |
-
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
11 |
-
"MIME-Version: 1.0\n"
|
12 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
13 |
-
"Content-Transfer-Encoding: 8bit\n"
|
14 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
15 |
-
"X-Poedit-Basepath: .\n"
|
16 |
-
"X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;__:1;"
|
17 |
-
"_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;_x:1,2c;"
|
18 |
-
"_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;esc_attr__:1;"
|
19 |
-
"esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;esc_html_x:1,2c;"
|
20 |
-
"comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
|
21 |
-
"X-Loco-Target-Locale: sv_SE\n"
|
22 |
-
"X-Generator: Poedit 1.7.5\n"
|
23 |
-
"X-Poedit-SearchPath-0: ../../plugins/categories-images\n"
|
24 |
-
|
25 |
-
#. Name of the plugin
|
26 |
-
msgid "Categories Images"
|
27 |
-
msgstr "Kategoribilder"
|
28 |
-
|
29 |
-
#. URI of the plugin
|
30 |
-
msgid "http://zahlan.net/blog/2012/06/categories-images"
|
31 |
-
msgstr "http://zahlan.net/blog/2012/06/categories-images"
|
32 |
-
|
33 |
-
#. Description of the plugin
|
34 |
-
msgid ""
|
35 |
-
"Categories Images Plugin allow you to add an image to category or any custom term."
|
36 |
-
msgstr ""
|
37 |
-
"Kategoribildtillägget låter dig lägga till en bild till kategori eller annan egen "
|
38 |
-
"motsvarighet."
|
39 |
-
|
40 |
-
#. Author of the plugin
|
41 |
-
msgid "Muhammad Said El Zahlan"
|
42 |
-
msgstr "Muhammad Said El Zahlan"
|
43 |
-
|
44 |
-
#. Author URI of the plugin
|
45 |
-
msgid "http://zahlan.net"
|
46 |
-
msgstr "http://zahlan.net"
|
47 |
-
|
48 |
-
#: ../../plugins/categories-images/categories-images.php:61 ../..
|
49 |
-
#: plugins/categories-images/categories-images.php:82 ../../plugins/categories-
|
50 |
-
#: images/categories-images.php:229
|
51 |
-
msgid "Image"
|
52 |
-
msgstr "Bild"
|
53 |
-
|
54 |
-
#: ../../plugins/categories-images/categories-images.php:64 ../..
|
55 |
-
#: plugins/categories-images/categories-images.php:84 ../../plugins/categories-
|
56 |
-
#: images/categories-images.php:211
|
57 |
-
msgid "Upload/Add image"
|
58 |
-
msgstr "Ladda upp/Lägg till bild"
|
59 |
-
|
60 |
-
#: ../../plugins/categories-images/categories-images.php:85 ../..
|
61 |
-
#: plugins/categories-images/categories-images.php:212
|
62 |
-
msgid "Remove image"
|
63 |
-
msgstr "Ta bort bild"
|
64 |
-
|
65 |
-
#: ../../plugins/categories-images/categories-images.php:247
|
66 |
-
msgid "Thumbnail"
|
67 |
-
msgstr "Tumnagel"
|
68 |
-
|
69 |
-
#: ../../plugins/categories-images/categories-images.php:267 ../..
|
70 |
-
#: plugins/categories-images/categories-images.php:274
|
71 |
-
msgid "Categories Images settings"
|
72 |
-
msgstr "Kategoribildinställningar"
|
73 |
-
|
74 |
-
#: ../../plugins/categories-images/categories-images.php:275
|
75 |
-
msgid "Excluded Taxonomies"
|
76 |
-
msgstr "Exkludera taxonomier"
|
77 |
-
|
78 |
-
#: ../../plugins/categories-images/categories-images.php:280
|
79 |
-
msgid ""
|
80 |
-
"Please select the taxonomies you want to exclude it from Categories Images plugin"
|
81 |
-
msgstr "Välj vilka taxonomier du vill exkludera från Kategoribildtillägget"
|
82 |
-
|
83 |
-
#: ../../plugins/categories-images/categories-images.php:300
|
84 |
-
msgid "You do not have sufficient permissions to access this page."
|
85 |
-
msgstr "Du har inte tillräckliga rättigheter för att få tillgång till den här sidan."
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Categories Images\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: Fri Dec 04 2015 14:03:51 GMT+0100 (CET)\n"
|
6 |
+
"PO-Revision-Date: 2016-03-10 23:56+0200\n"
|
7 |
+
"Last-Translator: Munamamad El Zahlan <zahlan@theplanet.com.eg>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"Language: sv\n"
|
10 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
11 |
+
"MIME-Version: 1.0\n"
|
12 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
13 |
+
"Content-Transfer-Encoding: 8bit\n"
|
14 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
15 |
+
"X-Poedit-Basepath: .\n"
|
16 |
+
"X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;__:1;"
|
17 |
+
"_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;_x:1,2c;"
|
18 |
+
"_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;esc_attr__:1;"
|
19 |
+
"esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;esc_html_x:1,2c;"
|
20 |
+
"comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
|
21 |
+
"X-Loco-Target-Locale: sv_SE\n"
|
22 |
+
"X-Generator: Poedit 1.7.5\n"
|
23 |
+
"X-Poedit-SearchPath-0: ../../plugins/categories-images\n"
|
24 |
+
|
25 |
+
#. Name of the plugin
|
26 |
+
msgid "Categories Images"
|
27 |
+
msgstr "Kategoribilder"
|
28 |
+
|
29 |
+
#. URI of the plugin
|
30 |
+
msgid "http://zahlan.net/blog/2012/06/categories-images"
|
31 |
+
msgstr "http://zahlan.net/blog/2012/06/categories-images"
|
32 |
+
|
33 |
+
#. Description of the plugin
|
34 |
+
msgid ""
|
35 |
+
"Categories Images Plugin allow you to add an image to category or any custom term."
|
36 |
+
msgstr ""
|
37 |
+
"Kategoribildtillägget låter dig lägga till en bild till kategori eller annan egen "
|
38 |
+
"motsvarighet."
|
39 |
+
|
40 |
+
#. Author of the plugin
|
41 |
+
msgid "Muhammad Said El Zahlan"
|
42 |
+
msgstr "Muhammad Said El Zahlan"
|
43 |
+
|
44 |
+
#. Author URI of the plugin
|
45 |
+
msgid "http://zahlan.net"
|
46 |
+
msgstr "http://zahlan.net"
|
47 |
+
|
48 |
+
#: ../../plugins/categories-images/categories-images.php:61 ../..
|
49 |
+
#: plugins/categories-images/categories-images.php:82 ../../plugins/categories-
|
50 |
+
#: images/categories-images.php:229
|
51 |
+
msgid "Image"
|
52 |
+
msgstr "Bild"
|
53 |
+
|
54 |
+
#: ../../plugins/categories-images/categories-images.php:64 ../..
|
55 |
+
#: plugins/categories-images/categories-images.php:84 ../../plugins/categories-
|
56 |
+
#: images/categories-images.php:211
|
57 |
+
msgid "Upload/Add image"
|
58 |
+
msgstr "Ladda upp/Lägg till bild"
|
59 |
+
|
60 |
+
#: ../../plugins/categories-images/categories-images.php:85 ../..
|
61 |
+
#: plugins/categories-images/categories-images.php:212
|
62 |
+
msgid "Remove image"
|
63 |
+
msgstr "Ta bort bild"
|
64 |
+
|
65 |
+
#: ../../plugins/categories-images/categories-images.php:247
|
66 |
+
msgid "Thumbnail"
|
67 |
+
msgstr "Tumnagel"
|
68 |
+
|
69 |
+
#: ../../plugins/categories-images/categories-images.php:267 ../..
|
70 |
+
#: plugins/categories-images/categories-images.php:274
|
71 |
+
msgid "Categories Images settings"
|
72 |
+
msgstr "Kategoribildinställningar"
|
73 |
+
|
74 |
+
#: ../../plugins/categories-images/categories-images.php:275
|
75 |
+
msgid "Excluded Taxonomies"
|
76 |
+
msgstr "Exkludera taxonomier"
|
77 |
+
|
78 |
+
#: ../../plugins/categories-images/categories-images.php:280
|
79 |
+
msgid ""
|
80 |
+
"Please select the taxonomies you want to exclude it from Categories Images plugin"
|
81 |
+
msgstr "Välj vilka taxonomier du vill exkludera från Kategoribildtillägget"
|
82 |
+
|
83 |
+
#: ../../plugins/categories-images/categories-images.php:300
|
84 |
+
msgid "You do not have sufficient permissions to access this page."
|
85 |
+
msgstr "Du har inte tillräckliga rättigheter för att få tillgång till den här sidan."
|
readme.txt
CHANGED
@@ -1,143 +1,146 @@
|
|
1 |
-
=== Categories Images ===
|
2 |
-
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, category featured image, categories featured images, feature image for category
|
5 |
-
Requires at least: 2.8
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.5.
|
8 |
-
|
9 |
-
The Categories Images Plugin allow you to add image with category or taxonomy.
|
10 |
-
|
11 |
-
== Description ==
|
12 |
-
|
13 |
-
The Categories Images Plugin allow you to add image with category or taxonomy.
|
14 |
-
|
15 |
-
Use `<?php if (function_exists('z_taxonomy_image_url')) echo z_taxonomy_image_url(); ?>` to get the url and put it in any img tag or simply use `<?php if (function_exists('z_taxonomy_image')) z_taxonomy_image(); ?>` in (category or taxonomy) template.
|
16 |
-
|
17 |
-
Also from settings menu you can exclude any taxonomies from the plugin to avoid conflicting with another plugins like WooCommerce!
|
18 |
-
|
19 |
-
= More documentation =
|
20 |
-
|
21 |
-
Go to [http://zahlan.net/blog/2012/06/categories-images/](http://zahlan.net/blog/2012/06/categories-images/)
|
22 |
-
|
23 |
-
== Installation ==
|
24 |
-
|
25 |
-
You can install Categories Images directly from the WordPress admin panel:
|
26 |
-
|
27 |
-
1. Visit the Plugins > Add New and search for 'Categories Images'.
|
28 |
-
2. Click to install.
|
29 |
-
3. Once installed, activate and it is functional.
|
30 |
-
|
31 |
-
OR
|
32 |
-
|
33 |
-
Manual Installation:
|
34 |
-
|
35 |
-
1. Download the plugin, then extract it.
|
36 |
-
2. Upload `categories-images` extracted folder to the `/wp-content/plugins/` directory
|
37 |
-
3. Activate the plugin through the 'Plugins' menu in WordPress
|
38 |
-
|
39 |
-
You're done! The Plugin ready to use, for more please check the plugin description.
|
40 |
-
|
41 |
-
= More documentation =
|
42 |
-
|
43 |
-
Go to [http://zahlan.net/blog/2012/06/categories-images/](http://zahlan.net/blog/2012/06/categories-images/)
|
44 |
-
|
45 |
-
== Frequently Asked Questions ==
|
46 |
-
|
47 |
-
Please check the documentation page:
|
48 |
-
[http://zahlan.net/blog/2012/06/categories-images/](http://zahlan.net/blog/2012/06/categories-images/)
|
49 |
-
|
50 |
-
== Screenshots ==
|
51 |
-
|
52 |
-
1. Image preview and new image field in add/edit category or taxonomy with upload button which allow you to select current or upload a new image.
|
53 |
-
2. New image field with (upload/remove) buttons to allow you to edit category or taxonomy image in quick edit.
|
54 |
-
3. When you click the upload button the wordpress upload box will popup, upload or select image then press use this image.
|
55 |
-
4. New submenu (Categories Images) in Settings menu.
|
56 |
-
5. Now you can exclude any taxonomy from the plugin and save changes.
|
57 |
-
|
58 |
-
== Changelog ==
|
59 |
-
= 2.5.
|
60 |
-
* Fix
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
*
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
*
|
70 |
-
|
71 |
-
|
72 |
-
*
|
73 |
-
|
74 |
-
|
75 |
-
*
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
*
|
81 |
-
|
82 |
-
= 2.4.
|
83 |
-
*
|
84 |
-
|
85 |
-
= 2.4 =
|
86 |
-
*
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
*
|
92 |
-
|
93 |
-
= 2.3.
|
94 |
-
*
|
95 |
-
|
96 |
-
= 2.3 =
|
97 |
-
*
|
98 |
-
|
99 |
-
|
100 |
-
*
|
101 |
-
*
|
102 |
-
* Added new
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
= 2.2.
|
110 |
-
* bug
|
111 |
-
|
112 |
-
= 2.2.
|
113 |
-
* bug fix in displaying
|
114 |
-
|
115 |
-
= 2.2.
|
116 |
-
*
|
117 |
-
|
118 |
-
= 2.2 =
|
119 |
-
*
|
120 |
-
|
121 |
-
= 2.
|
122 |
-
* fix a bug in
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
*
|
127 |
-
|
128 |
-
|
129 |
-
*
|
130 |
-
* Added
|
131 |
-
* Added
|
132 |
-
* Added
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
= 1.
|
140 |
-
|
141 |
-
|
142 |
-
= 1.
|
143 |
-
|
|
|
|
|
|
1 |
+
=== Categories Images ===
|
2 |
+
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, category featured image, categories featured images, feature image for category
|
5 |
+
Requires at least: 2.8
|
6 |
+
Tested up to: 4.9.1
|
7 |
+
Stable tag: 2.5.4
|
8 |
+
|
9 |
+
The Categories Images Plugin allow you to add image with category or taxonomy.
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
The Categories Images Plugin allow you to add image with category or taxonomy.
|
14 |
+
|
15 |
+
Use `<?php if (function_exists('z_taxonomy_image_url')) echo z_taxonomy_image_url(); ?>` to get the url and put it in any img tag or simply use `<?php if (function_exists('z_taxonomy_image')) z_taxonomy_image(); ?>` in (category or taxonomy) template.
|
16 |
+
|
17 |
+
Also from settings menu you can exclude any taxonomies from the plugin to avoid conflicting with another plugins like WooCommerce!
|
18 |
+
|
19 |
+
= More documentation =
|
20 |
+
|
21 |
+
Go to [http://zahlan.net/blog/2012/06/categories-images/](http://zahlan.net/blog/2012/06/categories-images/)
|
22 |
+
|
23 |
+
== Installation ==
|
24 |
+
|
25 |
+
You can install Categories Images directly from the WordPress admin panel:
|
26 |
+
|
27 |
+
1. Visit the Plugins > Add New and search for 'Categories Images'.
|
28 |
+
2. Click to install.
|
29 |
+
3. Once installed, activate and it is functional.
|
30 |
+
|
31 |
+
OR
|
32 |
+
|
33 |
+
Manual Installation:
|
34 |
+
|
35 |
+
1. Download the plugin, then extract it.
|
36 |
+
2. Upload `categories-images` extracted folder to the `/wp-content/plugins/` directory
|
37 |
+
3. Activate the plugin through the 'Plugins' menu in WordPress
|
38 |
+
|
39 |
+
You're done! The Plugin ready to use, for more please check the plugin description.
|
40 |
+
|
41 |
+
= More documentation =
|
42 |
+
|
43 |
+
Go to [http://zahlan.net/blog/2012/06/categories-images/](http://zahlan.net/blog/2012/06/categories-images/)
|
44 |
+
|
45 |
+
== Frequently Asked Questions ==
|
46 |
+
|
47 |
+
Please check the documentation page:
|
48 |
+
[http://zahlan.net/blog/2012/06/categories-images/](http://zahlan.net/blog/2012/06/categories-images/)
|
49 |
+
|
50 |
+
== Screenshots ==
|
51 |
+
|
52 |
+
1. Image preview and new image field in add/edit category or taxonomy with upload button which allow you to select current or upload a new image.
|
53 |
+
2. New image field with (upload/remove) buttons to allow you to edit category or taxonomy image in quick edit.
|
54 |
+
3. When you click the upload button the wordpress upload box will popup, upload or select image then press use this image.
|
55 |
+
4. New submenu (Categories Images) in Settings menu.
|
56 |
+
5. Now you can exclude any taxonomy from the plugin and save changes.
|
57 |
+
|
58 |
+
== Changelog ==
|
59 |
+
= 2.5.4 =
|
60 |
+
* Fix compatibility with the latest Wordpress version
|
61 |
+
|
62 |
+
= 2.5.3 =
|
63 |
+
* Fix not displaying single tag image bug in tag.php template
|
64 |
+
* Adding language support for Swedish. Thanks to Simon Sandgren
|
65 |
+
|
66 |
+
= 2.5.2 =
|
67 |
+
* Fix displaying full size image bug in backend
|
68 |
+
* Fix quick edit bug
|
69 |
+
* Some code enhancements
|
70 |
+
|
71 |
+
= 2.5.1 =
|
72 |
+
* Adding language support for Russian.
|
73 |
+
* Adding language support for Serbian. Thanks to Andrijana Nikolic [http://webhostinggeeks.com/].
|
74 |
+
* Adding language support for Catalan. Thanks to Marc Queralt i Bassa [http://www.demomentsomtres.com/].
|
75 |
+
* Change the plugin text domain from zci to categories-images to match the plugin slug as requested by Wordpress.
|
76 |
+
|
77 |
+
= 2.5 =
|
78 |
+
* Adding language support for Ukrainian. Thanks to Michael Yunat [http://getvoip.com].
|
79 |
+
* Adding new function z_taxonomy_image() to display category or taxonomy image directly with support for size, alt and other attributes, for and how to use it please check the documentations.
|
80 |
+
* Some code enhancements.
|
81 |
+
|
82 |
+
= 2.4.2 =
|
83 |
+
* Update code to reduce db queries. Thanks to fburatti [http://profiles.wordpress.org/fburatti/].
|
84 |
+
|
85 |
+
= 2.4.1 =
|
86 |
+
* Fix placeholder bug in backend.
|
87 |
+
|
88 |
+
= 2.4 =
|
89 |
+
* Adding language support for Spanish (Thansk so much to Maria Ramos [http://webhostinghub.com]).
|
90 |
+
* Adding support for resizing categories images (Thanks so much to Rahil Wazir).
|
91 |
+
* Some code enhancements.
|
92 |
+
|
93 |
+
= 2.3.2 =
|
94 |
+
* Adding language support for French.
|
95 |
+
|
96 |
+
= 2.3.1 =
|
97 |
+
* Bug fix in js for Wordpress media uploader.
|
98 |
+
|
99 |
+
= 2.3 =
|
100 |
+
* New screenshots.
|
101 |
+
* Updated language file.
|
102 |
+
* Added support for both old and new Wordpress media uploader.
|
103 |
+
* Added new submenu (Categories Images) in Settings menu.
|
104 |
+
* Added new settings for excluding any taxonomies from the plugin.
|
105 |
+
* Added new placeholder image.
|
106 |
+
|
107 |
+
Thanks to Patrick http://www.patrickbos.nl and Hassan http://profiles.wordpress.org/hassanhamm/ for the new ideas.
|
108 |
+
|
109 |
+
= 2.2.4 =
|
110 |
+
* java script bug fixed, reported about conflicting with WooCommerce plugin. Thanks to Marty McGee.
|
111 |
+
|
112 |
+
= 2.2.3 =
|
113 |
+
* bug fix in displaying category or taxonomy image at the frontend.
|
114 |
+
|
115 |
+
= 2.2.2 =
|
116 |
+
* bug fix in displaying placeholder image in wp-admin.
|
117 |
+
|
118 |
+
= 2.2.1 =
|
119 |
+
* edit z_taxonomy_image_url() to only return data in case the user inserted image for the selected category or taxonomy
|
120 |
+
|
121 |
+
= 2.2 =
|
122 |
+
* fix a bug, prevent a function from running execpt when editing a category or taxonomy to avoid affecting other wordpress edit pages in the wp-admin
|
123 |
+
|
124 |
+
= 2.1 =
|
125 |
+
* fix a bug in languages
|
126 |
+
* fix a bug in quick edit category or taxonomy
|
127 |
+
|
128 |
+
= 2.0 =
|
129 |
+
* New screenshots.
|
130 |
+
* Added l10n support.
|
131 |
+
* Added Arabic and Chinese languages.
|
132 |
+
* Added new button for upload or select an image using wordpress media uploader.
|
133 |
+
* Added default image placeholder.
|
134 |
+
* Added thumbnail in categories or taxonomies list.
|
135 |
+
* Added image thumbnail, image text box, upload button and remove button in quick edit.
|
136 |
+
|
137 |
+
Thank so much to Joe Tse http://tkjune.com :)
|
138 |
+
|
139 |
+
= 1.2 =
|
140 |
+
Adding some screenshots
|
141 |
+
|
142 |
+
= 1.1 =
|
143 |
+
Fix javascript bug with wordpress 3.4
|
144 |
+
|
145 |
+
= 1.0 =
|
146 |
+
The First Release
|