Version Description
- Added functionality to search for posts to link images to.
- Added Japanese translation.
- Changed the method for generating cache keys. Should provide better support for the_widget() and similar methods.
- Deprecated the method for flushing a single widget instance from the cache.
Download this release
Release Info
Developer | bradyvercher |
Plugin | Simple Image Widget |
Version | 4.2.0 |
Comparing to | |
See all releases |
Code changes from version 4.1.2 to 4.2.0
- assets/css/simple-image-widget.css +127 -0
- assets/js/simple-image-widget.js +138 -9
- includes/class-simple-image-widget-plugin.php +135 -1
- includes/class-simple-image-widget.php +32 -21
- languages/simple-image-widget-ja.mo +0 -0
- languages/simple-image-widget-ja.po +158 -0
- languages/simple-image-widget.pot +84 -27
- readme.txt +8 -1
- simple-image-widget.php +1 -1
assets/css/simple-image-widget.css
CHANGED
@@ -21,6 +21,133 @@
|
|
21 |
max-width: 100%;
|
22 |
}
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
.simple-image-widget-legacy-fields {
|
25 |
margin-bottom: 1em;
|
26 |
padding: 10px;
|
21 |
max-width: 100%;
|
22 |
}
|
23 |
|
24 |
+
|
25 |
+
/* Input Button Group
|
26 |
+
------------------------------------------------------------------------------*/
|
27 |
+
|
28 |
+
.simple-image-widget-input-group {
|
29 |
+
border-spacing: 0;
|
30 |
+
display: block;
|
31 |
+
position: relative;
|
32 |
+
vertical-align: top;
|
33 |
+
width: 100%;
|
34 |
+
}
|
35 |
+
|
36 |
+
.simple-image-widget-input-group .simple-image-widget-input-group-field {
|
37 |
+
border-top-right-radius: 0;
|
38 |
+
border-bottom-right-radius: 0;
|
39 |
+
border-right-width: 0;
|
40 |
+
margin: 0;
|
41 |
+
padding-right: 35px;
|
42 |
+
width: 100%;
|
43 |
+
}
|
44 |
+
|
45 |
+
.simple-image-widget-input-group-button {
|
46 |
+
background: #f7f7f7;
|
47 |
+
border: 1px solid #ddd;
|
48 |
+
border-top-right-radius: 3px;
|
49 |
+
border-bottom-right-radius: 3px;
|
50 |
+
box-shadow: inset 0 1px 0 #fff;
|
51 |
+
box-sizing: border-box;
|
52 |
+
color: #727272;
|
53 |
+
cursor: pointer;
|
54 |
+
display: block;
|
55 |
+
height: auto;
|
56 |
+
margin: 0;
|
57 |
+
padding: 0;
|
58 |
+
position: absolute;
|
59 |
+
top: 0;
|
60 |
+
right: 0;
|
61 |
+
bottom: 0;
|
62 |
+
left: auto;
|
63 |
+
text-align: center;
|
64 |
+
vertical-align: middle;
|
65 |
+
white-space: nowrap;
|
66 |
+
width: 30px;
|
67 |
+
}
|
68 |
+
|
69 |
+
.simple-image-widget-input-group-button:hover {
|
70 |
+
background: #fafafa;
|
71 |
+
border-color: #999;
|
72 |
+
color: #222;
|
73 |
+
}
|
74 |
+
|
75 |
+
.simple-image-widget-input-group-button:active {
|
76 |
+
background: #eee;
|
77 |
+
border-color: #999;
|
78 |
+
color: #333;
|
79 |
+
box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
|
80 |
+
}
|
81 |
+
|
82 |
+
.simple-image-widget-input-group-button:focus,
|
83 |
+
.simple-image-widget-input-group.is-focused .simple-image-widget-input-group-button {
|
84 |
+
border-color: #999;
|
85 |
+
box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, 0.1);
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
+
/* Find Posts Modal
|
90 |
+
------------------------------------------------------------------------------*/
|
91 |
+
|
92 |
+
.simple-image-widget-modal-inside.find-box-inside {
|
93 |
+
bottom: 0;
|
94 |
+
}
|
95 |
+
|
96 |
+
.simple-image-widget-modal-response {
|
97 |
+
position: relative;
|
98 |
+
}
|
99 |
+
|
100 |
+
.simple-image-widget-modal-response table {
|
101 |
+
margin-bottom: 16px;
|
102 |
+
}
|
103 |
+
|
104 |
+
.simple-image-widget-modal-response table tr:nth-child(odd) td {
|
105 |
+
background: #f9f9f9;
|
106 |
+
}
|
107 |
+
|
108 |
+
.simple-image-widget-modal-response table tr:hover td {
|
109 |
+
cursor: pointer;
|
110 |
+
background: #f3f3f3;
|
111 |
+
}
|
112 |
+
|
113 |
+
.simple-image-widget-modal-search input {
|
114 |
+
float: left;
|
115 |
+
}
|
116 |
+
|
117 |
+
.simple-image-widget-modal-search-field {
|
118 |
+
height: 28px;
|
119 |
+
margin: 0 4px 0 0;
|
120 |
+
width: 140px;
|
121 |
+
}
|
122 |
+
|
123 |
+
.simple-image-widget-modal-close {
|
124 |
+
color: #666;
|
125 |
+
cursor: pointer;
|
126 |
+
height: 36px;
|
127 |
+
position: absolute;
|
128 |
+
top: 0;
|
129 |
+
right: 0;
|
130 |
+
text-align: center;
|
131 |
+
width: 36px;
|
132 |
+
}
|
133 |
+
|
134 |
+
.simple-image-widget-modal-close:hover {
|
135 |
+
color: #2ea2cc;
|
136 |
+
}
|
137 |
+
|
138 |
+
.simple-image-widget-modal-close:before {
|
139 |
+
content: '\f158';
|
140 |
+
font: normal 20px/36px 'dashicons';
|
141 |
+
speak: none;
|
142 |
+
vertical-align: top;
|
143 |
+
-webkit-font-smoothing: antialiased;
|
144 |
+
-moz-osx-font-smoothing: grayscale;
|
145 |
+
}
|
146 |
+
|
147 |
+
|
148 |
+
/* Legacy Fields
|
149 |
+
------------------------------------------------------------------------------*/
|
150 |
+
|
151 |
.simple-image-widget-legacy-fields {
|
152 |
margin-bottom: 1em;
|
153 |
padding: 10px;
|
assets/js/simple-image-widget.js
CHANGED
@@ -1,14 +1,15 @@
|
|
1 |
-
/*global _:false, ajaxurl:false, wp:false */
|
2 |
|
3 |
window.SimpleImageWidget = window.SimpleImageWidget || {};
|
4 |
|
5 |
-
(function( window, $, _, wp, undefined ) {
|
6 |
'use strict';
|
7 |
|
8 |
-
var
|
|
|
9 |
Attachment = wp.media.model.Attachment,
|
10 |
-
|
11 |
-
|
12 |
|
13 |
// Link any localized strings.
|
14 |
l10n = SimpleImageWidget.l10n = SimpleImageWidget.l10n || {};
|
@@ -168,10 +169,121 @@ window.SimpleImageWidget = window.SimpleImageWidget || {};
|
|
168 |
}
|
169 |
});
|
170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
// Document ready.
|
172 |
-
|
173 |
-
var
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
// Open the media frame when the choose button or image are clicked.
|
176 |
$body.on( 'click', '.simple-image-widget-control-choose, .simple-image-widget-form img', function( e ) {
|
177 |
e.preventDefault();
|
@@ -226,5 +338,22 @@ window.SimpleImageWidget = window.SimpleImageWidget || {};
|
|
226 |
}
|
227 |
});
|
228 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
});
|
230 |
-
|
|
1 |
+
/*global _:false, ajaxurl:false, Backbone:false, wp:false */
|
2 |
|
3 |
window.SimpleImageWidget = window.SimpleImageWidget || {};
|
4 |
|
5 |
+
(function( window, $, _, Backbone, wp, undefined ) {
|
6 |
'use strict';
|
7 |
|
8 |
+
var Control, l10n,
|
9 |
+
SimpleImageWidget = window.SimpleImageWidget,
|
10 |
Attachment = wp.media.model.Attachment,
|
11 |
+
finder = { view: {} },
|
12 |
+
frames = [];
|
13 |
|
14 |
// Link any localized strings.
|
15 |
l10n = SimpleImageWidget.l10n = SimpleImageWidget.l10n || {};
|
169 |
}
|
170 |
});
|
171 |
|
172 |
+
finder.view.Page = wp.Backbone.View.extend({
|
173 |
+
events: {
|
174 |
+
'click .simple-image-widget-find-posts-button' : 'openModal'
|
175 |
+
},
|
176 |
+
|
177 |
+
initialize: function( options ) {
|
178 |
+
this.modal = options.modal;
|
179 |
+
this.render();
|
180 |
+
},
|
181 |
+
|
182 |
+
render: function() {
|
183 |
+
this.$el.append( this.modal.$el );
|
184 |
+
return this;
|
185 |
+
},
|
186 |
+
|
187 |
+
openModal: function( e ) {
|
188 |
+
var $target = $( e.target).closest( '.simple-image-widget-input-group' ).find( 'input[type="text"]' );
|
189 |
+
e.preventDefault();
|
190 |
+
this.modal.open( $target );
|
191 |
+
}
|
192 |
+
});
|
193 |
+
|
194 |
+
finder.view.Modal = wp.Backbone.View.extend({
|
195 |
+
tagName: 'div',
|
196 |
+
className: 'find-box',
|
197 |
+
template: wp.template( 'simple-image-widget-modal' ),
|
198 |
+
|
199 |
+
events : {
|
200 |
+
'click .simple-image-widget-modal-search-button': 'findPosts',
|
201 |
+
'keypress .simple-image-widget-modal-search-field': 'routeKey',
|
202 |
+
'keyup .simple-image-widget-modal-search-field': 'routeKey',
|
203 |
+
'click tr': 'select',
|
204 |
+
'click .js-close': 'close'
|
205 |
+
},
|
206 |
+
|
207 |
+
initialize: function( options ) {
|
208 |
+
this.$pageWrapper = options.pageWrapper;
|
209 |
+
this.postTypes = options.postTypes;
|
210 |
+
this.$overlay = false;
|
211 |
+
this.$target = $();
|
212 |
+
this.render();
|
213 |
+
},
|
214 |
+
|
215 |
+
render: function() {
|
216 |
+
this.$el.hide().html( this.template() );
|
217 |
+
this.$field = this.$el.find( '.simple-image-widget-modal-search-field' );
|
218 |
+
this.$overlay = $( '.ui-find-overlay' );
|
219 |
+
this.$response = this.$el.find( '.simple-image-widget-modal-response' );
|
220 |
+
this.$spinner = this.$el.find( '.simple-image-widget-modal-search .spinner' );
|
221 |
+
return this;
|
222 |
+
},
|
223 |
+
|
224 |
+
close: function() {
|
225 |
+
this.$overlay.hide();
|
226 |
+
this.$el.hide();
|
227 |
+
this.$target = $();
|
228 |
+
},
|
229 |
+
|
230 |
+
findPosts: function() {
|
231 |
+
var self = this;
|
232 |
+
self.$spinner.show();
|
233 |
+
|
234 |
+
wp.ajax.post( 'simple_image_widget_find_posts', {
|
235 |
+
s: self.$field.val(),
|
236 |
+
post_types: this.postTypes,
|
237 |
+
nonce: $( '#siw-find-posts-ajax-nonce' ).val()
|
238 |
+
}).always(function() {
|
239 |
+
self.$spinner.hide();
|
240 |
+
}).done(function( response ) {
|
241 |
+
self.$response.html( response );
|
242 |
+
}).fail(function() {
|
243 |
+
self.$response.text( l10n.responseError );
|
244 |
+
});
|
245 |
+
},
|
246 |
+
|
247 |
+
open: function( $target ) {
|
248 |
+
this.$target = $target;
|
249 |
+
this.$response.html( '' );
|
250 |
+
this.$el.show();
|
251 |
+
this.$field.focus();
|
252 |
+
|
253 |
+
if ( ! this.$overlay.length ) {
|
254 |
+
this.$pageWrapper.append( '<div class="ui-find-overlay"></div>' );
|
255 |
+
this.$overlay = $( '.ui-find-overlay' );
|
256 |
+
}
|
257 |
+
|
258 |
+
this.$overlay.show();
|
259 |
+
this.findPosts();
|
260 |
+
},
|
261 |
+
|
262 |
+
routeKey: function( e ) {
|
263 |
+
if ( e.which && 13 === e.which ) {
|
264 |
+
this.findPosts();
|
265 |
+
} else if ( e.which && 27 === e.which ) {
|
266 |
+
this.close();
|
267 |
+
}
|
268 |
+
},
|
269 |
+
|
270 |
+
select: function( e ) {
|
271 |
+
var value = $( e.target ).closest( 'tr' ).find( 'input' ).val();
|
272 |
+
this.$target.val( value );
|
273 |
+
this.close();
|
274 |
+
}
|
275 |
+
});
|
276 |
+
|
277 |
// Document ready.
|
278 |
+
$( document ).ready(function() {
|
279 |
+
var modal,
|
280 |
+
$body = $( 'body' ),
|
281 |
+
$page = $( '.wp-full-overlay' );
|
282 |
+
|
283 |
+
if ( $page.length < 1 ) {
|
284 |
+
$page = $body;
|
285 |
+
}
|
286 |
+
|
287 |
// Open the media frame when the choose button or image are clicked.
|
288 |
$body.on( 'click', '.simple-image-widget-control-choose, .simple-image-widget-form img', function( e ) {
|
289 |
e.preventDefault();
|
338 |
}
|
339 |
});
|
340 |
});
|
341 |
+
|
342 |
+
$body.on( 'focus', '.simple-image-widget-input-group-field', function() {
|
343 |
+
$( this ).parent().addClass( 'is-focused' );
|
344 |
+
}).on( 'blur', '.simple-image-widget-input-group-field', function() {
|
345 |
+
$( this ).parent().removeClass( 'is-focused' );
|
346 |
+
});
|
347 |
+
|
348 |
+
modal = new finder.view.Modal({
|
349 |
+
postTypes: ['any'],
|
350 |
+
pageWrapper: $page
|
351 |
+
});
|
352 |
+
|
353 |
+
new finder.view.Page({
|
354 |
+
el: $page.get( 0 ),
|
355 |
+
modal: modal
|
356 |
+
});
|
357 |
});
|
358 |
+
|
359 |
+
})( this, jQuery, _, Backbone, wp );
|
includes/class-simple-image-widget-plugin.php
CHANGED
@@ -34,6 +34,7 @@ class Simple_Image_Widget_Plugin {
|
|
34 |
add_action( 'init', array( $this, 'register_assets' ) );
|
35 |
add_action( 'sidebar_admin_setup', array( $this, 'enqueue_admin_assets' ) );
|
36 |
add_filter( 'screen_settings', array( $this, 'widgets_screen_settings' ), 10, 2 );
|
|
|
37 |
add_action( 'wp_ajax_simple_image_widget_preferences', array( $this, 'ajax_save_user_preferences' ) );
|
38 |
}
|
39 |
|
@@ -76,7 +77,7 @@ class Simple_Image_Widget_Plugin {
|
|
76 |
wp_register_script(
|
77 |
'simple-image-widget-admin',
|
78 |
dirname( plugin_dir_url( __FILE__ ) ) . '/assets/js/simple-image-widget.js',
|
79 |
-
array( 'media-upload', 'media-views' )
|
80 |
);
|
81 |
|
82 |
wp_localize_script(
|
@@ -88,10 +89,14 @@ class Simple_Image_Widget_Plugin {
|
|
88 |
'frameUpdateText' => __( 'Update Attachment', 'simple-image-widget' ),
|
89 |
'fullSizeLabel' => __( 'Full Size', 'simple-image-widget' ),
|
90 |
'imageSizeNames' => self::get_image_size_names(),
|
|
|
91 |
),
|
92 |
'screenOptionsNonce' => wp_create_nonce( 'save-siw-preferences' ),
|
93 |
)
|
94 |
);
|
|
|
|
|
|
|
95 |
}
|
96 |
|
97 |
/**
|
@@ -152,6 +157,7 @@ class Simple_Image_Widget_Plugin {
|
|
152 |
public function enqueue_admin_assets() {
|
153 |
wp_enqueue_media();
|
154 |
wp_enqueue_script( 'simple-image-widget-admin' );
|
|
|
155 |
wp_enqueue_style( 'simple-image-widget-admin' );
|
156 |
}
|
157 |
|
@@ -206,6 +212,49 @@ class Simple_Image_Widget_Plugin {
|
|
206 |
return (array) apply_filters( 'simple_image_widget_hidden_fields', $hidden_fields );
|
207 |
}
|
208 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
/**
|
210 |
* AJAX callback to save the user's hidden fields.
|
211 |
*
|
@@ -227,4 +276,89 @@ class Simple_Image_Widget_Plugin {
|
|
227 |
|
228 |
wp_send_json_success( $data );
|
229 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
}
|
34 |
add_action( 'init', array( $this, 'register_assets' ) );
|
35 |
add_action( 'sidebar_admin_setup', array( $this, 'enqueue_admin_assets' ) );
|
36 |
add_filter( 'screen_settings', array( $this, 'widgets_screen_settings' ), 10, 2 );
|
37 |
+
add_action( 'wp_ajax_simple_image_widget_find_posts', array( $this, 'ajax_find_posts' ) );
|
38 |
add_action( 'wp_ajax_simple_image_widget_preferences', array( $this, 'ajax_save_user_preferences' ) );
|
39 |
}
|
40 |
|
77 |
wp_register_script(
|
78 |
'simple-image-widget-admin',
|
79 |
dirname( plugin_dir_url( __FILE__ ) ) . '/assets/js/simple-image-widget.js',
|
80 |
+
array( 'media-upload', 'media-views', 'wp-backbone', 'wp-util' )
|
81 |
);
|
82 |
|
83 |
wp_localize_script(
|
89 |
'frameUpdateText' => __( 'Update Attachment', 'simple-image-widget' ),
|
90 |
'fullSizeLabel' => __( 'Full Size', 'simple-image-widget' ),
|
91 |
'imageSizeNames' => self::get_image_size_names(),
|
92 |
+
'responseError' => __( 'An error has occurred. Please reload the page and try again.', 'simple-image-widget' ),
|
93 |
),
|
94 |
'screenOptionsNonce' => wp_create_nonce( 'save-siw-preferences' ),
|
95 |
)
|
96 |
);
|
97 |
+
|
98 |
+
add_action( 'customize_controls_print_footer_scripts', array( $this, 'print_find_posts_templates' ) );
|
99 |
+
add_action( 'admin_footer', array( $this, 'print_find_posts_templates' ) );
|
100 |
}
|
101 |
|
102 |
/**
|
157 |
public function enqueue_admin_assets() {
|
158 |
wp_enqueue_media();
|
159 |
wp_enqueue_script( 'simple-image-widget-admin' );
|
160 |
+
wp_enqueue_script( 'simple-image-widget-find-posts' );
|
161 |
wp_enqueue_style( 'simple-image-widget-admin' );
|
162 |
}
|
163 |
|
212 |
return (array) apply_filters( 'simple_image_widget_hidden_fields', $hidden_fields );
|
213 |
}
|
214 |
|
215 |
+
/**
|
216 |
+
* Ajax handler for finding posts.
|
217 |
+
*
|
218 |
+
* @since 4.2.0
|
219 |
+
*
|
220 |
+
* @see wp_ajax_find_posts()
|
221 |
+
*/
|
222 |
+
public function ajax_find_posts() {
|
223 |
+
check_ajax_referer( 'siw-find-posts', 'nonce' );
|
224 |
+
|
225 |
+
$post_types = array();
|
226 |
+
|
227 |
+
if ( ! empty( $_POST['post_types'] ) ) {
|
228 |
+
foreach ( $_POST['post_types'] as $post_type ) {
|
229 |
+
$post_types[ $post_type ] = get_post_type_object( $post_type );
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
if ( empty( $post_types ) ) {
|
234 |
+
$post_types['post'] = get_post_type_object( 'post' );
|
235 |
+
}
|
236 |
+
|
237 |
+
$args = array(
|
238 |
+
'post_type' => array_keys( $post_types ),
|
239 |
+
'post_status' => 'any',
|
240 |
+
'posts_per_page' => 50,
|
241 |
+
);
|
242 |
+
|
243 |
+
if ( ! empty( $_POST['s'] ) ) {
|
244 |
+
$args['s'] = wp_unslash( $_POST['s'] );
|
245 |
+
}
|
246 |
+
|
247 |
+
$posts = get_posts( $args );
|
248 |
+
|
249 |
+
if ( ! $posts ) {
|
250 |
+
wp_send_json_error( __( 'No items found.', 'simple-image-widget' ) );
|
251 |
+
}
|
252 |
+
|
253 |
+
$html = $this->get_found_posts_html( $posts );
|
254 |
+
|
255 |
+
wp_send_json_success( $html );
|
256 |
+
}
|
257 |
+
|
258 |
/**
|
259 |
* AJAX callback to save the user's hidden fields.
|
260 |
*
|
276 |
|
277 |
wp_send_json_success( $data );
|
278 |
}
|
279 |
+
|
280 |
+
/**
|
281 |
+
* Retrieve HTML for displaying a list of posts.
|
282 |
+
*
|
283 |
+
* @since 4.2.0
|
284 |
+
*
|
285 |
+
* @param array $posts Array of post objects.
|
286 |
+
* @return string
|
287 |
+
*/
|
288 |
+
protected function get_found_posts_html( $posts ) {
|
289 |
+
$html = sprintf(
|
290 |
+
'<table class="widefat"><thead><tr><th>%1$s</th><th class="no-break">%2$s</th><th class="no-break">%3$s</th><th class="no-break">%4$s</th></tr></thead><tbody>',
|
291 |
+
__( 'Title', 'simple-image-widget' ),
|
292 |
+
__( 'Type', 'simple-image-widget' ),
|
293 |
+
__( 'Date', 'simple-image-widget' ),
|
294 |
+
__( 'Status', 'simple-image-widget' )
|
295 |
+
);
|
296 |
+
|
297 |
+
foreach ( $posts as $post ) {
|
298 |
+
$title = trim( $post->post_title ) ? $post->post_title : __( '(no title)' );
|
299 |
+
$post_link = 'attachment' == get_post_type( $post->ID ) ? wp_get_attachment_url( $post->ID ) : get_permalink( $post->ID );
|
300 |
+
|
301 |
+
switch ( $post->post_status ) {
|
302 |
+
case 'publish' :
|
303 |
+
case 'private' :
|
304 |
+
$status = __( 'Published', 'simple-image-widget' );
|
305 |
+
break;
|
306 |
+
case 'future' :
|
307 |
+
$status = __( 'Scheduled', 'simple-image-widget' );
|
308 |
+
break;
|
309 |
+
case 'pending' :
|
310 |
+
$status = __( 'Pending Review', 'simple-image-widget' );
|
311 |
+
break;
|
312 |
+
case 'draft' :
|
313 |
+
$status = __( 'Draft', 'simple-image-widget' );
|
314 |
+
break;
|
315 |
+
}
|
316 |
+
|
317 |
+
if ( '0000-00-00 00:00:00' == $post->post_date ) {
|
318 |
+
$time = '';
|
319 |
+
} else {
|
320 |
+
/* translators: date format in table columns, see http://php.net/date */
|
321 |
+
$time = mysql2date( __( 'Y/m/d' ), $post->post_date );
|
322 |
+
}
|
323 |
+
|
324 |
+
$html .= sprintf(
|
325 |
+
'<tr class="found-posts"><td>%1$s <input type="hidden" value="%2$s"></td><td class="no-break">%3$s</td><td class="no-break">%4$s</td><td class="no-break">%5$s</td></tr>',
|
326 |
+
esc_html( $title ),
|
327 |
+
esc_url( apply_filters( 'simple_image_widget_find_posts_post_link', $post_link ), $post->ID ),
|
328 |
+
esc_html( get_post_type_object( $post->post_type )->labels->singular_name ),
|
329 |
+
esc_html( $time ),
|
330 |
+
esc_html( $status )
|
331 |
+
);
|
332 |
+
}
|
333 |
+
|
334 |
+
$html .= '</tbody></table>';
|
335 |
+
|
336 |
+
return $html;
|
337 |
+
}
|
338 |
+
|
339 |
+
/**
|
340 |
+
* Print JavaScript templates in the Customizer footer.
|
341 |
+
*
|
342 |
+
* @since 4.2.0
|
343 |
+
*/
|
344 |
+
public function print_find_posts_templates() {
|
345 |
+
?>
|
346 |
+
<script type="text/html" id="tmpl-simple-image-widget-modal">
|
347 |
+
<div class="simple-image-widget-modal-head find-box-head">
|
348 |
+
<?php _e( 'Find Post', 'simple-image-widget' ); ?>
|
349 |
+
<div class="simple-image-widget-modal-close js-close"></div>
|
350 |
+
</div>
|
351 |
+
<div class="simple-image-widget-modal-inside find-box-inside">
|
352 |
+
<div class="simple-image-widget-modal-search find-box-search">
|
353 |
+
<?php wp_nonce_field( 'siw-find-posts', 'siw-find-posts-ajax-nonce', false ); ?>
|
354 |
+
<input type="text" name="s" value="" class="simple-image-widget-modal-search-field">
|
355 |
+
<span class="spinner"></span>
|
356 |
+
<input type="button" value="<?php esc_attr_e( 'Search', 'simple-image-widget' ); ?>" class="button simple-image-widget-modal-search-button" />
|
357 |
+
<div class="clear"></div>
|
358 |
+
</div>
|
359 |
+
<div class="simple-image-widget-modal-response"></div>
|
360 |
+
</div>
|
361 |
+
</script>
|
362 |
+
<?php
|
363 |
+
}
|
364 |
}
|
includes/class-simple-image-widget.php
CHANGED
@@ -72,9 +72,11 @@ class Simple_Image_Widget extends WP_Widget {
|
|
72 |
* @param array $instance The widget instance settings.
|
73 |
*/
|
74 |
public function widget( $args, $instance ) {
|
75 |
-
$cache
|
76 |
-
|
77 |
-
|
|
|
|
|
78 |
return;
|
79 |
}
|
80 |
|
@@ -128,7 +130,7 @@ class Simple_Image_Widget extends WP_Widget {
|
|
128 |
echo $output;
|
129 |
|
130 |
if ( ! $this->is_preview() ) {
|
131 |
-
$cache[ $
|
132 |
wp_cache_set( 'simple_image_widget', array_filter( $cache ), 'widget' );
|
133 |
}
|
134 |
}
|
@@ -298,7 +300,10 @@ class Simple_Image_Widget extends WP_Widget {
|
|
298 |
?>
|
299 |
<p class="<?php echo esc_attr( $this->siw_field_class( 'link' ) ); ?>">
|
300 |
<label for="<?php echo esc_attr( $this->get_field_id( 'link' ) ); ?>"><?php _e( 'Link:', 'simple-image-widget' ); ?></label>
|
301 |
-
<
|
|
|
|
|
|
|
302 |
</p>
|
303 |
<p class="<?php echo esc_attr( $this->siw_field_class( 'new_window' ) ); ?>" style="margin-top: -0.75em; padding-left: 2px">
|
304 |
<label for="<?php echo esc_attr( $this->get_field_id( 'new_window' ) ); ?>">
|
@@ -422,7 +427,7 @@ class Simple_Image_Widget extends WP_Widget {
|
|
422 |
}
|
423 |
}
|
424 |
|
425 |
-
$this->
|
426 |
|
427 |
return $instance;
|
428 |
}
|
@@ -473,21 +478,6 @@ class Simple_Image_Widget extends WP_Widget {
|
|
473 |
return $sizes;
|
474 |
}
|
475 |
|
476 |
-
/**
|
477 |
-
* Remove a single image widget from the cache.
|
478 |
-
*
|
479 |
-
* @since 3.0.0
|
480 |
-
*/
|
481 |
-
public function flush_widget_cache() {
|
482 |
-
$cache = (array) wp_cache_get( 'simple_image_widget', 'widget' );
|
483 |
-
|
484 |
-
if ( isset( $cache[ $this->id ] ) ) {
|
485 |
-
unset( $cache[ $this->id ] );
|
486 |
-
}
|
487 |
-
|
488 |
-
wp_cache_set( 'simple_image_widget', array_filter( $cache ), 'widget' );
|
489 |
-
}
|
490 |
-
|
491 |
/**
|
492 |
* Flush the cache for all image widgets.
|
493 |
*
|
@@ -558,4 +548,25 @@ class Simple_Image_Widget extends WP_Widget {
|
|
558 |
|
559 |
return implode( ' ', $classes );
|
560 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
561 |
}
|
72 |
* @param array $instance The widget instance settings.
|
73 |
*/
|
74 |
public function widget( $args, $instance ) {
|
75 |
+
$cache = (array) wp_cache_get( 'simple_image_widget', 'widget' );
|
76 |
+
$cache_id = $this->siw_get_cache_key( $args, $instance );
|
77 |
+
|
78 |
+
if ( ! $this->is_preview() && isset( $cache[ $cache_id ] ) ) {
|
79 |
+
echo $cache[ $cache_id ];
|
80 |
return;
|
81 |
}
|
82 |
|
130 |
echo $output;
|
131 |
|
132 |
if ( ! $this->is_preview() ) {
|
133 |
+
$cache[ $cache_id ] = $output;
|
134 |
wp_cache_set( 'simple_image_widget', array_filter( $cache ), 'widget' );
|
135 |
}
|
136 |
}
|
300 |
?>
|
301 |
<p class="<?php echo esc_attr( $this->siw_field_class( 'link' ) ); ?>">
|
302 |
<label for="<?php echo esc_attr( $this->get_field_id( 'link' ) ); ?>"><?php _e( 'Link:', 'simple-image-widget' ); ?></label>
|
303 |
+
<span class="simple-image-widget-input-group">
|
304 |
+
<input type="text" name="<?php echo esc_attr( $this->get_field_name( 'link' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'link' ) ); ?>" value="<?php echo esc_url( $instance['link'] ); ?>" class="simple-image-widget-input-group-field">
|
305 |
+
<button class="simple-image-widget-find-posts-button simple-image-widget-input-group-button dashicons dashicons-search"></button>
|
306 |
+
</span>
|
307 |
</p>
|
308 |
<p class="<?php echo esc_attr( $this->siw_field_class( 'new_window' ) ); ?>" style="margin-top: -0.75em; padding-left: 2px">
|
309 |
<label for="<?php echo esc_attr( $this->get_field_id( 'new_window' ) ); ?>">
|
427 |
}
|
428 |
}
|
429 |
|
430 |
+
$this->flush_group_cache();
|
431 |
|
432 |
return $instance;
|
433 |
}
|
478 |
return $sizes;
|
479 |
}
|
480 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
481 |
/**
|
482 |
* Flush the cache for all image widgets.
|
483 |
*
|
548 |
|
549 |
return implode( ' ', $classes );
|
550 |
}
|
551 |
+
|
552 |
+
/**
|
553 |
+
* Retrieve a cache key based on a hash of passed parameters.
|
554 |
+
*
|
555 |
+
* @since 4.2.0
|
556 |
+
*
|
557 |
+
* @return string
|
558 |
+
*/
|
559 |
+
protected function siw_get_cache_key() {
|
560 |
+
$data = array_reduce( func_get_args(), 'array_merge', array() );
|
561 |
+
ksort( $data );
|
562 |
+
return 'siw_' . md5( json_encode( $data ) );
|
563 |
+
}
|
564 |
+
|
565 |
+
/**
|
566 |
+
* Remove a single image widget from the cache.
|
567 |
+
*
|
568 |
+
* @since 3.0.0
|
569 |
+
* @deprecated 4.2.0
|
570 |
+
*/
|
571 |
+
public function flush_widget_cache() {}
|
572 |
}
|
languages/simple-image-widget-ja.mo
ADDED
Binary file
|
languages/simple-image-widget-ja.po
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (C) 2014 Blazer Six
|
2 |
+
# This file is distributed under the GPL-2.0+.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"Project-Id-Version: Simple Image Widget 4.1.2\n"
|
6 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/simple-image-"
|
7 |
+
"widget\n"
|
8 |
+
"POT-Creation-Date: 2014-06-13 21:26:00+00:00\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: 2015-01-14 17:55+0900\n"
|
13 |
+
"Last-Translator: Fumito MIZUNO <ounziw@gmail.com>\n"
|
14 |
+
"Language-Team: Fumito MIZUNO <ounziw@gmail.com>\n"
|
15 |
+
"X-Generator: Poedit 1.5.5\n"
|
16 |
+
"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
|
17 |
+
"_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
|
18 |
+
"esc_html_x:1,2c\n"
|
19 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
20 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
21 |
+
"X-Poedit-Basepath: ../\n"
|
22 |
+
"X-Textdomain-Support: yes\n"
|
23 |
+
"Language: ja\n"
|
24 |
+
"X-Poedit-SearchPath-0: .\n"
|
25 |
+
|
26 |
+
#: includes/class-simple-image-widget-legacy.php:108
|
27 |
+
msgid "These fields are here to maintain your data from an earlier version."
|
28 |
+
msgstr "これらのフィールドは、古いバージョンのデータを保持する為のものです。"
|
29 |
+
|
30 |
+
#: includes/class-simple-image-widget-legacy.php:111
|
31 |
+
msgid ""
|
32 |
+
"Select an image, then clear these values, and they will disappear when you "
|
33 |
+
"save the widget."
|
34 |
+
msgstr ""
|
35 |
+
"画像を選択してクリアすると、ウィジェットを保存した時に表示されなくなります。"
|
36 |
+
|
37 |
+
#: includes/class-simple-image-widget-legacy.php:116
|
38 |
+
msgid "Image URL:"
|
39 |
+
msgstr "画像URL: "
|
40 |
+
|
41 |
+
#: includes/class-simple-image-widget-legacy.php:120
|
42 |
+
msgid "Alternate Text:"
|
43 |
+
msgstr "代替テキスト: "
|
44 |
+
|
45 |
+
#: includes/class-simple-image-widget-plugin.php:87
|
46 |
+
msgid "Choose an Attachment"
|
47 |
+
msgstr "添付ファイルを選択"
|
48 |
+
|
49 |
+
#: includes/class-simple-image-widget-plugin.php:88
|
50 |
+
msgid "Update Attachment"
|
51 |
+
msgstr "添付ファイルを更新"
|
52 |
+
|
53 |
+
#: includes/class-simple-image-widget-plugin.php:89
|
54 |
+
#: includes/class-simple-image-widget-plugin.php:179
|
55 |
+
#: includes/class-simple-image-widget.php:457
|
56 |
+
msgid "Full Size"
|
57 |
+
msgstr "フルサイズ"
|
58 |
+
|
59 |
+
#. Plugin Name of the plugin/theme
|
60 |
+
msgid "Simple Image Widget"
|
61 |
+
msgstr "Simple Image Widget"
|
62 |
+
|
63 |
+
#: includes/class-simple-image-widget-plugin.php:115
|
64 |
+
msgid "Image Size"
|
65 |
+
msgstr "画像サイズ"
|
66 |
+
|
67 |
+
#: includes/class-simple-image-widget-plugin.php:116
|
68 |
+
msgid "Link"
|
69 |
+
msgstr "リンク"
|
70 |
+
|
71 |
+
#: includes/class-simple-image-widget-plugin.php:117
|
72 |
+
msgid "Link Classes"
|
73 |
+
msgstr "リンクのクラス"
|
74 |
+
|
75 |
+
#: includes/class-simple-image-widget-plugin.php:118
|
76 |
+
msgid "Link Text"
|
77 |
+
msgstr "リンクのテキスト"
|
78 |
+
|
79 |
+
#: includes/class-simple-image-widget-plugin.php:119
|
80 |
+
msgid "New Window"
|
81 |
+
msgstr "新規ウィンドウ"
|
82 |
+
|
83 |
+
#: includes/class-simple-image-widget-plugin.php:120
|
84 |
+
msgid "Text"
|
85 |
+
msgstr "テキスト"
|
86 |
+
|
87 |
+
#: includes/class-simple-image-widget-plugin.php:176
|
88 |
+
msgid "Thumbnail"
|
89 |
+
msgstr "サムネイル"
|
90 |
+
|
91 |
+
#: includes/class-simple-image-widget-plugin.php:177
|
92 |
+
msgid "Medium"
|
93 |
+
msgstr "中"
|
94 |
+
|
95 |
+
#: includes/class-simple-image-widget-plugin.php:178
|
96 |
+
msgid "Large"
|
97 |
+
msgstr "大"
|
98 |
+
|
99 |
+
#: includes/class-simple-image-widget.php:43
|
100 |
+
msgid "Image"
|
101 |
+
msgstr "画像"
|
102 |
+
|
103 |
+
#: includes/class-simple-image-widget.php:49
|
104 |
+
msgid "An image from your Media Library."
|
105 |
+
msgstr "メディアライブラリの画像"
|
106 |
+
|
107 |
+
#: includes/class-simple-image-widget.php:252
|
108 |
+
msgid "Title:"
|
109 |
+
msgstr "タイトル: "
|
110 |
+
|
111 |
+
#: includes/class-simple-image-widget.php:258
|
112 |
+
#: includes/class-simple-image-widget.php:268
|
113 |
+
msgid "Choose an Image"
|
114 |
+
msgstr "画像を選択"
|
115 |
+
|
116 |
+
#: includes/class-simple-image-widget.php:259
|
117 |
+
msgid "Update Image"
|
118 |
+
msgstr "画像を更新"
|
119 |
+
|
120 |
+
#: includes/class-simple-image-widget.php:280
|
121 |
+
msgid "Size:"
|
122 |
+
msgstr "サイズ: "
|
123 |
+
|
124 |
+
#: includes/class-simple-image-widget.php:300
|
125 |
+
msgid "Link:"
|
126 |
+
msgstr "リンク: "
|
127 |
+
|
128 |
+
#: includes/class-simple-image-widget.php:306
|
129 |
+
msgid "Open in new window?"
|
130 |
+
msgstr "新規ウィンドウで開く"
|
131 |
+
|
132 |
+
#: includes/class-simple-image-widget.php:315
|
133 |
+
msgid "Link Classes:"
|
134 |
+
msgstr "リンクのクラス: "
|
135 |
+
|
136 |
+
#: includes/class-simple-image-widget.php:324
|
137 |
+
msgid "Link Text:"
|
138 |
+
msgstr "リンクのテキスト: "
|
139 |
+
|
140 |
+
#: includes/class-simple-image-widget.php:333
|
141 |
+
msgid "Text:"
|
142 |
+
msgstr "テキスト: "
|
143 |
+
|
144 |
+
#. Plugin URI of the plugin/theme
|
145 |
+
msgid "https://wordpress.org/extend/plugins/simple-image-widget/"
|
146 |
+
msgstr "https://wordpress.org/extend/plugins/simple-image-widget/"
|
147 |
+
|
148 |
+
#. Description of the plugin/theme
|
149 |
+
msgid "A simple image widget utilizing the new WordPress media manager."
|
150 |
+
msgstr "WordPress のメディアを使用した、シンプルな画像表示ウィジェット"
|
151 |
+
|
152 |
+
#. Author of the plugin/theme
|
153 |
+
msgid "Blazer Six"
|
154 |
+
msgstr "Blazer Six"
|
155 |
+
|
156 |
+
#. Author URI of the plugin/theme
|
157 |
+
msgid "http://www.blazersix.com/"
|
158 |
+
msgstr "http://www.blazersix.com/"
|
languages/simple-image-widget.pot
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
# Copyright (C)
|
2 |
# This file is distributed under the GPL-2.0+.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Simple Image Widget 4.
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"http://wordpress.org/support/plugin/simple-image-widget\n"
|
8 |
"POT-Creation-Date: 2014-06-13 21:26:00+00:00\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:
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15 |
"X-Generator: grunt-wp-i18n 0.4.8\n"
|
@@ -43,60 +43,117 @@ msgstr ""
|
|
43 |
msgid "Alternate Text:"
|
44 |
msgstr ""
|
45 |
|
46 |
-
#: includes/class-simple-image-widget-plugin.php:
|
47 |
msgid "Choose an Attachment"
|
48 |
msgstr ""
|
49 |
|
50 |
-
#: includes/class-simple-image-widget-plugin.php:
|
51 |
msgid "Update Attachment"
|
52 |
msgstr ""
|
53 |
|
54 |
-
#: includes/class-simple-image-widget-plugin.php:
|
55 |
-
#: includes/class-simple-image-widget-plugin.php:
|
56 |
-
#: includes/class-simple-image-widget.php:
|
57 |
msgid "Full Size"
|
58 |
msgstr ""
|
59 |
|
|
|
|
|
|
|
|
|
60 |
#. Plugin Name of the plugin/theme
|
61 |
msgid "Simple Image Widget"
|
62 |
msgstr ""
|
63 |
|
64 |
-
#: includes/class-simple-image-widget-plugin.php:
|
65 |
msgid "Image Size"
|
66 |
msgstr ""
|
67 |
|
68 |
-
#: includes/class-simple-image-widget-plugin.php:
|
69 |
msgid "Link"
|
70 |
msgstr ""
|
71 |
|
72 |
-
#: includes/class-simple-image-widget-plugin.php:
|
73 |
msgid "Link Classes"
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: includes/class-simple-image-widget-plugin.php:
|
77 |
msgid "Link Text"
|
78 |
msgstr ""
|
79 |
|
80 |
-
#: includes/class-simple-image-widget-plugin.php:
|
81 |
msgid "New Window"
|
82 |
msgstr ""
|
83 |
|
84 |
-
#: includes/class-simple-image-widget-plugin.php:
|
85 |
msgid "Text"
|
86 |
msgstr ""
|
87 |
|
88 |
-
#: includes/class-simple-image-widget-plugin.php:
|
89 |
msgid "Thumbnail"
|
90 |
msgstr ""
|
91 |
|
92 |
-
#: includes/class-simple-image-widget-plugin.php:
|
93 |
msgid "Medium"
|
94 |
msgstr ""
|
95 |
|
96 |
-
#: includes/class-simple-image-widget-plugin.php:
|
97 |
msgid "Large"
|
98 |
msgstr ""
|
99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
#: includes/class-simple-image-widget.php:43
|
101 |
msgid "Image"
|
102 |
msgstr ""
|
@@ -105,40 +162,40 @@ msgstr ""
|
|
105 |
msgid "An image from your Media Library."
|
106 |
msgstr ""
|
107 |
|
108 |
-
#: includes/class-simple-image-widget.php:
|
109 |
msgid "Title:"
|
110 |
msgstr ""
|
111 |
|
112 |
-
#: includes/class-simple-image-widget.php:
|
113 |
-
#: includes/class-simple-image-widget.php:
|
114 |
msgid "Choose an Image"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: includes/class-simple-image-widget.php:
|
118 |
msgid "Update Image"
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: includes/class-simple-image-widget.php:
|
122 |
msgid "Size:"
|
123 |
msgstr ""
|
124 |
|
125 |
-
#: includes/class-simple-image-widget.php:
|
126 |
msgid "Link:"
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: includes/class-simple-image-widget.php:
|
130 |
msgid "Open in new window?"
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: includes/class-simple-image-widget.php:
|
134 |
msgid "Link Classes:"
|
135 |
msgstr ""
|
136 |
|
137 |
-
#: includes/class-simple-image-widget.php:
|
138 |
msgid "Link Text:"
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: includes/class-simple-image-widget.php:
|
142 |
msgid "Text:"
|
143 |
msgstr ""
|
144 |
|
1 |
+
# Copyright (C) 2015 Blazer Six
|
2 |
# This file is distributed under the GPL-2.0+.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Simple Image Widget 4.2.0\n"
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"http://wordpress.org/support/plugin/simple-image-widget\n"
|
8 |
"POT-Creation-Date: 2014-06-13 21:26:00+00:00\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: 2015-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15 |
"X-Generator: grunt-wp-i18n 0.4.8\n"
|
43 |
msgid "Alternate Text:"
|
44 |
msgstr ""
|
45 |
|
46 |
+
#: includes/class-simple-image-widget-plugin.php:88
|
47 |
msgid "Choose an Attachment"
|
48 |
msgstr ""
|
49 |
|
50 |
+
#: includes/class-simple-image-widget-plugin.php:89
|
51 |
msgid "Update Attachment"
|
52 |
msgstr ""
|
53 |
|
54 |
+
#: includes/class-simple-image-widget-plugin.php:90
|
55 |
+
#: includes/class-simple-image-widget-plugin.php:185
|
56 |
+
#: includes/class-simple-image-widget.php:462
|
57 |
msgid "Full Size"
|
58 |
msgstr ""
|
59 |
|
60 |
+
#: includes/class-simple-image-widget-plugin.php:92
|
61 |
+
msgid "An error has occurred. Please reload the page and try again."
|
62 |
+
msgstr ""
|
63 |
+
|
64 |
#. Plugin Name of the plugin/theme
|
65 |
msgid "Simple Image Widget"
|
66 |
msgstr ""
|
67 |
|
68 |
+
#: includes/class-simple-image-widget-plugin.php:120
|
69 |
msgid "Image Size"
|
70 |
msgstr ""
|
71 |
|
72 |
+
#: includes/class-simple-image-widget-plugin.php:121
|
73 |
msgid "Link"
|
74 |
msgstr ""
|
75 |
|
76 |
+
#: includes/class-simple-image-widget-plugin.php:122
|
77 |
msgid "Link Classes"
|
78 |
msgstr ""
|
79 |
|
80 |
+
#: includes/class-simple-image-widget-plugin.php:123
|
81 |
msgid "Link Text"
|
82 |
msgstr ""
|
83 |
|
84 |
+
#: includes/class-simple-image-widget-plugin.php:124
|
85 |
msgid "New Window"
|
86 |
msgstr ""
|
87 |
|
88 |
+
#: includes/class-simple-image-widget-plugin.php:125
|
89 |
msgid "Text"
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: includes/class-simple-image-widget-plugin.php:182
|
93 |
msgid "Thumbnail"
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: includes/class-simple-image-widget-plugin.php:183
|
97 |
msgid "Medium"
|
98 |
msgstr ""
|
99 |
|
100 |
+
#: includes/class-simple-image-widget-plugin.php:184
|
101 |
msgid "Large"
|
102 |
msgstr ""
|
103 |
|
104 |
+
#: includes/class-simple-image-widget-plugin.php:250
|
105 |
+
msgid "No items found."
|
106 |
+
msgstr ""
|
107 |
+
|
108 |
+
#: includes/class-simple-image-widget-plugin.php:291
|
109 |
+
msgid "Title"
|
110 |
+
msgstr ""
|
111 |
+
|
112 |
+
#: includes/class-simple-image-widget-plugin.php:292
|
113 |
+
msgid "Type"
|
114 |
+
msgstr ""
|
115 |
+
|
116 |
+
#: includes/class-simple-image-widget-plugin.php:293
|
117 |
+
msgid "Date"
|
118 |
+
msgstr ""
|
119 |
+
|
120 |
+
#: includes/class-simple-image-widget-plugin.php:294
|
121 |
+
msgid "Status"
|
122 |
+
msgstr ""
|
123 |
+
|
124 |
+
#: includes/class-simple-image-widget-plugin.php:298
|
125 |
+
msgid "(no title)"
|
126 |
+
msgstr ""
|
127 |
+
|
128 |
+
#: includes/class-simple-image-widget-plugin.php:304
|
129 |
+
msgid "Published"
|
130 |
+
msgstr ""
|
131 |
+
|
132 |
+
#: includes/class-simple-image-widget-plugin.php:307
|
133 |
+
msgid "Scheduled"
|
134 |
+
msgstr ""
|
135 |
+
|
136 |
+
#: includes/class-simple-image-widget-plugin.php:310
|
137 |
+
msgid "Pending Review"
|
138 |
+
msgstr ""
|
139 |
+
|
140 |
+
#: includes/class-simple-image-widget-plugin.php:313
|
141 |
+
msgid "Draft"
|
142 |
+
msgstr ""
|
143 |
+
|
144 |
+
#: includes/class-simple-image-widget-plugin.php:321
|
145 |
+
#. translators: date format in table columns, see http:php.net/date
|
146 |
+
msgid "Y/m/d"
|
147 |
+
msgstr ""
|
148 |
+
|
149 |
+
#: includes/class-simple-image-widget-plugin.php:348
|
150 |
+
msgid "Find Post"
|
151 |
+
msgstr ""
|
152 |
+
|
153 |
+
#: includes/class-simple-image-widget-plugin.php:356
|
154 |
+
msgid "Search"
|
155 |
+
msgstr ""
|
156 |
+
|
157 |
#: includes/class-simple-image-widget.php:43
|
158 |
msgid "Image"
|
159 |
msgstr ""
|
162 |
msgid "An image from your Media Library."
|
163 |
msgstr ""
|
164 |
|
165 |
+
#: includes/class-simple-image-widget.php:254
|
166 |
msgid "Title:"
|
167 |
msgstr ""
|
168 |
|
169 |
+
#: includes/class-simple-image-widget.php:260
|
170 |
+
#: includes/class-simple-image-widget.php:270
|
171 |
msgid "Choose an Image"
|
172 |
msgstr ""
|
173 |
|
174 |
+
#: includes/class-simple-image-widget.php:261
|
175 |
msgid "Update Image"
|
176 |
msgstr ""
|
177 |
|
178 |
+
#: includes/class-simple-image-widget.php:282
|
179 |
msgid "Size:"
|
180 |
msgstr ""
|
181 |
|
182 |
+
#: includes/class-simple-image-widget.php:302
|
183 |
msgid "Link:"
|
184 |
msgstr ""
|
185 |
|
186 |
+
#: includes/class-simple-image-widget.php:311
|
187 |
msgid "Open in new window?"
|
188 |
msgstr ""
|
189 |
|
190 |
+
#: includes/class-simple-image-widget.php:320
|
191 |
msgid "Link Classes:"
|
192 |
msgstr ""
|
193 |
|
194 |
+
#: includes/class-simple-image-widget.php:329
|
195 |
msgid "Link Text:"
|
196 |
msgstr ""
|
197 |
|
198 |
+
#: includes/class-simple-image-widget.php:338
|
199 |
msgid "Text:"
|
200 |
msgstr ""
|
201 |
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: blazersix, bradyvercher
|
3 |
Tags: image widget, widget, media, media manager, sidebar, image, photo, picture
|
4 |
Requires at least: 3.5
|
5 |
-
Tested up to: 4.
|
6 |
Stable tag: trunk
|
7 |
License: GPL-2.0+
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -29,6 +29,7 @@ Blazer Six took over development and maintenance of Simple Image Widget with ver
|
|
29 |
|
30 |
* Finnish (fi) - Tomi Mäenpää [v4.1.1]
|
31 |
* French (fr_FR) - Alexandre Sadowski [v4.0.1]
|
|
|
32 |
* Serbo-Croation (sr_RS) - [Borisa Djuraskovic](http://www.webhostinghub.com/) [v4.1.2]
|
33 |
|
34 |
== Installation ==
|
@@ -77,6 +78,12 @@ The widget uses the core function `wp_get_attachment_image()` to display the ima
|
|
77 |
|
78 |
== Changelog ==
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
= 4.1.2 =
|
81 |
* Added Serbo-Croation translation.
|
82 |
|
2 |
Contributors: blazersix, bradyvercher
|
3 |
Tags: image widget, widget, media, media manager, sidebar, image, photo, picture
|
4 |
Requires at least: 3.5
|
5 |
+
Tested up to: 4.1
|
6 |
Stable tag: trunk
|
7 |
License: GPL-2.0+
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
29 |
|
30 |
* Finnish (fi) - Tomi Mäenpää [v4.1.1]
|
31 |
* French (fr_FR) - Alexandre Sadowski [v4.0.1]
|
32 |
+
* Japanese (ja) - Fumito Mizuno [v4.2.0]
|
33 |
* Serbo-Croation (sr_RS) - [Borisa Djuraskovic](http://www.webhostinghub.com/) [v4.1.2]
|
34 |
|
35 |
== Installation ==
|
78 |
|
79 |
== Changelog ==
|
80 |
|
81 |
+
= 4.2.0 =
|
82 |
+
* Added functionality to search for posts to link images to.
|
83 |
+
* Added Japanese translation.
|
84 |
+
* Changed the method for generating cache keys. Should provide better support for the_widget() and similar methods.
|
85 |
+
* Deprecated the method for flushing a single widget instance from the cache.
|
86 |
+
|
87 |
= 4.1.2 =
|
88 |
* Added Serbo-Croation translation.
|
89 |
|
simple-image-widget.php
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
* Plugin Name: Simple Image Widget
|
12 |
* Plugin URI: https://wordpress.org/extend/plugins/simple-image-widget/
|
13 |
* Description: A simple image widget utilizing the new WordPress media manager.
|
14 |
-
* Version: 4.
|
15 |
* Author: Blazer Six
|
16 |
* Author URI: http://www.blazersix.com/
|
17 |
* License: GPL-2.0+
|
11 |
* Plugin Name: Simple Image Widget
|
12 |
* Plugin URI: https://wordpress.org/extend/plugins/simple-image-widget/
|
13 |
* Description: A simple image widget utilizing the new WordPress media manager.
|
14 |
+
* Version: 4.2.0
|
15 |
* Author: Blazer Six
|
16 |
* Author URI: http://www.blazersix.com/
|
17 |
* License: GPL-2.0+
|