Version Description
Fixes media modal for newer versions of WordPress. Tested up to WordPress 4.3.1 (requires 3.4+).
Download this release
Release Info
Developer | husobj |
Plugin | Taxonomy Images |
Version | 0.9 |
Comparing to | |
See all releases |
Code changes from version 0.8.0 to 0.9
- code-snippets.php +11 -4
- controls.png +0 -0
- admin.css → css/admin.css +26 -3
- style.css → css/style.css +9 -5
- default.png +0 -0
- deprecated.php +3 -3
- edit-tags.js → js/edit-tags.js +0 -0
- js/media-modal.js +162 -0
- media-upload-popup.js → js/media-upload-popup.js +0 -0
- languages/taxonomy-images-es_ES.mo +0 -0
- languages/taxonomy-images-es_ES.po +234 -0
- languages/taxonomy-images.pot +81 -74
- readme.md +188 -164
- readme.txt +116 -98
- taxonomy-images.php +63 -17
code-snippets.php
CHANGED
@@ -1,9 +1,16 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
-
*
|
|
|
|
|
|
|
|
|
4 |
*/
|
5 |
|
6 |
|
|
|
|
|
7 |
exit;
|
8 |
|
9 |
|
@@ -11,13 +18,13 @@ exit;
|
|
11 |
/*
|
12 |
* Append the term images to content + excerpt.
|
13 |
*/
|
14 |
-
function
|
15 |
return $content . apply_filters( 'taxonomy-images-list-the-terms', '', array(
|
16 |
'image_size' => 'detail',
|
17 |
) );
|
18 |
}
|
19 |
-
add_filter( 'the_content', '
|
20 |
-
add_filter( 'the_excerpt', '
|
21 |
|
22 |
|
23 |
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
+
* @package Taxonomy Images
|
5 |
+
* @subpackage Code Snippets
|
6 |
+
*
|
7 |
+
* The following are a series of example tests to check the output
|
8 |
+
* of the Taxonomy Images filters.
|
9 |
*/
|
10 |
|
11 |
|
12 |
+
|
13 |
+
// Don't actually output any of this!
|
14 |
exit;
|
15 |
|
16 |
|
18 |
/*
|
19 |
* Append the term images to content + excerpt.
|
20 |
*/
|
21 |
+
function taxonomy_images_test_theme_append_the_term_images( $content ) {
|
22 |
return $content . apply_filters( 'taxonomy-images-list-the-terms', '', array(
|
23 |
'image_size' => 'detail',
|
24 |
) );
|
25 |
}
|
26 |
+
add_filter( 'the_content', 'taxonomy_images_test_theme_append_the_term_images' );
|
27 |
+
add_filter( 'the_excerpt', 'taxonomy_images_test_theme_append_the_term_images' );
|
28 |
|
29 |
|
30 |
|
controls.png
CHANGED
Binary file
|
admin.css → css/admin.css
RENAMED
@@ -1,29 +1,40 @@
|
|
|
|
1 |
.taxonomy-images-modal .create-association .term-name {
|
2 |
font-style: italic;
|
3 |
}
|
|
|
4 |
.taxonomy-images-modal .create-association {
|
5 |
display: inline;
|
6 |
}
|
|
|
7 |
.taxonomy-images-modal .remove-association {
|
8 |
color: #bc0b0b;
|
9 |
cursor: pointer;
|
10 |
display: none;
|
11 |
text-decoration: underline;
|
12 |
}
|
|
|
13 |
.taxonomy-images-modal #tab-type_url,
|
14 |
.taxonomy-images-modal .savesend input {
|
15 |
display: none !important;
|
16 |
}
|
|
|
17 |
.taxonomy-image-thumbnail {
|
18 |
display: block;
|
19 |
margin-bottom: 3px;
|
20 |
overflow: hidden;
|
21 |
text-align: center;
|
22 |
-
width:
|
23 |
-
height:
|
24 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
.taxonomy-image-control .control {
|
26 |
-
background: url( controls.png );
|
27 |
background-repeat: no-repeat;
|
28 |
display: block;
|
29 |
float: left;
|
@@ -31,27 +42,39 @@
|
|
31 |
width: 15px;
|
32 |
height: 15px;
|
33 |
}
|
|
|
34 |
.taxonomy-image-control .control:hover {
|
35 |
cursor: pointer;
|
36 |
}
|
|
|
37 |
.taxonomy-image-control .upload {
|
38 |
background-position: 0 0;
|
39 |
}
|
|
|
40 |
.taxonomy-image-control .upload:hover {
|
41 |
background-position: -15px 0;
|
42 |
}
|
|
|
43 |
.taxonomy-image-control .remove {
|
44 |
background-position: -30px 0;
|
45 |
}
|
|
|
46 |
.taxonomy-image-control .remove:hover {
|
47 |
background-position: -45px 0;
|
48 |
}
|
|
|
49 |
.taxonomy-image-control .library {
|
50 |
background-position: -60px 0;
|
51 |
}
|
|
|
52 |
.taxonomy-image-control .hide {
|
53 |
visibility: hidden;
|
54 |
}
|
|
|
55 |
.taxonomy-image-control .show {
|
56 |
visibility: visible;
|
57 |
}
|
|
|
|
|
|
|
|
1 |
+
|
2 |
.taxonomy-images-modal .create-association .term-name {
|
3 |
font-style: italic;
|
4 |
}
|
5 |
+
|
6 |
.taxonomy-images-modal .create-association {
|
7 |
display: inline;
|
8 |
}
|
9 |
+
|
10 |
.taxonomy-images-modal .remove-association {
|
11 |
color: #bc0b0b;
|
12 |
cursor: pointer;
|
13 |
display: none;
|
14 |
text-decoration: underline;
|
15 |
}
|
16 |
+
|
17 |
.taxonomy-images-modal #tab-type_url,
|
18 |
.taxonomy-images-modal .savesend input {
|
19 |
display: none !important;
|
20 |
}
|
21 |
+
|
22 |
.taxonomy-image-thumbnail {
|
23 |
display: block;
|
24 |
margin-bottom: 3px;
|
25 |
overflow: hidden;
|
26 |
text-align: center;
|
27 |
+
width: 75px;
|
28 |
+
height: 75px;
|
29 |
}
|
30 |
+
|
31 |
+
.taxonomy-image-thumbnail img {
|
32 |
+
width: 75px;
|
33 |
+
height: 75px;
|
34 |
+
}
|
35 |
+
|
36 |
.taxonomy-image-control .control {
|
37 |
+
background: url( ../controls.png );
|
38 |
background-repeat: no-repeat;
|
39 |
display: block;
|
40 |
float: left;
|
42 |
width: 15px;
|
43 |
height: 15px;
|
44 |
}
|
45 |
+
|
46 |
.taxonomy-image-control .control:hover {
|
47 |
cursor: pointer;
|
48 |
}
|
49 |
+
|
50 |
.taxonomy-image-control .upload {
|
51 |
background-position: 0 0;
|
52 |
}
|
53 |
+
|
54 |
.taxonomy-image-control .upload:hover {
|
55 |
background-position: -15px 0;
|
56 |
}
|
57 |
+
|
58 |
.taxonomy-image-control .remove {
|
59 |
background-position: -30px 0;
|
60 |
}
|
61 |
+
|
62 |
.taxonomy-image-control .remove:hover {
|
63 |
background-position: -45px 0;
|
64 |
}
|
65 |
+
|
66 |
.taxonomy-image-control .library {
|
67 |
background-position: -60px 0;
|
68 |
}
|
69 |
+
|
70 |
.taxonomy-image-control .hide {
|
71 |
visibility: hidden;
|
72 |
}
|
73 |
+
|
74 |
.taxonomy-image-control .show {
|
75 |
visibility: visible;
|
76 |
}
|
77 |
+
|
78 |
+
body.taxonomy-images-modal {
|
79 |
+
background: #f1f1f1 !important;
|
80 |
+
}
|
style.css → css/style.css
RENAMED
@@ -1,8 +1,10 @@
|
|
|
|
1 |
.taxonomy-images-the-terms {
|
2 |
margin: 10px 0;
|
3 |
padding: 0;
|
4 |
zoom: 1;
|
5 |
}
|
|
|
6 |
.taxonomy-images-the-terms:before,
|
7 |
.taxonomy-images-the-terms:after {
|
8 |
clear: both;
|
@@ -11,14 +13,16 @@
|
|
11 |
height: 0;
|
12 |
visibility: hidden;
|
13 |
}
|
|
|
14 |
.taxonomy-images-the-terms li,
|
15 |
.taxonomy-images-the-terms a,
|
16 |
.taxonomy-images-the-terms img {
|
17 |
-
float:left;
|
18 |
-
margin:0;
|
19 |
-
padding:0;
|
20 |
}
|
|
|
21 |
.taxonomy-images-the-terms li {
|
22 |
-
list-style-type:none;
|
23 |
-
margin:0 10px 10px 0;
|
24 |
}
|
1 |
+
|
2 |
.taxonomy-images-the-terms {
|
3 |
margin: 10px 0;
|
4 |
padding: 0;
|
5 |
zoom: 1;
|
6 |
}
|
7 |
+
|
8 |
.taxonomy-images-the-terms:before,
|
9 |
.taxonomy-images-the-terms:after {
|
10 |
clear: both;
|
13 |
height: 0;
|
14 |
visibility: hidden;
|
15 |
}
|
16 |
+
|
17 |
.taxonomy-images-the-terms li,
|
18 |
.taxonomy-images-the-terms a,
|
19 |
.taxonomy-images-the-terms img {
|
20 |
+
float: left;
|
21 |
+
margin: 0;
|
22 |
+
padding: 0;
|
23 |
}
|
24 |
+
|
25 |
.taxonomy-images-the-terms li {
|
26 |
+
list-style-type: none;
|
27 |
+
margin: 0 10px 10px 0;
|
28 |
}
|
default.png
CHANGED
Binary file
|
deprecated.php
CHANGED
@@ -39,14 +39,14 @@ function taxonomy_images_plugin_shortcode_deprecated( $atts = array() ) { // DEP
|
|
39 |
|
40 |
if( $template === 'grid' ) {
|
41 |
$o.= "\n\t" . '<div class="taxonomy_image_plugin-' . $template . '">';
|
42 |
-
$o.= "\n\t\t" . '<a style="float:left;" title="' . $title_attr . '" href="' . $url . '">' . $img . '</a>';
|
43 |
$o.= "\n\t" . '</div>';
|
44 |
}
|
45 |
else {
|
46 |
$o.= "\n\t\t" . '<a title="' . $title_attr . '" href="' . $url . '">' . $img . '</a>';;
|
47 |
-
$o.= "\n\t\t" . '<h2 style="clear:none;margin-top:0;padding-top:0;line-height:1em;"><a href="' . $url . '">' . $title . '</a></h2>';
|
48 |
$o.= $description;
|
49 |
-
$o.= "\n\t" . '<div style="clear:both;height:1.5em"></div>';
|
50 |
$o.= "\n";
|
51 |
}
|
52 |
}
|
39 |
|
40 |
if( $template === 'grid' ) {
|
41 |
$o.= "\n\t" . '<div class="taxonomy_image_plugin-' . $template . '">';
|
42 |
+
$o.= "\n\t\t" . '<a style="float: left;" title="' . $title_attr . '" href="' . $url . '">' . $img . '</a>';
|
43 |
$o.= "\n\t" . '</div>';
|
44 |
}
|
45 |
else {
|
46 |
$o.= "\n\t\t" . '<a title="' . $title_attr . '" href="' . $url . '">' . $img . '</a>';;
|
47 |
+
$o.= "\n\t\t" . '<h2 style="clear: none; margin-top: 0; padding-top: 0; line-height: 1em;"><a href="' . $url . '">' . $title . '</a></h2>';
|
48 |
$o.= $description;
|
49 |
+
$o.= "\n\t" . '<div style="clear: both; height: 1.5em;"></div>';
|
50 |
$o.= "\n";
|
51 |
}
|
52 |
}
|
edit-tags.js → js/edit-tags.js
RENAMED
File without changes
|
js/media-modal.js
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
// Media Modal Frame
|
3 |
+
var taxonomy_images_file_frame;
|
4 |
+
|
5 |
+
( function( $ ) {
|
6 |
+
|
7 |
+
$( document ).ready( function() {
|
8 |
+
|
9 |
+
// Store the old id (not sure if this is application when editing a term)
|
10 |
+
TaxonomyImagesMediaModal.wp_media_post_id = wp.media.model.settings.post.id;
|
11 |
+
|
12 |
+
// When the remove icon is clicked...
|
13 |
+
$( '.taxonomy-image-control a.remove' ).on( 'click', function( event ) {
|
14 |
+
|
15 |
+
event.preventDefault();
|
16 |
+
|
17 |
+
var tt_id = $( this ).data( 'tt-id' );
|
18 |
+
|
19 |
+
$.ajax( {
|
20 |
+
url : ajaxurl,
|
21 |
+
type : 'POST',
|
22 |
+
dataType : 'json',
|
23 |
+
data : {
|
24 |
+
'action' : 'taxonomy_image_plugin_remove_association',
|
25 |
+
'wp_nonce' : $( this ).data( 'nonce' ),
|
26 |
+
'tt_id' : $( this ).data( 'tt-id' )
|
27 |
+
},
|
28 |
+
cache : false,
|
29 |
+
success : function ( response ) {
|
30 |
+
if ( 'good' === response.status ) {
|
31 |
+
|
32 |
+
selector = $( '#taxonomy-image-control-' + tt_id );
|
33 |
+
|
34 |
+
/* Update the image on the screen below */
|
35 |
+
selector.find( '.taxonomy-image-thumbnail img' ).attr( 'src', TaxonomyImagesMediaModal.default_img_src );
|
36 |
+
|
37 |
+
selector.find( 'a.taxonomy-image-thumbnail' ).data( 'attachment-id', 0 );
|
38 |
+
selector.find( 'a.upload' ).data( 'attachment-id', 0 );
|
39 |
+
|
40 |
+
/* Show delete control on the screen below */
|
41 |
+
selector.find( '.remove' ).addClass( 'hide' );
|
42 |
+
|
43 |
+
}
|
44 |
+
else if ( 'bad' === response.status ) {
|
45 |
+
alert( response.why );
|
46 |
+
}
|
47 |
+
}
|
48 |
+
} );
|
49 |
+
|
50 |
+
} );
|
51 |
+
|
52 |
+
// When image or upload icon clicked...
|
53 |
+
$( '.taxonomy-image-control a.upload, .taxonomy-image-control a.taxonomy-image-thumbnail' ).on( 'click', function( event ) {
|
54 |
+
|
55 |
+
event.preventDefault();
|
56 |
+
|
57 |
+
button = $( this );
|
58 |
+
|
59 |
+
TaxonomyImagesMediaModal.attachment_id = $( this ).data( 'attachment-id' );
|
60 |
+
TaxonomyImagesMediaModal.nonce = $( this ).data( 'nonce' );
|
61 |
+
|
62 |
+
// If the media frame already exists, reopen it.
|
63 |
+
if ( taxonomy_images_file_frame ) {
|
64 |
+
|
65 |
+
// Set the post ID to the term being edited and open
|
66 |
+
wp.media.model.settings.post.id = $( this ).data( 'tt-id' );
|
67 |
+
taxonomy_images_file_frame.uploader.uploader.param( 'post_id', $( this ).data( 'tt-id' ) );
|
68 |
+
taxonomy_images_file_frame.open();
|
69 |
+
return;
|
70 |
+
|
71 |
+
} else {
|
72 |
+
|
73 |
+
// Set the wp.media post id so the uploader grabs the term ID being edited
|
74 |
+
wp.media.model.settings.post.id = $( this ).data( 'tt-id' );
|
75 |
+
|
76 |
+
}
|
77 |
+
|
78 |
+
// Create the media frame.
|
79 |
+
taxonomy_images_file_frame = wp.media.frames.taxonomy_images_file_frame = wp.media( {
|
80 |
+
title : TaxonomyImagesMediaModal.uploader_title,
|
81 |
+
button : {
|
82 |
+
text : TaxonomyImagesMediaModal.uploader_button_text,
|
83 |
+
},
|
84 |
+
multiple : false
|
85 |
+
} );
|
86 |
+
|
87 |
+
// Pre-select selected attachment
|
88 |
+
wp.media.frames.taxonomy_images_file_frame.on( 'open', function() {
|
89 |
+
var selection = wp.media.frames.taxonomy_images_file_frame.state().get( 'selection' );
|
90 |
+
var selected_id = TaxonomyImagesMediaModal.attachment_id;
|
91 |
+
if ( selected_id > 0 ) {
|
92 |
+
attachment = wp.media.attachment( selected_id );
|
93 |
+
attachment.fetch();
|
94 |
+
selection.add( attachment ? [ attachment ] : [] );
|
95 |
+
}
|
96 |
+
} );
|
97 |
+
|
98 |
+
// When an image is selected, run a callback.
|
99 |
+
taxonomy_images_file_frame.on( 'select', function() {
|
100 |
+
|
101 |
+
// We set multiple to false so only get one image from the uploader
|
102 |
+
attachment = taxonomy_images_file_frame.state().get( 'selection' ).first().toJSON();
|
103 |
+
|
104 |
+
var tt_id = wp.media.model.settings.post.id;
|
105 |
+
var attachment_id = attachment.id;
|
106 |
+
|
107 |
+
// Do something with attachment.id and/or attachment.url here
|
108 |
+
$.ajax( {
|
109 |
+
url : ajaxurl,
|
110 |
+
type : 'POST',
|
111 |
+
dataType : 'json',
|
112 |
+
data : {
|
113 |
+
'action' : 'taxonomy_image_create_association',
|
114 |
+
'wp_nonce' : TaxonomyImagesMediaModal.nonce,
|
115 |
+
'attachment_id' : attachment.id,
|
116 |
+
'tt_id' : parseInt( wp.media.model.settings.post.id )
|
117 |
+
},
|
118 |
+
success : function ( response ) {
|
119 |
+
if ( 'good' === response.status ) {
|
120 |
+
var parent_id = button.parent().attr( 'id' );
|
121 |
+
|
122 |
+
/* Set state of all other buttons. */
|
123 |
+
$( '.taxonomy-image-modal-control' ).each( function( i, e ) {
|
124 |
+
if ( parent_id == $( e ).attr( 'id' ) ) {
|
125 |
+
return true;
|
126 |
+
}
|
127 |
+
$( e ).find( '.create-association' ).show();
|
128 |
+
$( e ).find( '.remove-association' ).hide();
|
129 |
+
} );
|
130 |
+
|
131 |
+
selector = $( '#taxonomy-image-control-' + tt_id );
|
132 |
+
|
133 |
+
/* Update the image on the screen below */
|
134 |
+
selector.find( '.taxonomy-image-thumbnail img' ).attr( 'src', response.attachment_thumb_src );
|
135 |
+
|
136 |
+
selector.find( 'a.taxonomy-image-thumbnail' ).data( 'attachment-id', attachment_id );
|
137 |
+
selector.find( 'a.upload' ).data( 'attachment-id', attachment_id );
|
138 |
+
|
139 |
+
/* Show delete control on the screen below */
|
140 |
+
$( selector ).find( '.remove' ).each( function ( i, e ) {
|
141 |
+
$( e ).removeClass( 'hide' );
|
142 |
+
} );
|
143 |
+
|
144 |
+
}
|
145 |
+
else if ( 'bad' === response.status ) {
|
146 |
+
alert( response.why );
|
147 |
+
}
|
148 |
+
}
|
149 |
+
} );
|
150 |
+
|
151 |
+
wp.media.model.settings.post.id = TaxonomyImagesMediaModal.wp_media_post_id;
|
152 |
+
|
153 |
+
} );
|
154 |
+
|
155 |
+
// Finally, open the modal
|
156 |
+
taxonomy_images_file_frame.open();
|
157 |
+
|
158 |
+
} );
|
159 |
+
|
160 |
+
} );
|
161 |
+
|
162 |
+
} )( jQuery );
|
media-upload-popup.js → js/media-upload-popup.js
RENAMED
File without changes
|
languages/taxonomy-images-es_ES.mo
ADDED
Binary file
|
languages/taxonomy-images-es_ES.po
ADDED
@@ -0,0 +1,234 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (C) 2011 Taxonomy Images
|
2 |
+
# This file is distributed under the same license as the Taxonomy Images package.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"Project-Id-Version: Taxonomy Images 0.7.2\n"
|
6 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/taxonomy-images\n"
|
7 |
+
"POT-Creation-Date: 2015-09-29 11:32+0200\n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2015-09-29 14:20+0200\n"
|
12 |
+
"Language-Team: \n"
|
13 |
+
"X-Generator: Poedit 1.8.5\n"
|
14 |
+
"Last-Translator: David <david@closemarketing.es>\n"
|
15 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
16 |
+
"Language: es_ES\n"
|
17 |
+
|
18 |
+
#: taxonomy-images.php:125
|
19 |
+
msgid "Associate with %1$s"
|
20 |
+
msgstr "Asociado con %1$s"
|
21 |
+
|
22 |
+
#: taxonomy-images.php:125 taxonomy-images.php:127
|
23 |
+
msgid "this term"
|
24 |
+
msgstr "este término"
|
25 |
+
|
26 |
+
#: taxonomy-images.php:127
|
27 |
+
msgid "Remove association with %1$s"
|
28 |
+
msgstr "Retirar asociación con %1$s"
|
29 |
+
|
30 |
+
#. translators: Notice displayed on the custom administration page.
|
31 |
+
#: taxonomy-images.php:281
|
32 |
+
msgid "Image support for taxonomies successfully updated"
|
33 |
+
msgstr "Soporte Imágenes para Taxonomía se actualizó correctamente"
|
34 |
+
|
35 |
+
#. translators: Notice displayed on the custom administration page.
|
36 |
+
#: taxonomy-images.php:284
|
37 |
+
msgid "Image support has been disabled for all taxonomies."
|
38 |
+
msgstr ""
|
39 |
+
"Soporte Imágenes para Taxonomía se deshabilitó para todas las taxonomías."
|
40 |
+
|
41 |
+
#: taxonomy-images.php:324 taxonomy-images.php:1170
|
42 |
+
msgid "Settings"
|
43 |
+
msgstr "Configuración"
|
44 |
+
|
45 |
+
#: taxonomy-images.php:330
|
46 |
+
msgid "Taxonomies"
|
47 |
+
msgstr "Taxonomías"
|
48 |
+
|
49 |
+
#. Plugin Name of the plugin/theme
|
50 |
+
#: taxonomy-images.php:349 taxonomy-images.php:350
|
51 |
+
msgid "Taxonomy Images"
|
52 |
+
msgstr "Imágenes Taxonomía"
|
53 |
+
|
54 |
+
#. translators: Heading of the custom administration page.
|
55 |
+
#: taxonomy-images.php:377
|
56 |
+
msgid "Taxonomy Images Plugin Settings"
|
57 |
+
msgstr "Ajustes Módulo Imágenes Taxonomía"
|
58 |
+
|
59 |
+
#. translators: Button on the custom administration page.
|
60 |
+
#: taxonomy-images.php:385
|
61 |
+
msgid "Save Changes"
|
62 |
+
msgstr "Guardar Cambios"
|
63 |
+
|
64 |
+
#. translators: An ajax request has failed for an unknown reason.
|
65 |
+
#: taxonomy-images.php:432
|
66 |
+
msgid "Unknown error encountered"
|
67 |
+
msgstr "Se encontró un error desconocido"
|
68 |
+
|
69 |
+
#: taxonomy-images.php:507 taxonomy-images.php:589
|
70 |
+
msgid "tt_id not sent"
|
71 |
+
msgstr "tt_id no enviado"
|
72 |
+
|
73 |
+
#: taxonomy-images.php:515 taxonomy-images.php:597
|
74 |
+
msgid "tt_id is empty"
|
75 |
+
msgstr "tt_id está vacía"
|
76 |
+
|
77 |
+
#: taxonomy-images.php:522 taxonomy-images.php:604
|
78 |
+
msgid "You do not have the correct capability to manage this term"
|
79 |
+
msgstr "No tienes permisos para gestionar este término"
|
80 |
+
|
81 |
+
#: taxonomy-images.php:529
|
82 |
+
msgid "No nonce included."
|
83 |
+
msgstr "Nonce no incluido."
|
84 |
+
|
85 |
+
#: taxonomy-images.php:536 taxonomy-images.php:618
|
86 |
+
msgid "Nonce did not match"
|
87 |
+
msgstr "Nonce no coincide"
|
88 |
+
|
89 |
+
#: taxonomy-images.php:543
|
90 |
+
msgid "Image id not sent"
|
91 |
+
msgstr "ID de la imagen no enviado"
|
92 |
+
|
93 |
+
#: taxonomy-images.php:551
|
94 |
+
msgid "Image id is not a positive integer"
|
95 |
+
msgstr "Id de la imagen no es un número entero positivo"
|
96 |
+
|
97 |
+
#: taxonomy-images.php:560
|
98 |
+
msgid "Image successfully associated"
|
99 |
+
msgstr "Imagen asociada con éxito"
|
100 |
+
|
101 |
+
#: taxonomy-images.php:567
|
102 |
+
msgid "Association could not be created"
|
103 |
+
msgstr "No se pudo crear la Asociación"
|
104 |
+
|
105 |
+
#: taxonomy-images.php:611
|
106 |
+
msgid "No nonce included"
|
107 |
+
msgstr "Nonce no incluido."
|
108 |
+
|
109 |
+
#: taxonomy-images.php:626
|
110 |
+
msgid "Nothing to remove"
|
111 |
+
msgstr "No hay nada que quitar"
|
112 |
+
|
113 |
+
#: taxonomy-images.php:635
|
114 |
+
msgid "Association successfully removed"
|
115 |
+
msgstr "Asociación eliminada correctamente"
|
116 |
+
|
117 |
+
#: taxonomy-images.php:641
|
118 |
+
msgid "Association could not be removed"
|
119 |
+
msgstr "No se pudo eliminar la Asociación"
|
120 |
+
|
121 |
+
#: taxonomy-images.php:711 taxonomy-images.php:760
|
122 |
+
msgid "Image"
|
123 |
+
msgstr "Imagen"
|
124 |
+
|
125 |
+
#: taxonomy-images.php:754 taxonomy-images.php:790
|
126 |
+
msgid "term"
|
127 |
+
msgstr "término"
|
128 |
+
|
129 |
+
#: taxonomy-images.php:764
|
130 |
+
msgid "Associate an image from your media library to this %1$s."
|
131 |
+
msgstr "Asociar una imagen de tu biblioteca de medios para este%1$s."
|
132 |
+
|
133 |
+
#: taxonomy-images.php:808
|
134 |
+
msgid "Associate an image with the %1$s named “%2$s”."
|
135 |
+
msgstr "Asociar una imagen con los %1$s llamado “%2$s”."
|
136 |
+
|
137 |
+
#: taxonomy-images.php:809
|
138 |
+
msgid "Upload a new image for this %s."
|
139 |
+
msgstr "Sube una nueva imagen para este %s."
|
140 |
+
|
141 |
+
#: taxonomy-images.php:809
|
142 |
+
msgid "Upload."
|
143 |
+
msgstr "Subir."
|
144 |
+
|
145 |
+
#: taxonomy-images.php:810
|
146 |
+
msgid "Remove image from this %s."
|
147 |
+
msgstr "Eliminar la imagen de este %s."
|
148 |
+
|
149 |
+
#: taxonomy-images.php:810
|
150 |
+
msgid "Delete"
|
151 |
+
msgstr "Eliminar"
|
152 |
+
|
153 |
+
#: taxonomy-images.php:839
|
154 |
+
msgid "“"
|
155 |
+
msgstr "“"
|
156 |
+
|
157 |
+
#: taxonomy-images.php:840
|
158 |
+
msgid "”"
|
159 |
+
msgstr "”"
|
160 |
+
|
161 |
+
#: taxonomy-images.php:841
|
162 |
+
msgid "Associating …"
|
163 |
+
msgstr "Asociando …"
|
164 |
+
|
165 |
+
#: taxonomy-images.php:842
|
166 |
+
msgid "Successfully Associated"
|
167 |
+
msgstr "Asociado correctamente"
|
168 |
+
|
169 |
+
#: taxonomy-images.php:843
|
170 |
+
msgid "Removing …"
|
171 |
+
msgstr "Eliminando …"
|
172 |
+
|
173 |
+
#: taxonomy-images.php:844
|
174 |
+
msgid "Successfully Removed"
|
175 |
+
msgstr "Eliminado correctamente"
|
176 |
+
|
177 |
+
#: taxonomy-images.php:1098
|
178 |
+
msgid ""
|
179 |
+
"The %1$s argument for %2$s is set to %3$s which is not a registered taxonomy. "
|
180 |
+
"Please check the spelling and update the argument."
|
181 |
+
msgstr ""
|
182 |
+
"Las argumento %1$s para%2$s se establece en%3$s que no es una taxonomía "
|
183 |
+
"registrada. Por favor, comprueba la ortografía y actualiza el argumento."
|
184 |
+
|
185 |
+
#: taxonomy-images.php:1099
|
186 |
+
msgid "taxonomy"
|
187 |
+
msgstr "taxonomía"
|
188 |
+
|
189 |
+
#: taxonomy-images.php:1109
|
190 |
+
msgid "No taxonomies have image support. %1$s"
|
191 |
+
msgstr "No hay taxonomías con soporte de imágenes. %1$s"
|
192 |
+
|
193 |
+
#: taxonomy-images.php:1114
|
194 |
+
msgid "The %1$s taxonomy does not have image support. %2$s"
|
195 |
+
msgstr "La taxonomía de %1$s no tiene soporte para la imagen. %2$s"
|
196 |
+
|
197 |
+
#: taxonomy-images.php:1139
|
198 |
+
msgid "The %1$s has been called directly. Please use the %2$s filter instead."
|
199 |
+
msgstr "El%1$s se ha llamado directamente. Utiliza el filtro de%2$s en su lugar."
|
200 |
+
|
201 |
+
#: taxonomy-images.php:1175
|
202 |
+
msgid "Donate"
|
203 |
+
msgstr "Donar"
|
204 |
+
|
205 |
+
#: taxonomy-images.php:1193
|
206 |
+
msgid "Manage Settings"
|
207 |
+
msgstr "Administrar configuración"
|
208 |
+
|
209 |
+
#: public-filters.php:376
|
210 |
+
msgid ""
|
211 |
+
"%1$s is not a property of the current queried object. This usually happens "
|
212 |
+
"when the %2$s filter is used in an unsupported template file. This filter has "
|
213 |
+
"been designed to work in taxonomy archives which are traditionally served by "
|
214 |
+
"one of the following template files: category.php, tag.php or taxonomy.php. "
|
215 |
+
"Learn more about %3$s."
|
216 |
+
msgstr ""
|
217 |
+
"%1$s no es una propiedad del objeto consultado actual. Esto suele suceder "
|
218 |
+
"cuando se utiliza filtro de los %2$s en un archivo de plantilla no compatible. "
|
219 |
+
"Este filtro ha sido diseñado para trabajar en los archivos de taxonomía que "
|
220 |
+
"tradicionalmente son atendidos por uno de los siguientes archivos de "
|
221 |
+
"plantilla: category.php, tag.php o taxonomy.php. Obten más información acerca "
|
222 |
+
"de %3$s."
|
223 |
+
|
224 |
+
#: public-filters.php:377
|
225 |
+
msgid "term_taxonomy_id"
|
226 |
+
msgstr "term_taxonomy_id"
|
227 |
+
|
228 |
+
#. Description of the plugin/theme
|
229 |
+
msgid ""
|
230 |
+
"Associate images from your media library to categories, tags and custom "
|
231 |
+
"taxonomies."
|
232 |
+
msgstr ""
|
233 |
+
"Asociar imágenes desde biblioteca de medios a categorías, etiquetas y "
|
234 |
+
"taxonomías personalizadas."
|
languages/taxonomy-images.pot
CHANGED
@@ -1,221 +1,228 @@
|
|
1 |
# Copyright (C) 2011 Taxonomy Images
|
2 |
# This file is distributed under the same license as the Taxonomy Images package.
|
|
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Taxonomy Images
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/taxonomy-images\n"
|
7 |
-
"POT-Creation-Date:
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
"PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
-
"Language-Team: LANGUAGE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
-
#:
|
|
|
|
|
|
|
|
|
|
|
16 |
msgid "Associate with %1$s"
|
17 |
msgstr ""
|
18 |
|
19 |
-
#: taxonomy-images.php:
|
20 |
msgid "this term"
|
21 |
msgstr ""
|
22 |
|
23 |
-
#: taxonomy-images.php:
|
|
|
24 |
msgid "Remove association with %1$s"
|
25 |
msgstr ""
|
26 |
|
27 |
-
|
28 |
-
#: taxonomy-images.php:281
|
29 |
msgid "Image support for taxonomies successfully updated"
|
30 |
msgstr ""
|
31 |
|
32 |
-
|
33 |
-
#: taxonomy-images.php:284
|
34 |
msgid "Image support has been disabled for all taxonomies."
|
35 |
msgstr ""
|
36 |
|
37 |
-
#: taxonomy-images.php:
|
38 |
msgid "Settings"
|
39 |
msgstr ""
|
40 |
|
41 |
-
#: taxonomy-images.php:
|
42 |
msgid "Taxonomies"
|
43 |
msgstr ""
|
44 |
|
45 |
-
|
46 |
-
#. Plugin Name of the plugin/theme
|
47 |
-
#: taxonomy-images.php:349 taxonomy-images.php:350
|
48 |
msgid "Taxonomy Images"
|
49 |
msgstr ""
|
50 |
|
51 |
-
|
52 |
-
#: taxonomy-images.php:377
|
53 |
msgid "Taxonomy Images Plugin Settings"
|
54 |
msgstr ""
|
55 |
|
56 |
-
|
57 |
-
#: taxonomy-images.php:385
|
58 |
msgid "Save Changes"
|
59 |
msgstr ""
|
60 |
|
61 |
-
|
62 |
-
#: taxonomy-images.php:432
|
63 |
msgid "Unknown error encountered"
|
64 |
msgstr ""
|
65 |
|
66 |
-
#: taxonomy-images.php:
|
67 |
msgid "tt_id not sent"
|
68 |
msgstr ""
|
69 |
|
70 |
-
#: taxonomy-images.php:
|
71 |
msgid "tt_id is empty"
|
72 |
msgstr ""
|
73 |
|
74 |
-
#: taxonomy-images.php:
|
75 |
msgid "You do not have the correct capability to manage this term"
|
76 |
msgstr ""
|
77 |
|
78 |
-
#: taxonomy-images.php:
|
79 |
msgid "No nonce included."
|
80 |
msgstr ""
|
81 |
|
82 |
-
#: taxonomy-images.php:
|
83 |
msgid "Nonce did not match"
|
84 |
msgstr ""
|
85 |
|
86 |
-
#: taxonomy-images.php:
|
87 |
msgid "Image id not sent"
|
88 |
msgstr ""
|
89 |
|
90 |
-
#: taxonomy-images.php:
|
91 |
msgid "Image id is not a positive integer"
|
92 |
msgstr ""
|
93 |
|
94 |
-
#: taxonomy-images.php:
|
95 |
msgid "Image successfully associated"
|
96 |
msgstr ""
|
97 |
|
98 |
-
#: taxonomy-images.php:
|
99 |
msgid "Association could not be created"
|
100 |
msgstr ""
|
101 |
|
102 |
-
#: taxonomy-images.php:
|
103 |
msgid "No nonce included"
|
104 |
msgstr ""
|
105 |
|
106 |
-
#: taxonomy-images.php:
|
107 |
msgid "Nothing to remove"
|
108 |
msgstr ""
|
109 |
|
110 |
-
#: taxonomy-images.php:
|
111 |
msgid "Association successfully removed"
|
112 |
msgstr ""
|
113 |
|
114 |
-
#: taxonomy-images.php:
|
115 |
msgid "Association could not be removed"
|
116 |
msgstr ""
|
117 |
|
118 |
-
#: taxonomy-images.php:
|
119 |
msgid "Image"
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: taxonomy-images.php:
|
123 |
msgid "term"
|
124 |
msgstr ""
|
125 |
|
126 |
-
#: taxonomy-images.php:
|
|
|
127 |
msgid "Associate an image from your media library to this %1$s."
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: taxonomy-images.php:
|
|
|
131 |
msgid "Associate an image with the %1$s named “%2$s”."
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: taxonomy-images.php:
|
|
|
135 |
msgid "Upload a new image for this %s."
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: taxonomy-images.php:
|
139 |
msgid "Upload."
|
140 |
msgstr ""
|
141 |
|
142 |
-
#: taxonomy-images.php:
|
|
|
143 |
msgid "Remove image from this %s."
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: taxonomy-images.php:
|
147 |
msgid "Delete"
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: taxonomy-images.php:
|
151 |
msgid "“"
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: taxonomy-images.php:
|
155 |
msgid "”"
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: taxonomy-images.php:
|
159 |
msgid "Associating …"
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: taxonomy-images.php:
|
163 |
msgid "Successfully Associated"
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: taxonomy-images.php:
|
167 |
msgid "Removing …"
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: taxonomy-images.php:
|
171 |
msgid "Successfully Removed"
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: taxonomy-images.php:
|
|
|
175 |
msgid ""
|
176 |
-
"The %1$s argument for %2$s is set to %3$s which is not a registered "
|
177 |
-
"
|
178 |
msgstr ""
|
179 |
|
180 |
-
#: taxonomy-images.php:
|
181 |
msgid "taxonomy"
|
182 |
msgstr ""
|
183 |
|
184 |
-
#: taxonomy-images.php:
|
|
|
185 |
msgid "No taxonomies have image support. %1$s"
|
186 |
msgstr ""
|
187 |
|
188 |
-
#: taxonomy-images.php:
|
|
|
189 |
msgid "The %1$s taxonomy does not have image support. %2$s"
|
190 |
msgstr ""
|
191 |
|
192 |
-
#: taxonomy-images.php:
|
|
|
193 |
msgid "The %1$s has been called directly. Please use the %2$s filter instead."
|
194 |
msgstr ""
|
195 |
|
196 |
-
#: taxonomy-images.php:
|
197 |
msgid "Donate"
|
198 |
msgstr ""
|
199 |
|
200 |
-
#: taxonomy-images.php:
|
201 |
msgid "Manage Settings"
|
202 |
msgstr ""
|
203 |
|
204 |
-
#:
|
205 |
-
msgid ""
|
206 |
-
"%1$s is not a property of the current queried object. This usually happens "
|
207 |
-
"when the %2$s filter is used in an unsupported template file. This filter "
|
208 |
-
"has been designed to work in taxonomy archives which are traditionally "
|
209 |
-
"served by one of the following template files: category.php, tag.php or "
|
210 |
-
"taxonomy.php. Learn more about %3$s."
|
211 |
-
msgstr ""
|
212 |
-
|
213 |
-
#: public-filters.php:377
|
214 |
-
msgid "term_taxonomy_id"
|
215 |
-
msgstr ""
|
216 |
-
|
217 |
-
#. Description of the plugin/theme
|
218 |
-
msgid ""
|
219 |
-
"Associate images from your media library to categories, tags and custom "
|
220 |
-
"taxonomies."
|
221 |
msgstr ""
|
1 |
# Copyright (C) 2011 Taxonomy Images
|
2 |
# This file is distributed under the same license as the Taxonomy Images package.
|
3 |
+
#, fuzzy
|
4 |
msgid ""
|
5 |
msgstr ""
|
6 |
+
"Project-Id-Version: Taxonomy Images\n"
|
7 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/taxonomy-images\n"
|
8 |
+
"POT-Creation-Date: 2015-10-08 20:03+0100\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
+
"Language-Team: LANGUAGE\n"
|
15 |
+
"X-Generator: Poedit 1.8.4\n"
|
16 |
+
"X-Poedit-KeywordsList: __;_e;esc_html__;esc_html_e;esc_attr__;esc_attr_e\n"
|
17 |
+
"X-Poedit-Basepath: ..\n"
|
18 |
+
"X-Poedit-SearchPath-0: .\n"
|
19 |
+
|
20 |
+
#: public-filters.php:385
|
21 |
+
#, php-format
|
22 |
+
msgid ""
|
23 |
+
"%1$s is not a property of the current queried object. This usually happens "
|
24 |
+
"when the %2$s filter is used in an unsupported template file. This filter has "
|
25 |
+
"been designed to work in taxonomy archives which are traditionally served by "
|
26 |
+
"one of the following template files: category.php, tag.php or taxonomy.php. "
|
27 |
+
"Learn more about %3$s."
|
28 |
+
msgstr ""
|
29 |
|
30 |
+
#: public-filters.php:386
|
31 |
+
msgid "term_taxonomy_id"
|
32 |
+
msgstr ""
|
33 |
+
|
34 |
+
#: taxonomy-images.php:126
|
35 |
+
#, php-format
|
36 |
msgid "Associate with %1$s"
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: taxonomy-images.php:126 taxonomy-images.php:128
|
40 |
msgid "this term"
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: taxonomy-images.php:128
|
44 |
+
#, php-format
|
45 |
msgid "Remove association with %1$s"
|
46 |
msgstr ""
|
47 |
|
48 |
+
#: taxonomy-images.php:277
|
|
|
49 |
msgid "Image support for taxonomies successfully updated"
|
50 |
msgstr ""
|
51 |
|
52 |
+
#: taxonomy-images.php:280
|
|
|
53 |
msgid "Image support has been disabled for all taxonomies."
|
54 |
msgstr ""
|
55 |
|
56 |
+
#: taxonomy-images.php:320 taxonomy-images.php:1167
|
57 |
msgid "Settings"
|
58 |
msgstr ""
|
59 |
|
60 |
+
#: taxonomy-images.php:326
|
61 |
msgid "Taxonomies"
|
62 |
msgstr ""
|
63 |
|
64 |
+
#: taxonomy-images.php:345 taxonomy-images.php:346
|
|
|
|
|
65 |
msgid "Taxonomy Images"
|
66 |
msgstr ""
|
67 |
|
68 |
+
#: taxonomy-images.php:373
|
|
|
69 |
msgid "Taxonomy Images Plugin Settings"
|
70 |
msgstr ""
|
71 |
|
72 |
+
#: taxonomy-images.php:381
|
|
|
73 |
msgid "Save Changes"
|
74 |
msgstr ""
|
75 |
|
76 |
+
#: taxonomy-images.php:429
|
|
|
77 |
msgid "Unknown error encountered"
|
78 |
msgstr ""
|
79 |
|
80 |
+
#: taxonomy-images.php:504 taxonomy-images.php:586
|
81 |
msgid "tt_id not sent"
|
82 |
msgstr ""
|
83 |
|
84 |
+
#: taxonomy-images.php:512 taxonomy-images.php:594
|
85 |
msgid "tt_id is empty"
|
86 |
msgstr ""
|
87 |
|
88 |
+
#: taxonomy-images.php:519 taxonomy-images.php:601
|
89 |
msgid "You do not have the correct capability to manage this term"
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: taxonomy-images.php:526
|
93 |
msgid "No nonce included."
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: taxonomy-images.php:533 taxonomy-images.php:615
|
97 |
msgid "Nonce did not match"
|
98 |
msgstr ""
|
99 |
|
100 |
+
#: taxonomy-images.php:540
|
101 |
msgid "Image id not sent"
|
102 |
msgstr ""
|
103 |
|
104 |
+
#: taxonomy-images.php:548
|
105 |
msgid "Image id is not a positive integer"
|
106 |
msgstr ""
|
107 |
|
108 |
+
#: taxonomy-images.php:557
|
109 |
msgid "Image successfully associated"
|
110 |
msgstr ""
|
111 |
|
112 |
+
#: taxonomy-images.php:564
|
113 |
msgid "Association could not be created"
|
114 |
msgstr ""
|
115 |
|
116 |
+
#: taxonomy-images.php:608
|
117 |
msgid "No nonce included"
|
118 |
msgstr ""
|
119 |
|
120 |
+
#: taxonomy-images.php:623
|
121 |
msgid "Nothing to remove"
|
122 |
msgstr ""
|
123 |
|
124 |
+
#: taxonomy-images.php:632
|
125 |
msgid "Association successfully removed"
|
126 |
msgstr ""
|
127 |
|
128 |
+
#: taxonomy-images.php:638
|
129 |
msgid "Association could not be removed"
|
130 |
msgstr ""
|
131 |
|
132 |
+
#: taxonomy-images.php:708 taxonomy-images.php:756
|
133 |
msgid "Image"
|
134 |
msgstr ""
|
135 |
|
136 |
+
#: taxonomy-images.php:751 taxonomy-images.php:785
|
137 |
msgid "term"
|
138 |
msgstr ""
|
139 |
|
140 |
+
#: taxonomy-images.php:760
|
141 |
+
#, php-format
|
142 |
msgid "Associate an image from your media library to this %1$s."
|
143 |
msgstr ""
|
144 |
|
145 |
+
#: taxonomy-images.php:805
|
146 |
+
#, php-format
|
147 |
msgid "Associate an image with the %1$s named “%2$s”."
|
148 |
msgstr ""
|
149 |
|
150 |
+
#: taxonomy-images.php:806
|
151 |
+
#, php-format
|
152 |
msgid "Upload a new image for this %s."
|
153 |
msgstr ""
|
154 |
|
155 |
+
#: taxonomy-images.php:806
|
156 |
msgid "Upload."
|
157 |
msgstr ""
|
158 |
|
159 |
+
#: taxonomy-images.php:807
|
160 |
+
#, php-format
|
161 |
msgid "Remove image from this %s."
|
162 |
msgstr ""
|
163 |
|
164 |
+
#: taxonomy-images.php:807
|
165 |
msgid "Delete"
|
166 |
msgstr ""
|
167 |
|
168 |
+
#: taxonomy-images.php:840
|
169 |
msgid "“"
|
170 |
msgstr ""
|
171 |
|
172 |
+
#: taxonomy-images.php:841
|
173 |
msgid "”"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: taxonomy-images.php:842
|
177 |
msgid "Associating …"
|
178 |
msgstr ""
|
179 |
|
180 |
+
#: taxonomy-images.php:843
|
181 |
msgid "Successfully Associated"
|
182 |
msgstr ""
|
183 |
|
184 |
+
#: taxonomy-images.php:844
|
185 |
msgid "Removing …"
|
186 |
msgstr ""
|
187 |
|
188 |
+
#: taxonomy-images.php:845
|
189 |
msgid "Successfully Removed"
|
190 |
msgstr ""
|
191 |
|
192 |
+
#: taxonomy-images.php:1097
|
193 |
+
#, php-format
|
194 |
msgid ""
|
195 |
+
"The %1$s argument for %2$s is set to %3$s which is not a registered taxonomy. "
|
196 |
+
"Please check the spelling and update the argument."
|
197 |
msgstr ""
|
198 |
|
199 |
+
#: taxonomy-images.php:1098
|
200 |
msgid "taxonomy"
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: taxonomy-images.php:1108
|
204 |
+
#, php-format
|
205 |
msgid "No taxonomies have image support. %1$s"
|
206 |
msgstr ""
|
207 |
|
208 |
+
#: taxonomy-images.php:1113
|
209 |
+
#, php-format
|
210 |
msgid "The %1$s taxonomy does not have image support. %2$s"
|
211 |
msgstr ""
|
212 |
|
213 |
+
#: taxonomy-images.php:1138
|
214 |
+
#, php-format
|
215 |
msgid "The %1$s has been called directly. Please use the %2$s filter instead."
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: taxonomy-images.php:1171
|
219 |
msgid "Donate"
|
220 |
msgstr ""
|
221 |
|
222 |
+
#: taxonomy-images.php:1189
|
223 |
msgid "Manage Settings"
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: taxonomy-images.php:1221 taxonomy-images.php:1222
|
227 |
+
msgid "Set featured image"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
msgstr ""
|
readme.md
CHANGED
@@ -1,198 +1,213 @@
|
|
1 |
Taxonomy Images
|
2 |
===============
|
3 |
|
4 |
-
A WordPress plugin that enables you to associate images from your media library
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
------------------------------------
|
9 |
|
10 |
There are a few filters that you can use in your theme to display the image associations created by this plugin. Please read below for detailed information.
|
11 |
|
12 |
-
|
13 |
Display a single image representing the term archive
|
14 |
----------------------------------------------------
|
15 |
|
16 |
-
The following filter will display the image associated with the term asked for in the query string of the url. This filter only works in views that naturally use templates like category.php, tag.php taxonomy.php and all of their derivatives. Please read about [template hierarchy](http://codex.wordpress.org/Template_Hierarchy) for more information about these templates. The simplest use of this filter looks like:
|
17 |
|
18 |
-
|
|
|
|
|
19 |
|
20 |
-
This code will generate and print an image tag. It's output can be modifed by
|
21 |
|
22 |
-
* __after__ (string) - Text to append to the image's HTML.
|
23 |
|
24 |
-
* __attr__ (array) - Key/value pairs representing the attributes of the img tag. Available options include: alt, class, src and title. This array will be passed as the fourth parameter to WordPress core function wp_get_attachment_image() without modification.
|
25 |
|
26 |
-
* __before__ (string) - Text to prepend to the image's HTML.
|
27 |
|
28 |
-
* __image_size__ (string) - May be any image size registered with WordPress. If no image size is specified, 'thumbnail' will be used as a default value. In the event that an unregistered size is specified, this filter will return an empty string.
|
29 |
|
30 |
Here's an example of what a fully customized version of this filter might look like:
|
31 |
|
32 |
-
print apply_filters( 'taxonomy-images-queried-term-image', '', array(
|
33 |
-
'after' => '</div>'
|
34 |
-
'attr' => array(
|
35 |
-
'alt' => 'Custom alternative text',
|
36 |
-
'class' => 'my-class-list bunnies turtles',
|
37 |
-
'src' => 'this-is-where-the-image-lives.png',
|
38 |
-
'title' => 'Custom Title',
|
39 |
-
),
|
40 |
-
'before' => '<div id="my-custom-div">',
|
41 |
-
'image_size' => 'medium',
|
42 |
-
) );
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
Similar functionality
|
46 |
---------------------
|
47 |
|
48 |
If you just need to get the database ID for the image, you may want to use:
|
49 |
|
50 |
-
|
|
|
|
|
51 |
|
52 |
If you need to get the full object of the image, you may want to use:
|
53 |
|
54 |
-
|
|
|
|
|
55 |
|
56 |
If you need to get the url to the image, you may want to use the following:
|
57 |
|
58 |
-
|
|
|
|
|
59 |
|
60 |
You can specify the size of the image in an option third parameter:
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
66 |
|
67 |
If you need data about the image, you may want to use:
|
68 |
|
69 |
-
|
|
|
|
|
70 |
|
71 |
You can specify the size of the image in an option third parameter:
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
77 |
|
78 |
List term images associated with a post object
|
79 |
----------------------------------------------
|
80 |
|
81 |
-
When a post is being displayed you may want to display
|
82 |
|
83 |
-
|
|
|
|
|
84 |
|
85 |
This filter accepts an optional third parameter that you can use to customize its output. It is an array which recognizes the following keys:
|
86 |
|
87 |
-
* __after__ (string) - Text to append to the output. Default value is a closing unordered list element.
|
88 |
|
89 |
-
* __after_image__ (string) - Text to append to each image. Default value is a closing list-item element.
|
90 |
|
91 |
-
* __before__ (string) - Text to prepend to the output. Default value is an open unordered list element with an class attribute of "taxonomy-images-the-terms".
|
92 |
|
93 |
-
* __before_image__ (string) - Text to prepend to each image. Default value is an open list-item element.
|
94 |
|
95 |
-
* __image_size__ (string) - Any registered image size. Values will vary from installation to installation. Image sizes defined in core include: "thumbnail", "medium" and "large". "
|
96 |
|
97 |
-
* __post_id__ (int) - The post to retrieve terms from. Defaults to the ID property of the global $post object.
|
98 |
|
99 |
-
* __taxonomy__ (string) - Name of a registered taxonomy to return terms from. Defaults to "category".
|
100 |
|
101 |
Here's an example of what a fully customized version of this filter might look like:
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
112 |
|
113 |
Working with all terms of a given taxonomy
|
114 |
------------------------------------------
|
115 |
|
116 |
You will want to use the 'taxonomy-images-get-terms' filter. This filter is basically a wrapper for WordPress core function [get_terms()](http://codex.wordpress.org/Function_Reference/get_terms). It will return an array of enhanced term objects: each term object will have a custom property named image_id which is an integer representing the database ID of the image associated with the term. This filter can be used to create custom lists of terms. Here's what it's default useage looks like:
|
117 |
|
118 |
-
|
|
|
|
|
119 |
|
120 |
Here is what php's print_r() function may return:
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
|
|
137 |
)
|
|
|
138 |
|
139 |
As you can see, all of the goodness of get_terms() is there with an added bonus: the image_id parameter!
|
140 |
|
141 |
This filter recognizes an optional third parameter which is an array of arguments that can be used to modify its output:
|
142 |
|
143 |
-
* __cache_images__ (bool) If this value is true all
|
144 |
-
|
145 |
-
* __having_images__ (bool) If this value is true then only terms that have associated images will be returned. Setting it to false will return all terms. Default value is true.
|
146 |
|
147 |
-
*
|
148 |
|
149 |
-
*
|
150 |
|
151 |
-
|
152 |
|
153 |
-
|
154 |
-
if ( ! empty( $terms ) ) {
|
155 |
-
print '<ul>';
|
156 |
-
foreach( (array) $terms as $term ) {
|
157 |
-
print '<li><a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id, 'detail' ) . '</li>';
|
158 |
-
}
|
159 |
-
print '</ul>';
|
160 |
-
}
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
Support
|
164 |
-------
|
165 |
|
166 |
If you have questions about integrating this plugin into your site, please [add a new thread to the WordPress Support Forum](http://wordpress.org/tags/taxonomy-images?forum_id=10#postform). I try to answer these, but I may not always be able to. In the event that I cannot there may be someone else who can help.
|
167 |
|
168 |
-
|
169 |
Bugs, Suggestions
|
170 |
-----------------
|
171 |
|
172 |
-
Development of this plugin is hosted in a public repository on [Github](https://github.com/
|
173 |
-
|
174 |
|
175 |
Hook it up yo!
|
176 |
-
|
177 |
|
178 |
If you have fallen in love with this plugin and would not be able to sleep without helping out in some way, please see the following list of ways that you can _hook it up!_:
|
179 |
|
180 |
-
* __Rate it!__ - Use the star tool on the right-hand sidebar of the [homepage](http://wordpress.org/extend/plugins/taxonomy-images/).
|
181 |
|
182 |
-
* __Let me know if it works__ - Use the _Compatibility_ widget on the [homepage](http://wordpress.org/extend/plugins/taxonomy-images/) to let everyone know that the current version works with your version of WordPress.
|
183 |
|
184 |
* __Do you Twitter?__ Help promote by using this shortlink: [http://bit.ly/taxonomy-images](http://bit.ly/taxonomy-images)
|
185 |
|
186 |
* __Are you a writer?__ Help promote by writing an article on your website about this plugin.
|
187 |
|
188 |
-
* __Are you Super-Wicked-Awesome?__ If so, you can always [make a donation](http://wordpress.mfields.org/donate/).
|
189 |
-
|
190 |
-
|
191 |
Need More Taxonomy Plugins?
|
192 |
---------------------------
|
193 |
|
194 |
-
|
195 |
-
|
196 |
|
197 |
Installation
|
198 |
------------
|
@@ -203,105 +218,114 @@ Installation
|
|
203 |
1. Activate the plugin.
|
204 |
1. Click the "Taxonomy Images" link under the Settings section in the admin menu. There you can select the taxonomies that you would like to add image support for.
|
205 |
|
|
|
|
|
206 |
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
__0.8.0__
|
211 |
-
|
212 |
-
* Pass an empty array as default second parameter of `taxonomy_images_plugin_get_the_terms()` and `taxonomy_images_plugin_list_the_terms()`.
|
213 |
-
* Use jQuery.on() instead of jQuery.live(). Props [jamiemchale](http://profiles.wordpress.org/jamiemchale).
|
214 |
-
* Give the button on the custom admin screen a class of `button-primary`.
|
215 |
-
* Store the return value of `get_posts()` in a variable called `$images`. Not sure why, but this should not harm anything.
|
216 |
-
* Change license to GPLv2 or later for maximum flexibility and compatibility.
|
217 |
-
* Add jamiemchale as a contributor.
|
218 |
-
* Random whitespace fixes.
|
219 |
-
* Update Documentation.
|
220 |
-
* CSS coding standards.
|
221 |
-
* Bump version number.
|
222 |
-
* Update Readmes.
|
223 |
-
|
224 |
-
__0.7.3__
|
225 |
-
|
226 |
-
* Fixed the delete image button on edit-terms.php.
|
227 |
-
* Better escaping.
|
228 |
-
* Introduced pot file and languages directory.
|
229 |
-
|
230 |
-
__0.7.2__
|
231 |
-
|
232 |
-
* Return data for fulsize images in archive views. [See this thread](http://wordpress.org/support/topic/image-size-full).
|
233 |
-
|
234 |
-
__0.7.1__
|
235 |
-
|
236 |
-
* Remove unused link code which is throwing an error when no taxonomies support images.
|
237 |
|
238 |
-
|
|
|
239 |
|
240 |
-
|
241 |
-
|
242 |
-
* Lots of inline documentation added.
|
243 |
-
* Added custom notices if plugin is used in an unsupported way.
|
244 |
-
* No notices generated by PHP or WordPress.
|
245 |
-
* Deprecated function calls removed.
|
246 |
-
* Security updates.
|
247 |
-
* All strings are now internationalized.
|
248 |
-
* Add image to term functionality mimics "Add Featured Image".
|
249 |
-
* Taxonomy modal button now available in search + upload states.
|
250 |
-
* Image interface has been added to single term edit screen.
|
251 |
-
* Users can now choose which taxonomys have image support.
|
252 |
-
* All functions are now private.
|
253 |
-
* Shortcode deprecated.
|
254 |
-
* All global variables and constants have been removed or deprecated.
|
255 |
|
256 |
-
|
|
|
257 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
* Never released.
|
259 |
-
* Completely recoded.
|
260 |
-
|
261 |
-
__0.5__
|
262 |
|
|
|
263 |
* __UPDATE:__ Direct link to upload new files from edit-tag.php has been introduced.
|
264 |
* __UPDATE:__ Ability to create an image/term association immediately after upload has been introduced.
|
265 |
* __UPDATE:__ Users can now delete image/term associations.
|
266 |
* __UPDATE:__ Created standalone javascript files - removed inline scripts.
|
267 |
-
* __UPDATE:__
|
268 |
* __UPDATE:__ Localization for strings - still need to "fine-tooth-comb" this.
|
269 |
* __UPDATE:__ Removed all debug functions.
|
270 |
|
271 |
-
|
272 |
-
|
273 |
* __BUGFIX:__ get_image_html() Now populates the image's alt attribute with appropriate data. Props to [jaygoldman](http://wordpress.org/support/profile/jaygoldman).
|
274 |
|
275 |
-
|
276 |
-
|
277 |
-
* __UPDATE:__ Support for WordPress 3.0 has been added. Support for all beta versions of 3.0 has been dropped.
|
278 |
* __COMPAT:__ Removed use of deprecated function is_taxonomy() - props to [anointed](http://profiles.wordpress.org/users/anointed).
|
279 |
* __COMPAT:__ Included a definition for taxonomy_exists() function for backwards compatibility with 2.9 branch. This function is new in WordPress version 3.0.
|
|
|
280 |
|
281 |
-
|
282 |
-
|
283 |
* __UPDATE:__ Changed button name from "Category" to "Taxonomy".
|
284 |
* __UPDATE:__ Support for 2.9 branch has been added again.
|
285 |
|
286 |
-
|
287 |
-
|
288 |
-
* __UPDATE:__ Added support for dynamic taxonomy hooks for _tag_row()
|
289 |
* __BROKEN:__ Support for 2.9 branch has been temporarily removed.
|
290 |
|
291 |
-
|
292 |
-
|
293 |
* __BUGFIX:__ get_thumb() now returns the fullsize url if there is no appropriate intermediate image.
|
294 |
* __UPDATE:__ Added "taxonomy_images_shortcode".
|
295 |
|
296 |
-
|
297 |
-
|
298 |
* __COMPAT:__ Changed the firing order of every hook untilizing the 'category_rows' method to 15. This allows this plugin to be compatible with [Reveal IDs for WP Admin](http://wordpress.org/extend/plugins/reveal-ids-for-wp-admin-25/). Thanks to [Peter Kahoun](http://profiles.wordpress.org/kahi/)
|
299 |
* __COMPAT:__ Added Version check for PHP5.
|
300 |
* __UPDATE:__ `$settings` and `$locale` are now public properties.
|
301 |
-
* __UPDATE:__ Object name changed to
|
302 |
* __UPDATE:__ Added argument $term_tax_id to both print_image_html() and get_image_html().
|
303 |
-
* __BUGFIX:__ Deleted the register_deactivation_hook() function -> sorry to all 8 who downloaded this plugin so far :)
|
304 |
-
|
305 |
-
__0.2__
|
306 |
|
307 |
-
|
|
1 |
Taxonomy Images
|
2 |
===============
|
3 |
|
4 |
+
A WordPress plugin that enables you to associate images from your media library with categories, tags and custom taxonomies.
|
5 |
|
6 |
+
Displaying Images in Your Theme
|
7 |
+
-------------------------------
|
|
|
8 |
|
9 |
There are a few filters that you can use in your theme to display the image associations created by this plugin. Please read below for detailed information.
|
10 |
|
|
|
11 |
Display a single image representing the term archive
|
12 |
----------------------------------------------------
|
13 |
|
14 |
+
The following filter will display the image associated with the term asked for in the query string of the url. This filter only works in views that naturally use templates like category.php, tag.php, taxonomy.php and all of their derivatives. Please read about [template hierarchy](http://codex.wordpress.org/Template_Hierarchy) for more information about these templates. The simplest use of this filter looks like:
|
15 |
|
16 |
+
```php
|
17 |
+
print apply_filters( 'taxonomy-images-queried-term-image', '' );
|
18 |
+
```
|
19 |
|
20 |
+
This code will generate and print an image tag. It's output can be modifed by passing an optional third parameter to apply_filters(). This parameter is an array and the following keys may be set:
|
21 |
|
22 |
+
* __after__ _(string)_ - Text to append to the image's HTML.
|
23 |
|
24 |
+
* __attr__ _(array)_ - Key/value pairs representing the attributes of the img tag. Available options include: alt, class, src and title. This array will be passed as the fourth parameter to WordPress core function wp_get_attachment_image() without modification.
|
25 |
|
26 |
+
* __before__ _(string)_ - Text to prepend to the image's HTML.
|
27 |
|
28 |
+
* __image_size__ _(string)_ - May be any image size registered with WordPress. If no image size is specified, 'thumbnail' will be used as a default value. In the event that an unregistered size is specified, this filter will return an empty string.
|
29 |
|
30 |
Here's an example of what a fully customized version of this filter might look like:
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
+
```php
|
34 |
+
print apply_filters( 'taxonomy-images-queried-term-image', '', array(
|
35 |
+
'attr' => array(
|
36 |
+
'alt' => 'Custom alternative text',
|
37 |
+
'class' => 'my-class-list bunnies turtles',
|
38 |
+
'src' => 'this-is-where-the-image-lives.png',
|
39 |
+
'title' => 'Custom Title',
|
40 |
+
),
|
41 |
+
'before' => '<div id="my-custom-div">',
|
42 |
+
'after' => '</div>',
|
43 |
+
'image_size' => 'medium'
|
44 |
+
) );
|
45 |
+
```
|
46 |
|
47 |
Similar functionality
|
48 |
---------------------
|
49 |
|
50 |
If you just need to get the database ID for the image, you may want to use:
|
51 |
|
52 |
+
```php
|
53 |
+
$image_id = apply_filters( 'taxonomy-images-queried-term-image-id', 0 );
|
54 |
+
```
|
55 |
|
56 |
If you need to get the full object of the image, you may want to use:
|
57 |
|
58 |
+
```php
|
59 |
+
$image = apply_filters( 'taxonomy-images-queried-term-image-object', '' );
|
60 |
+
```
|
61 |
|
62 |
If you need to get the url to the image, you may want to use the following:
|
63 |
|
64 |
+
```php
|
65 |
+
$image_url = apply_filters( 'taxonomy-images-queried-term-image-url', '' );
|
66 |
+
```
|
67 |
|
68 |
You can specify the size of the image in an option third parameter:
|
69 |
|
70 |
+
```php
|
71 |
+
$image_url = apply_filters( 'taxonomy-images-queried-term-image-url', '', array(
|
72 |
+
'image_size' => 'medium'
|
73 |
+
) );
|
74 |
+
```
|
75 |
|
76 |
If you need data about the image, you may want to use:
|
77 |
|
78 |
+
```php
|
79 |
+
$image_data = apply_filters( 'taxonomy-images-queried-term-image-data', '' );
|
80 |
+
```
|
81 |
|
82 |
You can specify the size of the image in an option third parameter:
|
83 |
|
84 |
+
```php
|
85 |
+
$image_data = apply_filters( 'taxonomy-images-queried-term-image-data', '', array(
|
86 |
+
'image_size' => 'medium'
|
87 |
+
) );
|
88 |
+
```
|
89 |
|
90 |
List term images associated with a post object
|
91 |
----------------------------------------------
|
92 |
|
93 |
+
When a post is being displayed you may want to display the images associated with all of the terms associated with the post. The `taxonomy-images-list-the-terms` filter does this. Here's what it looks like in its simplest form:
|
94 |
|
95 |
+
```php
|
96 |
+
print apply_filters( 'taxonomy-images-list-the-terms', '' );
|
97 |
+
```
|
98 |
|
99 |
This filter accepts an optional third parameter that you can use to customize its output. It is an array which recognizes the following keys:
|
100 |
|
101 |
+
* __after__ _(string)_ - Text to append to the output. Default value is a closing unordered list element.
|
102 |
|
103 |
+
* __after_image__ _(string)_ - Text to append to each image. Default value is a closing list-item element.
|
104 |
|
105 |
+
* __before__ _(string)_ - Text to prepend to the output. Default value is an open unordered list element with an class attribute of "taxonomy-images-the-terms".
|
106 |
|
107 |
+
* __before_image__ _(string)_ - Text to prepend to each image. Default value is an open list-item element.
|
108 |
|
109 |
+
* __image_size__ _(string)_ - Any registered image size. Values will vary from installation to installation. Image sizes defined in core include: "thumbnail", "medium" and "large". "full" may also be used to get the unmodified image that was uploaded. Defaults to "thumbnail".
|
110 |
|
111 |
+
* __post_id__ _(int)_ - The post to retrieve terms from. Defaults to the ID property of the global $post object.
|
112 |
|
113 |
+
* __taxonomy__ _(string)_ - Name of a registered taxonomy to return terms from. Defaults to "category".
|
114 |
|
115 |
Here's an example of what a fully customized version of this filter might look like:
|
116 |
|
117 |
+
```php
|
118 |
+
print apply_filters( 'taxonomy-images-list-the-terms', '', array(
|
119 |
+
'before' => '<div class="my-custom-class-name">',
|
120 |
+
'after' => '</div>',
|
121 |
+
'before_image' => '<span>',
|
122 |
+
'after_image' => '</span>',
|
123 |
+
'image_size' => 'detail',
|
124 |
+
'post_id' => 1234,
|
125 |
+
'taxonomy' => 'post_tag',
|
126 |
+
) );
|
127 |
+
```
|
128 |
|
129 |
Working with all terms of a given taxonomy
|
130 |
------------------------------------------
|
131 |
|
132 |
You will want to use the 'taxonomy-images-get-terms' filter. This filter is basically a wrapper for WordPress core function [get_terms()](http://codex.wordpress.org/Function_Reference/get_terms). It will return an array of enhanced term objects: each term object will have a custom property named image_id which is an integer representing the database ID of the image associated with the term. This filter can be used to create custom lists of terms. Here's what it's default useage looks like:
|
133 |
|
134 |
+
```php
|
135 |
+
$terms = apply_filters( 'taxonomy-images-get-terms', '' );
|
136 |
+
```
|
137 |
|
138 |
Here is what php's print_r() function may return:
|
139 |
|
140 |
+
```
|
141 |
+
Array
|
142 |
+
(
|
143 |
+
[0] => stdClass Object
|
144 |
+
(
|
145 |
+
[term_id] => 8
|
146 |
+
[name] => Pirate
|
147 |
+
[slug] => pirate
|
148 |
+
[term_group] => 0
|
149 |
+
[term_taxonomy_id] => 8
|
150 |
+
[taxonomy] => category
|
151 |
+
[description] => Pirates live in the ocean and ride around on boats.
|
152 |
+
[parent] => 0
|
153 |
+
[count] => 1
|
154 |
+
[image_id] => 44
|
155 |
+
)
|
156 |
)
|
157 |
+
```
|
158 |
|
159 |
As you can see, all of the goodness of get_terms() is there with an added bonus: the image_id parameter!
|
160 |
|
161 |
This filter recognizes an optional third parameter which is an array of arguments that can be used to modify its output:
|
162 |
|
163 |
+
* __cache_images__ _(bool)_ If this value is true all associated images will be queried and cached for later use in various template tags. If it is set to false, this query will be suppressed. Do not set this value to false unless you have a really good reason for doing so :) Default value is true.
|
|
|
|
|
164 |
|
165 |
+
* __having_images__ _(bool)_ If this value is true then only terms that have associated images will be returned. Setting it to false will return all terms. Default value is true.
|
166 |
|
167 |
+
* __taxonomy__ _(string)_ Name of a registered taxonomy to return terms from. Multiple taxonomies may be specified by separating each name by a comma. Defaults to "category".
|
168 |
|
169 |
+
* __term_args__ _(array)_ Arguments to pass to [get_terms()](http://codex.wordpress.org/Function_Reference/get_terms) as the second parameter. Default value is an empty array.
|
170 |
|
171 |
+
Here's an example of a simple custom loop that you can use to display all term images:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
|
173 |
+
```php
|
174 |
+
$terms = apply_filters( 'taxonomy-images-get-terms', '' );
|
175 |
+
if ( ! empty( $terms ) ) {
|
176 |
+
print '<ul>';
|
177 |
+
foreach ( (array) $terms as $term ) {
|
178 |
+
print '<li><a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id, 'detail' ) . '</li>';
|
179 |
+
}
|
180 |
+
print '</ul>';
|
181 |
+
}
|
182 |
+
```
|
183 |
|
184 |
Support
|
185 |
-------
|
186 |
|
187 |
If you have questions about integrating this plugin into your site, please [add a new thread to the WordPress Support Forum](http://wordpress.org/tags/taxonomy-images?forum_id=10#postform). I try to answer these, but I may not always be able to. In the event that I cannot there may be someone else who can help.
|
188 |
|
|
|
189 |
Bugs, Suggestions
|
190 |
-----------------
|
191 |
|
192 |
+
Development of this plugin is hosted in a public repository on [Github](https://github.com/benhuson/Taxonomy-Images). If you find a bug in this plugin or have a suggestion to make it better, please [create a new issue](https://github.com/benhuson/Taxonomy-Images/issues/new)
|
|
|
193 |
|
194 |
Hook it up yo!
|
195 |
+
---------------
|
196 |
|
197 |
If you have fallen in love with this plugin and would not be able to sleep without helping out in some way, please see the following list of ways that you can _hook it up!_:
|
198 |
|
199 |
+
* __Rate it!__ - Use the star tool on the right-hand sidebar of the [plugin homepage](http://wordpress.org/extend/plugins/taxonomy-images/).
|
200 |
|
201 |
+
* __Let me know if it works__ - Use the _Compatibility_ widget on the [plugin homepage](http://wordpress.org/extend/plugins/taxonomy-images/) to let everyone know that the current version works with your version of WordPress.
|
202 |
|
203 |
* __Do you Twitter?__ Help promote by using this shortlink: [http://bit.ly/taxonomy-images](http://bit.ly/taxonomy-images)
|
204 |
|
205 |
* __Are you a writer?__ Help promote by writing an article on your website about this plugin.
|
206 |
|
|
|
|
|
|
|
207 |
Need More Taxonomy Plugins?
|
208 |
---------------------------
|
209 |
|
210 |
+
The original author of this plugin, Michael Fields, released a handful of plugins dealing with taxonomies. Please see his [plugin page](http://wordpress.org/extend/plugins/profile/mfields) for more information.
|
|
|
211 |
|
212 |
Installation
|
213 |
------------
|
218 |
1. Activate the plugin.
|
219 |
1. Click the "Taxonomy Images" link under the Settings section in the admin menu. There you can select the taxonomies that you would like to add image support for.
|
220 |
|
221 |
+
Upgrade Notice
|
222 |
+
--------------
|
223 |
|
224 |
+
### 0.9
|
225 |
+
Fixes media modal for newer versions of WordPress. Tested up to WordPress 4.3.1 (requires 3.4+).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
|
227 |
+
### 0.8
|
228 |
+
Major and minor bug fixes tested with WordPress 3.6.
|
229 |
|
230 |
+
### 0.7
|
231 |
+
Complete rewrite. Better everything. Many bug fixes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
|
233 |
+
Changelog
|
234 |
+
---------
|
235 |
|
236 |
+
### 0.9
|
237 |
+
* __COMPAT:__ Add support for WordPress 3.5+ media modal.
|
238 |
+
* __COMPAT:__ Confirmed minimum WordPress 3.4 required.
|
239 |
+
* __UPDATE:__ Add Spanish translation.
|
240 |
+
* __UPDATE:__ Make images retina sized in the admin.
|
241 |
+
* __UPDATE:__ Re-color admin image and icons to fit with more recent versions of WordPress.
|
242 |
+
* __UPDATE:__ Stop using deprecated image_resize() function.
|
243 |
+
* __UPDATE:__ Stop using deprecated screen_icon() function.
|
244 |
+
* __UPDATE:__ Move JavaScript and CSS files to subfolders.
|
245 |
+
* __UPDATE:__ Added screenshots for WordPress.org
|
246 |
+
* __UPDATE:__ Add husobj as a contributor.
|
247 |
+
|
248 |
+
### 0.8.0
|
249 |
+
* __COMPAT:__ Use jQuery.on() instead of jQuery.live(). Props [jamiemchale](http://profiles.wordpress.org/jamiemchale).
|
250 |
+
* __UPDATE:__ Pass an empty array as default second parameter of `taxonomy_images_plugin_get_the_terms()` and `taxonomy_images_plugin_list_the_terms()`.
|
251 |
+
* __UPDATE:__ Give the button on the custom admin screen a class of `button-primary`.
|
252 |
+
* __UPDATE:__ Store the return value of `get_posts()` in a variable called `$images`. Not sure why, but this should not harm anything.
|
253 |
+
* __UPDATE:__ Change license to GPLv2 or later for maximum flexibility and compatibility.
|
254 |
+
* __UPDATE:__ Random whitespace fixes.
|
255 |
+
* __UPDATE:__ Update Documentation.
|
256 |
+
* __UPDATE:__ CSS coding standards.
|
257 |
+
* __UPDATE:__ Bump version number.
|
258 |
+
* __UPDATE:__ Update readme files.
|
259 |
+
* __UPDATE:__ Add jamiemchale as a contributor.
|
260 |
+
|
261 |
+
### 0.7.3
|
262 |
+
* __BUGFIX:__ Fixed the delete image button on edit-terms.php.
|
263 |
+
* __UPDATE:__ Better escaping.
|
264 |
+
* __UPDATE:__ Introduced pot file and languages directory.
|
265 |
+
|
266 |
+
### 0.7.2
|
267 |
+
* __UPDATE:__ Return data for fullsize images in archive views. [See this thread](http://wordpress.org/support/topic/image-size-full).
|
268 |
+
|
269 |
+
### 0.7.1
|
270 |
+
* __BUGFIX:__ Remove unused link code which is throwing an error when no taxonomies support images.
|
271 |
+
|
272 |
+
### 0.7
|
273 |
+
* __COMPAT:__ No longer breaks display of the [Better Plugin Compatibility Control](http://wordpress.org/extend/plugins/better-plugin-compatibility-control/) plugin.
|
274 |
+
* __UPDATE:__ Created a custom filter interface for plugin and theme integration.
|
275 |
+
* __UPDATE:__ Lots of inline documentation added.
|
276 |
+
* __UPDATE:__ Added custom notices if plugin is used in an unsupported way.
|
277 |
+
* __UPDATE:__ No notices generated by PHP or WordPress.
|
278 |
+
* __UPDATE:__ Deprecated function calls removed.
|
279 |
+
* __UPDATE:__ Security updates.
|
280 |
+
* __UPDATE:__ All strings are now internationalized.
|
281 |
+
* __UPDATE:__ Add image to term functionality mimics "Add Featured Image".
|
282 |
+
* __UPDATE:__ Taxonomy modal button now available in search + upload states.
|
283 |
+
* __UPDATE:__ Image interface has been added to single term edit screen.
|
284 |
+
* __UPDATE:__ Users can now choose which taxonomys have image support.
|
285 |
+
* __UPDATE:__ All functions are now private.
|
286 |
+
* __UPDATE:__ Shortcode deprecated.
|
287 |
+
* __UPDATE:__ All global variables and constants have been removed or deprecated.
|
288 |
+
|
289 |
+
### 0.6
|
290 |
+
* __UPDATE:__ Completely recoded.
|
291 |
* Never released.
|
|
|
|
|
|
|
292 |
|
293 |
+
### 0.5
|
294 |
* __UPDATE:__ Direct link to upload new files from edit-tag.php has been introduced.
|
295 |
* __UPDATE:__ Ability to create an image/term association immediately after upload has been introduced.
|
296 |
* __UPDATE:__ Users can now delete image/term associations.
|
297 |
* __UPDATE:__ Created standalone javascript files - removed inline scripts.
|
298 |
+
* __UPDATE:__ Obsessive compulsive syntax modifications.
|
299 |
* __UPDATE:__ Localization for strings - still need to "fine-tooth-comb" this.
|
300 |
* __UPDATE:__ Removed all debug functions.
|
301 |
|
302 |
+
### 0.4.4
|
|
|
303 |
* __BUGFIX:__ get_image_html() Now populates the image's alt attribute with appropriate data. Props to [jaygoldman](http://wordpress.org/support/profile/jaygoldman).
|
304 |
|
305 |
+
### 0.4.3
|
|
|
|
|
306 |
* __COMPAT:__ Removed use of deprecated function is_taxonomy() - props to [anointed](http://profiles.wordpress.org/users/anointed).
|
307 |
* __COMPAT:__ Included a definition for taxonomy_exists() function for backwards compatibility with 2.9 branch. This function is new in WordPress version 3.0.
|
308 |
+
* __UPDATE:__ Support for WordPress 3.0 has been added. Support for all beta versions of 3.0 has been dropped.
|
309 |
|
310 |
+
### 0.4.2
|
|
|
311 |
* __UPDATE:__ Changed button name from "Category" to "Taxonomy".
|
312 |
* __UPDATE:__ Support for 2.9 branch has been added again.
|
313 |
|
314 |
+
### 0.4.1
|
315 |
+
* __UPDATE:__ Added support for dynamic taxonomy hooks for _tag_row().
|
|
|
316 |
* __BROKEN:__ Support for 2.9 branch has been temporarily removed.
|
317 |
|
318 |
+
### 0.4
|
|
|
319 |
* __BUGFIX:__ get_thumb() now returns the fullsize url if there is no appropriate intermediate image.
|
320 |
* __UPDATE:__ Added "taxonomy_images_shortcode".
|
321 |
|
322 |
+
### 0.3
|
323 |
+
* __BUGFIX:__ Deleted the register_deactivation_hook() function - sorry to all 8 who downloaded this plugin so far :)
|
324 |
* __COMPAT:__ Changed the firing order of every hook untilizing the 'category_rows' method to 15. This allows this plugin to be compatible with [Reveal IDs for WP Admin](http://wordpress.org/extend/plugins/reveal-ids-for-wp-admin-25/). Thanks to [Peter Kahoun](http://profiles.wordpress.org/kahi/)
|
325 |
* __COMPAT:__ Added Version check for PHP5.
|
326 |
* __UPDATE:__ `$settings` and `$locale` are now public properties.
|
327 |
+
* __UPDATE:__ Object name changed to $taxonomy_images_plugin.
|
328 |
* __UPDATE:__ Added argument $term_tax_id to both print_image_html() and get_image_html().
|
|
|
|
|
|
|
329 |
|
330 |
+
### 0.2
|
331 |
+
* Original Release - Works with WordPress 2.9.1.
|
readme.txt
CHANGED
@@ -1,17 +1,15 @@
|
|
1 |
-
===Taxonomy Images===
|
2 |
|
3 |
-
Contributors: mfields, jamiemchale
|
4 |
-
Donate link: http://wordpress.mfields.org/donate/
|
5 |
Tags: taxonomy, tag, category, image, upload, media
|
6 |
-
Requires at least: 3.
|
7 |
-
Tested up to: 3.
|
8 |
-
Stable tag:
|
|
|
9 |
|
10 |
Associate images from your media library to categories, tags and custom taxonomies.
|
11 |
|
12 |
-
==Description==
|
13 |
-
|
14 |
-
For usage instructions please view the [screencast](http://screenr.com/zMx).
|
15 |
|
16 |
= Displaying Your Images in Your Theme =
|
17 |
|
@@ -19,33 +17,33 @@ There are a few filters that you can use in your theme to display the image asso
|
|
19 |
|
20 |
= Display a single image representing the term archive =
|
21 |
|
22 |
-
The following filter will display the image associated with the term asked for in the query string of the url. This filter only works in views that naturally use templates like category.php, tag.php taxonomy.php and all of their derivatives. Please read about [template hierarchy](http://codex.wordpress.org/Template_Hierarchy) for more information about these templates. The simplest use of this filter looks like:
|
23 |
|
24 |
`print apply_filters( 'taxonomy-images-queried-term-image', '' );`
|
25 |
|
26 |
-
This code will generate and print an image tag. It's output can be modifed by
|
27 |
|
28 |
-
* __after__ (string) - Text to append to the image's HTML.
|
29 |
|
30 |
-
* __attr__ (array) - Key/value pairs representing the attributes of the img tag. Available options include: alt, class, src and title. This array will be passed as the fourth parameter to WordPress core function wp_get_attachment_image() without modification.
|
31 |
|
32 |
-
* __before__ (string) - Text to prepend to the image's HTML.
|
33 |
|
34 |
-
* __image_size__ (string) - May be any image size registered with WordPress. If no image size is specified, 'thumbnail' will be used as a default value. In the event that an unregistered size is specified, this filter will return an empty string.
|
35 |
|
36 |
Here's an example of what a fully customized version of this filter might look like:
|
37 |
|
38 |
`print apply_filters( 'taxonomy-images-queried-term-image', '', array(
|
39 |
-
'
|
40 |
-
'attr' => array(
|
41 |
'alt' => 'Custom alternative text',
|
42 |
'class' => 'my-class-list bunnies turtles',
|
43 |
'src' => 'this-is-where-the-image-lives.png',
|
44 |
'title' => 'Custom Title',
|
45 |
),
|
46 |
-
'before'
|
47 |
-
'
|
48 |
-
|
|
|
49 |
`
|
50 |
|
51 |
= Similar functionality =
|
@@ -67,7 +65,7 @@ You can specify the size of the image in an option third parameter:
|
|
67 |
`
|
68 |
$image_url = apply_filters( 'taxonomy-images-queried-term-image-url', '', array(
|
69 |
'image_size' => 'medium'
|
70 |
-
|
71 |
`
|
72 |
|
73 |
If you need data about the image, you may want to use:
|
@@ -84,38 +82,38 @@ $image_data = apply_filters( 'taxonomy-images-queried-term-image-data', '', arra
|
|
84 |
|
85 |
= List term images associated with a post object =
|
86 |
|
87 |
-
When a post is being displayed you may want to display
|
88 |
|
89 |
`print apply_filters( 'taxonomy-images-list-the-terms', '' );`
|
90 |
|
91 |
This filter accepts an optional third parameter that you can use to customize its output. It is an array which recognizes the following keys:
|
92 |
|
93 |
-
* __after__ (string) - Text to append to the output. Default value is a closing unordered list element.
|
94 |
|
95 |
-
* __after_image__ (string) - Text to append to each image. Default value is a closing list-item element.
|
96 |
|
97 |
-
* __before__ (string) - Text to prepend to the output. Default value is an open unordered list element with an class attribute of "taxonomy-images-the-terms".
|
98 |
|
99 |
-
* __before_image__ (string) - Text to prepend to each image. Default value is an open list-item element.
|
100 |
|
101 |
-
* __image_size__ (string) - Any registered image size. Values will vary from installation to installation. Image sizes defined in core include: "thumbnail", "medium" and "large". "
|
102 |
|
103 |
-
* __post_id__ (int) - The post to retrieve terms from. Defaults to the ID property of the global $post object.
|
104 |
|
105 |
-
* __taxonomy__ (string) - Name of a registered taxonomy to return terms from. Defaults to "category".
|
106 |
|
107 |
Here's an example of what a fully customized version of this filter might look like:
|
108 |
|
109 |
`
|
110 |
print apply_filters( 'taxonomy-images-list-the-terms', '', array(
|
111 |
-
'after' => '</div>',
|
112 |
-
'after_image' => '</span>',
|
113 |
'before' => '<div class="my-custom-class-name">',
|
|
|
114 |
'before_image' => '<span>',
|
|
|
115 |
'image_size' => 'detail',
|
116 |
'post_id' => 1234,
|
117 |
'taxonomy' => 'post_tag',
|
118 |
-
|
119 |
`
|
120 |
|
121 |
= Working with all terms of a given taxonomy =
|
@@ -129,19 +127,19 @@ Here is what php's print_r() function may return:
|
|
129 |
`
|
130 |
Array
|
131 |
(
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
)
|
146 |
`
|
147 |
|
@@ -149,21 +147,21 @@ As you can see, all of the goodness of get_terms() is there with an added bonus:
|
|
149 |
|
150 |
This filter recognizes an optional third parameter which is an array of arguments that can be used to modify its output:
|
151 |
|
152 |
-
* __cache_images__ (bool) If this value is true all
|
153 |
|
154 |
-
* __having_images__ (bool) If this value is true then only terms that have associated images will be returned. Setting it to false will return all terms. Default value is true.
|
155 |
|
156 |
-
* __taxonomy__ (string) Name of a registered taxonomy to return terms from. Multiple taxonomies may be specified by separating each name by a comma. Defaults to "category".
|
157 |
|
158 |
-
* __term_args__ (array) Arguments to pass to [get_terms()](http://codex.wordpress.org/Function_Reference/get_terms) as the second parameter. Default value is an empty array.
|
159 |
|
160 |
-
Here's
|
161 |
|
162 |
`
|
163 |
$terms = apply_filters( 'taxonomy-images-get-terms', '' );
|
164 |
if ( ! empty( $terms ) ) {
|
165 |
print '<ul>';
|
166 |
-
foreach( (array) $terms as $term ) {
|
167 |
print '<li><a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id, 'detail' ) . '</li>';
|
168 |
}
|
169 |
print '</ul>';
|
@@ -176,26 +174,25 @@ If you have questions about integrating this plugin into your site, please [add
|
|
176 |
|
177 |
= Bugs, Suggestions =
|
178 |
|
179 |
-
Development of this plugin is hosted in a public repository on [Github](https://github.com/
|
180 |
|
181 |
= Hook it up yo! =
|
182 |
|
183 |
If you have fallen in love with this plugin and would not be able to sleep without helping out in some way, please see the following list of ways that you can _hook it up!_:
|
184 |
|
185 |
-
* __Rate it!__ - Use the star tool on the right-hand sidebar of the [homepage](http://wordpress.org/extend/plugins/taxonomy-images/).
|
186 |
|
187 |
-
* __Let me know if it works__ - Use the _Compatibility_ widget on the [homepage](http://wordpress.org/extend/plugins/taxonomy-images/) to let everyone know that the current version works with your version of WordPress.
|
188 |
|
189 |
* __Do you Twitter?__ Help promote by using this shortlink: [http://bit.ly/taxonomy-images](http://bit.ly/taxonomy-images)
|
190 |
|
191 |
* __Are you a writer?__ Help promote by writing an article on your website about this plugin.
|
192 |
|
193 |
-
* __Are you Super-Wicked-Awesome?__ If so, you can always [make a donation](http://wordpress.mfields.org/donate/).
|
194 |
-
|
195 |
= Need More Taxonomy Plugins? =
|
196 |
-
I've released a handfull of plugins dealing with taxonomies. Please see my [plugin page](http://wordpress.org/extend/plugins/profile/mfields) for more info.
|
197 |
|
198 |
-
|
|
|
|
|
199 |
|
200 |
1. Download
|
201 |
1. Unzip the package and upload to your /wp-content/plugins/ directory.
|
@@ -203,67 +200,88 @@ I've released a handfull of plugins dealing with taxonomies. Please see my [plug
|
|
203 |
1. Activate the plugin.
|
204 |
1. Click the "Taxonomy Images" link under the Settings section in the admin menu. There you can select the taxonomies that you would like to add image support for.
|
205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
== Upgrade Notice ==
|
207 |
|
|
|
|
|
|
|
208 |
= 0.8 =
|
209 |
-
Major and minor bug fixes tested with
|
210 |
|
211 |
= 0.7 =
|
212 |
Complete rewrite. Better everything. Many bug fixes.
|
213 |
|
214 |
-
==Changelog==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
|
216 |
= 0.8.0 =
|
217 |
-
*
|
218 |
-
*
|
219 |
-
* Give the button on the custom admin screen a class of `button-primary`.
|
220 |
-
* Store the return value of `get_posts()` in a variable called `$images`. Not sure why, but this should not harm anything.
|
221 |
-
* Change license to GPLv2 or later for maximum flexibility and compatibility.
|
222 |
-
*
|
223 |
-
*
|
224 |
-
*
|
225 |
-
*
|
226 |
-
*
|
227 |
-
*
|
228 |
|
229 |
= 0.7.3 =
|
230 |
-
* Fixed the delete image button on edit-terms.php.
|
231 |
-
* Better escaping.
|
232 |
-
* Introduced pot file and languages directory.
|
233 |
|
234 |
= 0.7.2 =
|
235 |
-
* Return data for
|
236 |
|
237 |
= 0.7.1 =
|
238 |
-
* Remove unused link code which is throwing an error when no taxonomies support images.
|
239 |
|
240 |
= 0.7 =
|
241 |
-
* No longer breaks display of the [Better Plugin Compatibility Control](http://wordpress.org/extend/plugins/better-plugin-compatibility-control/) plugin.
|
242 |
-
* Created a custom filter interface for plugin and theme integration.
|
243 |
-
* Lots of inline documentation added.
|
244 |
-
* Added custom notices if plugin is used in an unsupported way.
|
245 |
-
* No notices generated by PHP or WordPress.
|
246 |
-
* Deprecated function calls removed.
|
247 |
-
* Security updates.
|
248 |
-
* All strings are now internationalized.
|
249 |
-
* Add image to term functionality mimics "Add Featured Image".
|
250 |
-
* Taxonomy modal button now available in search + upload states.
|
251 |
-
* Image interface has been added to single term edit screen.
|
252 |
-
* Users can now choose which taxonomys have image support.
|
253 |
-
* All functions are now private.
|
254 |
-
* Shortcode deprecated.
|
255 |
-
* All global variables and constants have been removed or deprecated.
|
256 |
|
257 |
= 0.6 =
|
|
|
258 |
* Never released.
|
259 |
-
* Completely recoded.
|
260 |
|
261 |
= 0.5 =
|
262 |
* __UPDATE:__ Direct link to upload new files from edit-tag.php has been introduced.
|
263 |
* __UPDATE:__ Ability to create an image/term association immediately after upload has been introduced.
|
264 |
* __UPDATE:__ Users can now delete image/term associations.
|
265 |
* __UPDATE:__ Created standalone javascript files - removed inline scripts.
|
266 |
-
* __UPDATE:__
|
267 |
* __UPDATE:__ Localization for strings - still need to "fine-tooth-comb" this.
|
268 |
* __UPDATE:__ Removed all debug functions.
|
269 |
|
@@ -271,16 +289,16 @@ Complete rewrite. Better everything. Many bug fixes.
|
|
271 |
* __BUGFIX:__ get_image_html() Now populates the image's alt attribute with appropriate data. Props to [jaygoldman](http://wordpress.org/support/profile/jaygoldman).
|
272 |
|
273 |
= 0.4.3 =
|
274 |
-
* __UPDATE:__ Support for WordPress 3.0 has been added. Support for all beta versions of 3.0 has been dropped.
|
275 |
* __COMPAT:__ Removed use of deprecated function is_taxonomy() - props to [anointed](http://profiles.wordpress.org/users/anointed).
|
276 |
* __COMPAT:__ Included a definition for taxonomy_exists() function for backwards compatibility with 2.9 branch. This function is new in WordPress version 3.0.
|
|
|
277 |
|
278 |
= 0.4.2 =
|
279 |
* __UPDATE:__ Changed button name from "Category" to "Taxonomy".
|
280 |
* __UPDATE:__ Support for 2.9 branch has been added again.
|
281 |
|
282 |
= 0.4.1 =
|
283 |
-
* __UPDATE:__ Added support for dynamic taxonomy hooks for _tag_row()
|
284 |
* __BROKEN:__ Support for 2.9 branch has been temporarily removed.
|
285 |
|
286 |
= 0.4 =
|
@@ -288,12 +306,12 @@ Complete rewrite. Better everything. Many bug fixes.
|
|
288 |
* __UPDATE:__ Added "taxonomy_images_shortcode".
|
289 |
|
290 |
= 0.3 =
|
|
|
291 |
* __COMPAT:__ Changed the firing order of every hook untilizing the 'category_rows' method to 15. This allows this plugin to be compatible with [Reveal IDs for WP Admin](http://wordpress.org/extend/plugins/reveal-ids-for-wp-admin-25/). Thanks to [Peter Kahoun](http://profiles.wordpress.org/kahi/)
|
292 |
* __COMPAT:__ Added Version check for PHP5.
|
293 |
* __UPDATE:__ `$settings` and `$locale` are now public properties.
|
294 |
-
* __UPDATE:__ Object name changed to
|
295 |
* __UPDATE:__ Added argument $term_tax_id to both print_image_html() and get_image_html().
|
296 |
-
* __BUGFIX:__ Deleted the register_deactivation_hook() function -> sorry to all 8 who downloaded this plugin so far :)
|
297 |
|
298 |
= 0.2 =
|
299 |
-
* Original Release - Works
|
1 |
+
=== Taxonomy Images ===
|
2 |
|
3 |
+
Contributors: mfields, husobj, jamiemchale
|
|
|
4 |
Tags: taxonomy, tag, category, image, upload, media
|
5 |
+
Requires at least: 3.4
|
6 |
+
Tested up to: 4.3.1
|
7 |
+
Stable tag: 0.9
|
8 |
+
License: GPLv2 or later
|
9 |
|
10 |
Associate images from your media library to categories, tags and custom taxonomies.
|
11 |
|
12 |
+
== Description ==
|
|
|
|
|
13 |
|
14 |
= Displaying Your Images in Your Theme =
|
15 |
|
17 |
|
18 |
= Display a single image representing the term archive =
|
19 |
|
20 |
+
The following filter will display the image associated with the term asked for in the query string of the url. This filter only works in views that naturally use templates like category.php, tag.php, taxonomy.php and all of their derivatives. Please read about [template hierarchy](http://codex.wordpress.org/Template_Hierarchy) for more information about these templates. The simplest use of this filter looks like:
|
21 |
|
22 |
`print apply_filters( 'taxonomy-images-queried-term-image', '' );`
|
23 |
|
24 |
+
This code will generate and print an image tag. It's output can be modifed by passing an optional third parameter to apply_filters(). This parameter is an array and the following keys may be set:
|
25 |
|
26 |
+
* __after__ _(string)_ - Text to append to the image's HTML.
|
27 |
|
28 |
+
* __attr__ _(array)_ - Key/value pairs representing the attributes of the img tag. Available options include: alt, class, src and title. This array will be passed as the fourth parameter to WordPress core function wp_get_attachment_image() without modification.
|
29 |
|
30 |
+
* __before__ _(string)_ - Text to prepend to the image's HTML.
|
31 |
|
32 |
+
* __image_size__ _(string)_ - May be any image size registered with WordPress. If no image size is specified, 'thumbnail' will be used as a default value. In the event that an unregistered size is specified, this filter will return an empty string.
|
33 |
|
34 |
Here's an example of what a fully customized version of this filter might look like:
|
35 |
|
36 |
`print apply_filters( 'taxonomy-images-queried-term-image', '', array(
|
37 |
+
'attr' => array(
|
|
|
38 |
'alt' => 'Custom alternative text',
|
39 |
'class' => 'my-class-list bunnies turtles',
|
40 |
'src' => 'this-is-where-the-image-lives.png',
|
41 |
'title' => 'Custom Title',
|
42 |
),
|
43 |
+
'before' => '<div id="my-custom-div">',
|
44 |
+
'after' => '</div>',
|
45 |
+
'image_size' => 'medium'
|
46 |
+
) );
|
47 |
`
|
48 |
|
49 |
= Similar functionality =
|
65 |
`
|
66 |
$image_url = apply_filters( 'taxonomy-images-queried-term-image-url', '', array(
|
67 |
'image_size' => 'medium'
|
68 |
+
) );
|
69 |
`
|
70 |
|
71 |
If you need data about the image, you may want to use:
|
82 |
|
83 |
= List term images associated with a post object =
|
84 |
|
85 |
+
When a post is being displayed you may want to display the images associated with all of the terms associated with the post. The `taxonomy-images-list-the-terms` filter does this. Here's what it looks like in its simplest form:
|
86 |
|
87 |
`print apply_filters( 'taxonomy-images-list-the-terms', '' );`
|
88 |
|
89 |
This filter accepts an optional third parameter that you can use to customize its output. It is an array which recognizes the following keys:
|
90 |
|
91 |
+
* __after__ _(string)_ - Text to append to the output. Default value is a closing unordered list element.
|
92 |
|
93 |
+
* __after_image__ _(string)_ - Text to append to each image. Default value is a closing list-item element.
|
94 |
|
95 |
+
* __before__ _(string)_ - Text to prepend to the output. Default value is an open unordered list element with an class attribute of "taxonomy-images-the-terms".
|
96 |
|
97 |
+
* __before_image__ _(string)_ - Text to prepend to each image. Default value is an open list-item element.
|
98 |
|
99 |
+
* __image_size__ _(string)_ - Any registered image size. Values will vary from installation to installation. Image sizes defined in core include: "thumbnail", "medium" and "large". "full" may also be used to get the unmodified image that was uploaded. Defaults to "thumbnail".
|
100 |
|
101 |
+
* __post_id__ _(int)_ - The post to retrieve terms from. Defaults to the ID property of the global $post object.
|
102 |
|
103 |
+
* __taxonomy__ _(string)_ - Name of a registered taxonomy to return terms from. Defaults to "category".
|
104 |
|
105 |
Here's an example of what a fully customized version of this filter might look like:
|
106 |
|
107 |
`
|
108 |
print apply_filters( 'taxonomy-images-list-the-terms', '', array(
|
|
|
|
|
109 |
'before' => '<div class="my-custom-class-name">',
|
110 |
+
'after' => '</div>',
|
111 |
'before_image' => '<span>',
|
112 |
+
'after_image' => '</span>',
|
113 |
'image_size' => 'detail',
|
114 |
'post_id' => 1234,
|
115 |
'taxonomy' => 'post_tag',
|
116 |
+
) );
|
117 |
`
|
118 |
|
119 |
= Working with all terms of a given taxonomy =
|
127 |
`
|
128 |
Array
|
129 |
(
|
130 |
+
[0] => stdClass Object
|
131 |
+
(
|
132 |
+
[term_id] => 8
|
133 |
+
[name] => Pirate
|
134 |
+
[slug] => pirate
|
135 |
+
[term_group] => 0
|
136 |
+
[term_taxonomy_id] => 8
|
137 |
+
[taxonomy] => category
|
138 |
+
[description] => Pirates live in the ocean and ride around on boats.
|
139 |
+
[parent] => 0
|
140 |
+
[count] => 1
|
141 |
+
[image_id] => 44
|
142 |
+
)
|
143 |
)
|
144 |
`
|
145 |
|
147 |
|
148 |
This filter recognizes an optional third parameter which is an array of arguments that can be used to modify its output:
|
149 |
|
150 |
+
* __cache_images__ _(bool)_ If this value is true all associated images will be queried and cached for later use in various template tags. If it is set to false, this query will be suppressed. Do not set this value to false unless you have a really good reason for doing so :) Default value is true.
|
151 |
|
152 |
+
* __having_images__ _(bool)_ If this value is true then only terms that have associated images will be returned. Setting it to false will return all terms. Default value is true.
|
153 |
|
154 |
+
* __taxonomy__ _(string)_ Name of a registered taxonomy to return terms from. Multiple taxonomies may be specified by separating each name by a comma. Defaults to "category".
|
155 |
|
156 |
+
* __term_args__ _(array)_ Arguments to pass to [get_terms()](http://codex.wordpress.org/Function_Reference/get_terms) as the second parameter. Default value is an empty array.
|
157 |
|
158 |
+
Here's an example of a simple custom loop that you can use to display all term images:
|
159 |
|
160 |
`
|
161 |
$terms = apply_filters( 'taxonomy-images-get-terms', '' );
|
162 |
if ( ! empty( $terms ) ) {
|
163 |
print '<ul>';
|
164 |
+
foreach ( (array) $terms as $term ) {
|
165 |
print '<li><a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id, 'detail' ) . '</li>';
|
166 |
}
|
167 |
print '</ul>';
|
174 |
|
175 |
= Bugs, Suggestions =
|
176 |
|
177 |
+
Development of this plugin is hosted in a public repository on [Github](https://github.com/benhuson/Taxonomy-Images). If you find a bug in this plugin or have a suggestion to make it better, please [create a new issue](https://github.com/benhuson/Taxonomy-Images/issues/new)
|
178 |
|
179 |
= Hook it up yo! =
|
180 |
|
181 |
If you have fallen in love with this plugin and would not be able to sleep without helping out in some way, please see the following list of ways that you can _hook it up!_:
|
182 |
|
183 |
+
* __Rate it!__ - Use the star tool on the right-hand sidebar of the [plugin homepage](http://wordpress.org/extend/plugins/taxonomy-images/).
|
184 |
|
185 |
+
* __Let me know if it works__ - Use the _Compatibility_ widget on the [plugin homepage](http://wordpress.org/extend/plugins/taxonomy-images/) to let everyone know that the current version works with your version of WordPress.
|
186 |
|
187 |
* __Do you Twitter?__ Help promote by using this shortlink: [http://bit.ly/taxonomy-images](http://bit.ly/taxonomy-images)
|
188 |
|
189 |
* __Are you a writer?__ Help promote by writing an article on your website about this plugin.
|
190 |
|
|
|
|
|
191 |
= Need More Taxonomy Plugins? =
|
|
|
192 |
|
193 |
+
The original author of this plugin, Michael Fields, released a handful of plugins dealing with taxonomies. Please see his [plugin page](http://wordpress.org/extend/plugins/profile/mfields) for more information.
|
194 |
+
|
195 |
+
== Installation ==
|
196 |
|
197 |
1. Download
|
198 |
1. Unzip the package and upload to your /wp-content/plugins/ directory.
|
200 |
1. Activate the plugin.
|
201 |
1. Click the "Taxonomy Images" link under the Settings section in the admin menu. There you can select the taxonomies that you would like to add image support for.
|
202 |
|
203 |
+
== Screenshots ==
|
204 |
+
|
205 |
+
1. Edit terms admin page.
|
206 |
+
2. Edit term admin page.
|
207 |
+
3. Media Modal
|
208 |
+
|
209 |
== Upgrade Notice ==
|
210 |
|
211 |
+
= 0.9 =
|
212 |
+
Fixes media modal for newer versions of WordPress. Tested up to WordPress 4.3.1 (requires 3.4+).
|
213 |
+
|
214 |
= 0.8 =
|
215 |
+
Major and minor bug fixes tested with WordPress 3.6.
|
216 |
|
217 |
= 0.7 =
|
218 |
Complete rewrite. Better everything. Many bug fixes.
|
219 |
|
220 |
+
== Changelog ==
|
221 |
+
|
222 |
+
= 0.9 =
|
223 |
+
* __COMPAT:__ Add support for WordPress 3.5+ media modal.
|
224 |
+
* __COMPAT:__ Confirmed minimum WordPress 3.4 required.
|
225 |
+
* __UPDATE:__ Add Spanish translation.
|
226 |
+
* __UPDATE:__ Make images retina sized in the admin.
|
227 |
+
* __UPDATE:__ Re-color admin image and icons to fit with more recent versions of WordPress.
|
228 |
+
* __UPDATE:__ Stop using deprecated image_resize() function.
|
229 |
+
* __UPDATE:__ Stop using deprecated screen_icon() function.
|
230 |
+
* __UPDATE:__ Move JavaScript and CSS files to subfolders.
|
231 |
+
* __UPDATE:__ Added screenshots for WordPress.org
|
232 |
+
* __UPDATE:__ Add husobj as a contributor.
|
233 |
|
234 |
= 0.8.0 =
|
235 |
+
* __COMPAT:__ Use jQuery.on() instead of jQuery.live(). Props [jamiemchale](http://profiles.wordpress.org/jamiemchale).
|
236 |
+
* __UPDATE:__ Pass an empty array as default second parameter of `taxonomy_images_plugin_get_the_terms()` and `taxonomy_images_plugin_list_the_terms()`.
|
237 |
+
* __UPDATE:__ Give the button on the custom admin screen a class of `button-primary`.
|
238 |
+
* __UPDATE:__ Store the return value of `get_posts()` in a variable called `$images`. Not sure why, but this should not harm anything.
|
239 |
+
* __UPDATE:__ Change license to GPLv2 or later for maximum flexibility and compatibility.
|
240 |
+
* __UPDATE:__ Random whitespace fixes.
|
241 |
+
* __UPDATE:__ Update Documentation.
|
242 |
+
* __UPDATE:__ CSS coding standards.
|
243 |
+
* __UPDATE:__ Bump version number.
|
244 |
+
* __UPDATE:__ Update readme files.
|
245 |
+
* __UPDATE:__ Add jamiemchale as a contributor.
|
246 |
|
247 |
= 0.7.3 =
|
248 |
+
* __BUGFIX:__ Fixed the delete image button on edit-terms.php.
|
249 |
+
* __UPDATE:__ Better escaping.
|
250 |
+
* __UPDATE:__ Introduced pot file and languages directory.
|
251 |
|
252 |
= 0.7.2 =
|
253 |
+
* __UPDATE:__ Return data for fullsize images in archive views. [See this thread](http://wordpress.org/support/topic/image-size-full).
|
254 |
|
255 |
= 0.7.1 =
|
256 |
+
* __BUGFIX:__ Remove unused link code which is throwing an error when no taxonomies support images.
|
257 |
|
258 |
= 0.7 =
|
259 |
+
* __COMPAT:__ No longer breaks display of the [Better Plugin Compatibility Control](http://wordpress.org/extend/plugins/better-plugin-compatibility-control/) plugin.
|
260 |
+
* __UPDATE:__ Created a custom filter interface for plugin and theme integration.
|
261 |
+
* __UPDATE:__ Lots of inline documentation added.
|
262 |
+
* __UPDATE:__ Added custom notices if plugin is used in an unsupported way.
|
263 |
+
* __UPDATE:__ No notices generated by PHP or WordPress.
|
264 |
+
* __UPDATE:__ Deprecated function calls removed.
|
265 |
+
* __UPDATE:__ Security updates.
|
266 |
+
* __UPDATE:__ All strings are now internationalized.
|
267 |
+
* __UPDATE:__ Add image to term functionality mimics "Add Featured Image".
|
268 |
+
* __UPDATE:__ Taxonomy modal button now available in search + upload states.
|
269 |
+
* __UPDATE:__ Image interface has been added to single term edit screen.
|
270 |
+
* __UPDATE:__ Users can now choose which taxonomys have image support.
|
271 |
+
* __UPDATE:__ All functions are now private.
|
272 |
+
* __UPDATE:__ Shortcode deprecated.
|
273 |
+
* __UPDATE:__ All global variables and constants have been removed or deprecated.
|
274 |
|
275 |
= 0.6 =
|
276 |
+
* __UPDATE:__ Completely recoded.
|
277 |
* Never released.
|
|
|
278 |
|
279 |
= 0.5 =
|
280 |
* __UPDATE:__ Direct link to upload new files from edit-tag.php has been introduced.
|
281 |
* __UPDATE:__ Ability to create an image/term association immediately after upload has been introduced.
|
282 |
* __UPDATE:__ Users can now delete image/term associations.
|
283 |
* __UPDATE:__ Created standalone javascript files - removed inline scripts.
|
284 |
+
* __UPDATE:__ Obsessive compulsive syntax modifications.
|
285 |
* __UPDATE:__ Localization for strings - still need to "fine-tooth-comb" this.
|
286 |
* __UPDATE:__ Removed all debug functions.
|
287 |
|
289 |
* __BUGFIX:__ get_image_html() Now populates the image's alt attribute with appropriate data. Props to [jaygoldman](http://wordpress.org/support/profile/jaygoldman).
|
290 |
|
291 |
= 0.4.3 =
|
|
|
292 |
* __COMPAT:__ Removed use of deprecated function is_taxonomy() - props to [anointed](http://profiles.wordpress.org/users/anointed).
|
293 |
* __COMPAT:__ Included a definition for taxonomy_exists() function for backwards compatibility with 2.9 branch. This function is new in WordPress version 3.0.
|
294 |
+
* __UPDATE:__ Support for WordPress 3.0 has been added. Support for all beta versions of 3.0 has been dropped.
|
295 |
|
296 |
= 0.4.2 =
|
297 |
* __UPDATE:__ Changed button name from "Category" to "Taxonomy".
|
298 |
* __UPDATE:__ Support for 2.9 branch has been added again.
|
299 |
|
300 |
= 0.4.1 =
|
301 |
+
* __UPDATE:__ Added support for dynamic taxonomy hooks for _tag_row().
|
302 |
* __BROKEN:__ Support for 2.9 branch has been temporarily removed.
|
303 |
|
304 |
= 0.4 =
|
306 |
* __UPDATE:__ Added "taxonomy_images_shortcode".
|
307 |
|
308 |
= 0.3 =
|
309 |
+
* __BUGFIX:__ Deleted the register_deactivation_hook() function - sorry to all 8 who downloaded this plugin so far :)
|
310 |
* __COMPAT:__ Changed the firing order of every hook untilizing the 'category_rows' method to 15. This allows this plugin to be compatible with [Reveal IDs for WP Admin](http://wordpress.org/extend/plugins/reveal-ids-for-wp-admin-25/). Thanks to [Peter Kahoun](http://profiles.wordpress.org/kahi/)
|
311 |
* __COMPAT:__ Added Version check for PHP5.
|
312 |
* __UPDATE:__ `$settings` and `$locale` are now public properties.
|
313 |
+
* __UPDATE:__ Object name changed to $taxonomy_images_plugin.
|
314 |
* __UPDATE:__ Added argument $term_tax_id to both print_image_html() and get_image_html().
|
|
|
315 |
|
316 |
= 0.2 =
|
317 |
+
* Original Release - Works with WordPress 2.9.1.
|
taxonomy-images.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Taxonomy Images
|
4 |
-
Plugin URI:
|
5 |
Description: Associate images from your media library to categories, tags and custom taxonomies.
|
6 |
-
Version: 0.
|
7 |
-
Author: Michael Fields
|
8 |
Author URI: http://wordpress.mfields.org/
|
9 |
License: GNU General Public License v2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -39,7 +39,7 @@ require_once( trailingslashit( dirname( __FILE__ ) ) . 'public-filters.php' );
|
|
39 |
* @alter 0.7.4
|
40 |
*/
|
41 |
function taxonomy_image_plugin_version() {
|
42 |
-
return '0.
|
43 |
}
|
44 |
|
45 |
|
@@ -69,7 +69,7 @@ function taxonomy_image_plugin_url( $file = '' ) {
|
|
69 |
function taxonomy_image_plugin_detail_image_size() {
|
70 |
return array(
|
71 |
'name' => 'detail',
|
72 |
-
'size' => array(
|
73 |
);
|
74 |
}
|
75 |
|
@@ -367,7 +367,6 @@ add_action( 'admin_menu', 'taxonomy_images_settings_menu' );
|
|
367 |
*/
|
368 |
function taxonomy_image_plugin_settings_page() {
|
369 |
print "\n" . '<div class="wrap">';
|
370 |
-
screen_icon();
|
371 |
|
372 |
/* translators: Heading of the custom administration page. */
|
373 |
print "\n" . '<h2>' . esc_html__( 'Taxonomy Images Plugin Settings', 'taxonomy-images' ) . '</h2>';
|
@@ -408,7 +407,7 @@ function taxonomy_image_plugin_control_taxonomies() {
|
|
408 |
$checked = ' checked="checked"';
|
409 |
|
410 |
print "\n" . '<p><label for="' . esc_attr( $id ) . '">';
|
411 |
-
print '<input' . $checked . ' id="' . esc_attr( $id ) . '" type="checkbox" name="taxonomy_image_plugin_settings[taxonomies][]" value="' . esc_attr( $taxonomy->name ) . '"
|
412 |
print ' ' . esc_html( $taxonomy->label ) . '</label></p>';
|
413 |
}
|
414 |
}
|
@@ -798,10 +797,13 @@ function taxonomy_image_plugin_control_image( $term_id, $taxonomy ) {
|
|
798 |
|
799 |
$term = get_term( $term_id, $taxonomy->name );
|
800 |
|
|
|
|
|
|
|
801 |
$o = "\n" . '<div id="' . esc_attr( 'taxonomy-image-control-' . $tt_id ) . '" class="taxonomy-image-control hide-if-no-js">';
|
802 |
-
$o.= "\n" . '<a class="thickbox taxonomy-image-thumbnail" href="' . esc_url( admin_url( 'media-upload.php' ) . '?type=image&tab=library&post_id=0&TB_iframe=true' ) . '" title="' . esc_attr( sprintf( __( 'Associate an image with the %1$s named “%2$s”.', 'taxonomy-images' ), $name, $term->name ) ) . '"><img id="' . esc_attr( 'taxonomy_image_plugin_' . $tt_id ) . '" src="' . esc_url( $img ) . '" alt="" /></a>';
|
803 |
-
$o.= "\n" . '<a class="control upload thickbox" href="' . esc_url( admin_url( 'media-upload.php' ) . '?type=image&tab=type&post_id=0&TB_iframe=true' ) . '" title="' . esc_attr( sprintf( __( 'Upload a new image for this %s.', 'taxonomy-images' ), $name ) ) . '">' . esc_html__( 'Upload.', 'taxonomy-images' ) . '</a>';
|
804 |
-
$o.= "\n" . '<a class="control remove' . $hide . '" href="#" id="' . esc_attr( 'remove-' . $tt_id ) . '" rel="' . esc_attr( $tt_id ) . '" title="' . esc_attr( sprintf( __( 'Remove image from this %s.', 'taxonomy-images' ), $name ) ) . '">' . esc_html__( 'Delete', 'taxonomy-images' ) . '</a>';
|
805 |
$o.= "\n" . '<input type="hidden" class="tt_id" name="' . esc_attr( 'tt_id-' . $tt_id ) . '" value="' . esc_attr( $tt_id ) . '" />';
|
806 |
|
807 |
$o.= "\n" . '<input type="hidden" class="image_id" name="' . esc_attr( 'image_id-' . $tt_id ) . '" value="' . esc_attr( $attachment_id ) . '" />';
|
@@ -822,9 +824,14 @@ function taxonomy_image_plugin_control_image( $term_id, $taxonomy ) {
|
|
822 |
* @access private
|
823 |
*/
|
824 |
function taxonomy_image_plugin_media_upload_popup_js() {
|
|
|
|
|
|
|
|
|
|
|
825 |
wp_enqueue_script(
|
826 |
'taxonomy-images-media-upload-popup',
|
827 |
-
taxonomy_image_plugin_url( 'media-upload-popup.js' ),
|
828 |
array( 'jquery' ),
|
829 |
taxonomy_image_plugin_version()
|
830 |
);
|
@@ -849,9 +856,13 @@ function taxonomy_image_plugin_edit_tags_js() {
|
|
849 |
if ( false == taxonomy_image_plugin_is_screen_active() )
|
850 |
return;
|
851 |
|
|
|
|
|
|
|
|
|
852 |
wp_enqueue_script(
|
853 |
'taxonomy-image-plugin-edit-tags',
|
854 |
-
taxonomy_image_plugin_url( 'edit-tags.js' ),
|
855 |
array( 'jquery', 'thickbox' ),
|
856 |
taxonomy_image_plugin_version()
|
857 |
);
|
@@ -877,7 +888,7 @@ function taxonomy_image_plugin_css_admin() {
|
|
877 |
|
878 |
wp_enqueue_style(
|
879 |
'taxonomy-image-plugin-edit-tags',
|
880 |
-
taxonomy_image_plugin_url( 'admin.css' ),
|
881 |
array(),
|
882 |
taxonomy_image_plugin_version(),
|
883 |
'screen'
|
@@ -921,13 +932,13 @@ function taxonomy_image_plugin_css_public() {
|
|
921 |
|
922 |
wp_enqueue_style(
|
923 |
'taxonomy-image-plugin-public',
|
924 |
-
taxonomy_image_plugin_url( 'style.css' ),
|
925 |
array(),
|
926 |
taxonomy_image_plugin_version(),
|
927 |
'screen'
|
928 |
);
|
929 |
}
|
930 |
-
add_action( '
|
931 |
|
932 |
|
933 |
/**
|
@@ -1152,11 +1163,11 @@ function taxonomy_images_plugin_row_meta( $links, $file ) {
|
|
1152 |
if ( $plugin_name != $file )
|
1153 |
return $links;
|
1154 |
|
1155 |
-
$link = taxonomy_images_plugin_settings_page_link(
|
1156 |
if ( ! empty( $link ) )
|
1157 |
$links[] = $link;
|
1158 |
|
1159 |
-
$links[] = '<a href="http://wordpress.mfields.org/donate/">' .
|
1160 |
|
1161 |
return $links;
|
1162 |
}
|
@@ -1182,3 +1193,38 @@ function taxonomy_images_plugin_settings_page_link( $link_text = '' ) {
|
|
1182 |
|
1183 |
return $link;
|
1184 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Taxonomy Images
|
4 |
+
Plugin URI: https://github.com/benhuson/Taxonomy-Images
|
5 |
Description: Associate images from your media library to categories, tags and custom taxonomies.
|
6 |
+
Version: 0.9
|
7 |
+
Author: Michael Fields, Ben Huson
|
8 |
Author URI: http://wordpress.mfields.org/
|
9 |
License: GNU General Public License v2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
39 |
* @alter 0.7.4
|
40 |
*/
|
41 |
function taxonomy_image_plugin_version() {
|
42 |
+
return '0.9';
|
43 |
}
|
44 |
|
45 |
|
69 |
function taxonomy_image_plugin_detail_image_size() {
|
70 |
return array(
|
71 |
'name' => 'detail',
|
72 |
+
'size' => array( 150, 150, true )
|
73 |
);
|
74 |
}
|
75 |
|
367 |
*/
|
368 |
function taxonomy_image_plugin_settings_page() {
|
369 |
print "\n" . '<div class="wrap">';
|
|
|
370 |
|
371 |
/* translators: Heading of the custom administration page. */
|
372 |
print "\n" . '<h2>' . esc_html__( 'Taxonomy Images Plugin Settings', 'taxonomy-images' ) . '</h2>';
|
407 |
$checked = ' checked="checked"';
|
408 |
|
409 |
print "\n" . '<p><label for="' . esc_attr( $id ) . '">';
|
410 |
+
print '<input' . $checked . ' id="' . esc_attr( $id ) . '" type="checkbox" name="taxonomy_image_plugin_settings[taxonomies][]" value="' . esc_attr( $taxonomy->name ) . '" />';
|
411 |
print ' ' . esc_html( $taxonomy->label ) . '</label></p>';
|
412 |
}
|
413 |
}
|
797 |
|
798 |
$term = get_term( $term_id, $taxonomy->name );
|
799 |
|
800 |
+
$nonce = wp_create_nonce( 'taxonomy-image-plugin-create-association' );
|
801 |
+
$nonce_remove = wp_create_nonce( 'taxonomy-image-plugin-remove-association' );
|
802 |
+
|
803 |
$o = "\n" . '<div id="' . esc_attr( 'taxonomy-image-control-' . $tt_id ) . '" class="taxonomy-image-control hide-if-no-js">';
|
804 |
+
$o.= "\n" . '<a class="thickbox taxonomy-image-thumbnail" data-tt-id="' . $tt_id . '" data-attachment-id="' . $attachment_id . '" data-nonce="' . $nonce . '" href="' . esc_url( admin_url( 'media-upload.php' ) . '?type=image&tab=library&post_id=0&TB_iframe=true' ) . '" title="' . esc_attr( sprintf( __( 'Associate an image with the %1$s named “%2$s”.', 'taxonomy-images' ), $name, $term->name ) ) . '"><img id="' . esc_attr( 'taxonomy_image_plugin_' . $tt_id ) . '" src="' . esc_url( $img ) . '" alt="" /></a>';
|
805 |
+
$o.= "\n" . '<a class="control upload thickbox" data-tt-id="' . $tt_id . '" data-attachment-id="' . $attachment_id . '" data-nonce="' . $nonce . '" href="' . esc_url( admin_url( 'media-upload.php' ) . '?type=image&tab=type&post_id=0&TB_iframe=true' ) . '" title="' . esc_attr( sprintf( __( 'Upload a new image for this %s.', 'taxonomy-images' ), $name ) ) . '">' . esc_html__( 'Upload.', 'taxonomy-images' ) . '</a>';
|
806 |
+
$o.= "\n" . '<a class="control remove' . $hide . '" data-tt-id="' . $tt_id . '" data-nonce="' . $nonce_remove . '" href="#" id="' . esc_attr( 'remove-' . $tt_id ) . '" rel="' . esc_attr( $tt_id ) . '" title="' . esc_attr( sprintf( __( 'Remove image from this %s.', 'taxonomy-images' ), $name ) ) . '">' . esc_html__( 'Delete', 'taxonomy-images' ) . '</a>';
|
807 |
$o.= "\n" . '<input type="hidden" class="tt_id" name="' . esc_attr( 'tt_id-' . $tt_id ) . '" value="' . esc_attr( $tt_id ) . '" />';
|
808 |
|
809 |
$o.= "\n" . '<input type="hidden" class="image_id" name="' . esc_attr( 'image_id-' . $tt_id ) . '" value="' . esc_attr( $attachment_id ) . '" />';
|
824 |
* @access private
|
825 |
*/
|
826 |
function taxonomy_image_plugin_media_upload_popup_js() {
|
827 |
+
|
828 |
+
if ( version_compare( get_bloginfo( 'version' ), 3.5 ) >= 0 ) {
|
829 |
+
return;
|
830 |
+
}
|
831 |
+
|
832 |
wp_enqueue_script(
|
833 |
'taxonomy-images-media-upload-popup',
|
834 |
+
taxonomy_image_plugin_url( 'js/media-upload-popup.js' ),
|
835 |
array( 'jquery' ),
|
836 |
taxonomy_image_plugin_version()
|
837 |
);
|
856 |
if ( false == taxonomy_image_plugin_is_screen_active() )
|
857 |
return;
|
858 |
|
859 |
+
if ( version_compare( get_bloginfo( 'version' ), 3.5 ) >= 0 ) {
|
860 |
+
return;
|
861 |
+
}
|
862 |
+
|
863 |
wp_enqueue_script(
|
864 |
'taxonomy-image-plugin-edit-tags',
|
865 |
+
taxonomy_image_plugin_url( 'js/edit-tags.js' ),
|
866 |
array( 'jquery', 'thickbox' ),
|
867 |
taxonomy_image_plugin_version()
|
868 |
);
|
888 |
|
889 |
wp_enqueue_style(
|
890 |
'taxonomy-image-plugin-edit-tags',
|
891 |
+
taxonomy_image_plugin_url( 'css/admin.css' ),
|
892 |
array(),
|
893 |
taxonomy_image_plugin_version(),
|
894 |
'screen'
|
932 |
|
933 |
wp_enqueue_style(
|
934 |
'taxonomy-image-plugin-public',
|
935 |
+
taxonomy_image_plugin_url( 'css/style.css' ),
|
936 |
array(),
|
937 |
taxonomy_image_plugin_version(),
|
938 |
'screen'
|
939 |
);
|
940 |
}
|
941 |
+
add_action( 'wp_enqueue_scripts', 'taxonomy_image_plugin_css_public' );
|
942 |
|
943 |
|
944 |
/**
|
1163 |
if ( $plugin_name != $file )
|
1164 |
return $links;
|
1165 |
|
1166 |
+
$link = taxonomy_images_plugin_settings_page_link( esc_html__( 'Settings', 'taxonomy-images' ) );
|
1167 |
if ( ! empty( $link ) )
|
1168 |
$links[] = $link;
|
1169 |
|
1170 |
+
$links[] = '<a href="http://wordpress.mfields.org/donate/">' . esc_html__( 'Donate', 'taxonomy-images' ) . '</a>';
|
1171 |
|
1172 |
return $links;
|
1173 |
}
|
1193 |
|
1194 |
return $link;
|
1195 |
}
|
1196 |
+
|
1197 |
+
/**
|
1198 |
+
* Enqueue Admin Scripts
|
1199 |
+
*
|
1200 |
+
* @since 0.9
|
1201 |
+
*/
|
1202 |
+
function taxonomy_images_admin_enqueue_scripts() {
|
1203 |
+
|
1204 |
+
if ( false == taxonomy_image_plugin_is_screen_active() ) {
|
1205 |
+
return;
|
1206 |
+
}
|
1207 |
+
|
1208 |
+
if ( version_compare( get_bloginfo( 'version' ), 3.5 ) < 0 ) {
|
1209 |
+
return;
|
1210 |
+
}
|
1211 |
+
|
1212 |
+
wp_enqueue_media();
|
1213 |
+
|
1214 |
+
wp_enqueue_script(
|
1215 |
+
'taxonomy-images-media-modal',
|
1216 |
+
taxonomy_image_plugin_url( 'js/media-modal.js' ),
|
1217 |
+
array( 'jquery' ),
|
1218 |
+
taxonomy_image_plugin_version()
|
1219 |
+
);
|
1220 |
+
|
1221 |
+
wp_localize_script( 'taxonomy-images-media-modal', 'TaxonomyImagesMediaModal', array(
|
1222 |
+
'wp_media_post_id' => 0,
|
1223 |
+
'attachment_id' => 0,
|
1224 |
+
'uploader_title' => __( 'Set featured image', 'taxonomy-images' ),
|
1225 |
+
'uploader_button_text' => __( 'Set featured image', 'taxonomy-images' ),
|
1226 |
+
'default_img_src' => taxonomy_image_plugin_url( 'default.png' )
|
1227 |
+
) );
|
1228 |
+
|
1229 |
+
}
|
1230 |
+
add_action( 'admin_enqueue_scripts', 'taxonomy_images_admin_enqueue_scripts' );
|