Quick Featured Images - Version 11.0

Version Description

  • Improved performance of confirmation step by using cached results of preview step
  • Improved security by changing $REQUEST to $_POST and $GET
  • Premium version: Added option in 'Set, replace, remove' for selection of multiple images: Use each selected only once
  • Premium version: Added option in 'Set, replace, remove' for selection of multiple images: Remove excess featured images after all selected images are used
  • Premium version: Added option in 'Set, replace, remove': Remove first image in content
  • Premium version: Added option in 'Set, replace, remove': Take first image of NextGen galleries
  • Premium version: Added option in 'Set, replace, remove': Take first external image
  • Premium version: Added option in 'Set, replace, remove': Take first attached image
  • Tested successfully with WordPress 4.2.2
  • Updated *.pot file and german translation
Download this release

Release Info

Developer Hinjiriyo
Plugin Icon 128x128 Quick Featured Images
Version 11.0
Comparing to
See all releases

Version 11.0

Files changed (42) hide show
  1. LICENSE.txt +339 -0
  2. README.txt +564 -0
  3. admin/assets/css/admin.css +304 -0
  4. admin/assets/css/index.php +1 -0
  5. admin/assets/images/first-content-image.gif +0 -0
  6. admin/assets/images/index.php +1 -0
  7. admin/assets/images/logo_qfi_pro.gif +0 -0
  8. admin/assets/images/overwrite-image.jpg +0 -0
  9. admin/assets/images/posts_list_w_image_column.gif +0 -0
  10. admin/assets/js/admin-defaults.js +143 -0
  11. admin/assets/js/admin.js +68 -0
  12. admin/assets/js/index.php +1 -0
  13. admin/class-quick-featured-images-admin.php +577 -0
  14. admin/class-quick-featured-images-columns.php +307 -0
  15. admin/class-quick-featured-images-defaults.php +754 -0
  16. admin/class-quick-featured-images-settings.php +504 -0
  17. admin/class-quick-featured-images-tools.php +2129 -0
  18. admin/views/filter_category.php +14 -0
  19. admin/views/filter_post_types.php +14 -0
  20. admin/views/filter_tag.php +23 -0
  21. admin/views/form_back_to_selection.php +44 -0
  22. admin/views/form_confirm.php +231 -0
  23. admin/views/form_refine.php +57 -0
  24. admin/views/form_select.php +163 -0
  25. admin/views/form_start.php +114 -0
  26. admin/views/index.php +1 -0
  27. admin/views/section_defaults.php +426 -0
  28. admin/views/section_errormsg.php +8 -0
  29. admin/views/section_footer.php +64 -0
  30. admin/views/section_header.php +19 -0
  31. admin/views/section_header_progress.php +42 -0
  32. admin/views/section_image.php +113 -0
  33. admin/views/section_overview.php +92 -0
  34. admin/views/section_results.php +73 -0
  35. admin/views/section_settings.php +19 -0
  36. index.php +1 -0
  37. languages/index.php +1 -0
  38. languages/quick-featured-images-de_DE.mo +0 -0
  39. languages/quick-featured-images-de_DE.po +1285 -0
  40. languages/quick-featured-images.pot +1074 -0
  41. quick-featured-images.php +80 -0
  42. uninstall.php +36 -0
LICENSE.txt ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
README.txt ADDED
@@ -0,0 +1,564 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Quick Featured Images ===
2
+ Contributors: Hinjiriyo
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2KUW27NECWVWJ
4
+ Tags: add, assign, associate, attach, attachment, attachments, audio, audios, author, auto, automatic, batch, bulk, categories, category, change, column, control, custom post type, custom post types, custom taxonomies, custom taxonomy, date, dates, default, define, delete, detach, exchange, featured, featured image, featured images, filter, gallery, galleries, image, image size, images, mass, media, mime, multimedia, nextgen, pages, parent page, period, post type, post types, posts, quick, random, rapid, remove, replace, rules, search, set, standard, tag, taxonomies, taxonomy, thumb, thumbnail, thumbnails, thumbs, time, unset, update, user, video, videos
5
+ Requires at least: 3.8
6
+ Tested up to: 4.2.2
7
+ Stable tag: 11.0
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ Your time-saving Swiss Army Knife for featured images: Set, replace and delete them in bulk, set default images, get overview lists.
12
+
13
+ == Description ==
14
+
15
+ = Manage featured images quickly =
16
+
17
+ The plugin 'Quick Featured Images' helps you bulk managing featured images, setting automatic default featured images to save your time.
18
+
19
+ 1. It **sets, replaces and removes featured images for hundreds of posts and pages in one go**. You can run it over all contents or let it work only to desired contents by using flexible filters.
20
+ 2. It displays assigned features images in an **additional sortable image column in lists of posts, pages and custom post types** if they support thumbnails. So you get a quick overview about used thumbnails of all posts and pages.
21
+ 3. It enables you to **define presets for automatic default featured images** for future posts as many as you need. You can set **accurate rules based on post properties**.
22
+
23
+ You get the free version here. If you want to include **audios, videos and custom post types** and get more options then take a look the **premium version** [Quick Featured Images Pro](http://www.quickfeaturedimages.com/).
24
+
25
+ = What users said =
26
+ * **Number 3** in [Top 18 Best Free WordPress Images Plugins In 3/2015](http://lytheme.com/top-18-best-free-wordpress-images-plugins-in-32015/) by admin on unknown March 20, 2015
27
+ * **"Brilliantly conceived time-saving plugin"** by Christopher Greenhough on February 3, 2015
28
+ * **Number 3** in [8 Must have Image Plugins for WordPress](http://www.bestwordpresshosting.org/8-must-image-plugins-wordpress/) by Sadia KOmal on unknown date
29
+ * **"You can tell that a lot of hard work went into this high quality plugin."** by dfitek on December 8, 2014
30
+ * **"The Best Plugin I ever saw - I would like to rate it 10/5"** by MovieMagia on November 25, 2014
31
+ * **Number 2** in [Top 5 WordPress plugins van de maand september](http://webtalis.nl/top-5-wordpress-plugins-van-de-maand-september/) by Webtalis on September 5, 2014
32
+ * **"Literally 5 minutes changed over 300 posts! Brilliant!!!!"** by Bob on September 4, 2014
33
+ * **"It's a life saver ... and is ridiculously fast!"** by Orlof on August 26, 2014
34
+ * **Number 6** in [Best 10 Free WordPress Plugins of the August 2014](https://managewp.com/best-free-wordpress-plugins-august-2014) by Manage WP Blog on August 18, 2014
35
+ * **"Finally! It's about time somebody got it right!"** by yallways on August 3, 2014
36
+ * **"Sooo damn convenient!"** by Benbodhi on July 2, 2014
37
+ * **"You've saved me a lot of time!"** by Celebrianne on May 31, 2014
38
+
39
+ See more comments under [Reviews](http://wordpress.org/support/view/plugin-reviews/quick-featured-images).
40
+
41
+ = Access =
42
+
43
+ 1. You will find the plugin under the own **menu item 'Featured Images'**
44
+ 2. You can select an image in the media library with the **action link 'Bulk set as featured image'**. Click on it and you can go on with the plugin.
45
+
46
+ = Set, replace, remove: Actions =
47
+
48
+ With Quick Featured Images you can apply time-saving tasks with many featured images: add, exchange and delete them in bulk.
49
+
50
+ 1. **Adding featured images:** You can select an image to set it as the new featured image to hundreds of posts in one go. You can select multiple images to set them randomly as featured images.
51
+ 2. **Exchanging featured images:** You can replace or update several existing featured images with a selected image in one go.
52
+ 3. **Deleting featured images:** You can remove a selected featured image or all existing featured images in one go.
53
+
54
+ If you want to **set the first content image as featured** then take a look the **premium version** [Quick Featured Images Pro](http://www.quickfeaturedimages.com/).
55
+
56
+ = Set, replace, remove: Options =
57
+
58
+ Based on your selected action you can toggle on and off some options:
59
+
60
+ 1. **overwrite existing featured images** or **keeping them unchanged**. The latter setting is the default.
61
+ 2. **consider only posts without a featured image**. This will hide posts with featured images in the results list and will speed up the process.
62
+
63
+ If you want to use the option to **remove the first image in the content** then take a look the **premium version** [Quick Featured Images Pro](http://www.quickfeaturedimages.com/).
64
+
65
+ The **premium version** offers you several approaches for **setting the first image as featured**:
66
+
67
+ 1. **the first post image** if available in the media library
68
+ 2. **the first external post image**, download it and add it to the media library
69
+ 3. **the first attached image of a post**
70
+ 4. **the first image of a WordPress standard gallery**
71
+ 5. **the first image of a NextGen Gallery**.
72
+
73
+ The **premium version** offers you two more options if you selected multiple images to set them as featured images in random order:
74
+
75
+ 1. **Use each selected image only once**. If there are more posts than selected images the remaining posts will not be changed.
76
+ 2. **Remove excess featured images** after all selected images are used.
77
+
78
+
79
+ If you want to use these options then take a look the **premium version** [Quick Featured Images Pro](http://www.quickfeaturedimages.com/).
80
+
81
+ = Set, replace, remove: Filters =
82
+
83
+ If there would be no filters Quick Featured Images would affect all posts and pages without exception! In most cases this is not desired.
84
+
85
+ The implemented filters allow you to narrow down the action to only the posts and pages you want to modify. The built-in filters are:
86
+
87
+ 1. Filter by **post type**: Search by post types. By **default all** posts, pages and custom post types will be affected
88
+ 2. Filter by **category**: Search posts by category
89
+ 3. Filter by **tag**: Search posts by tag
90
+
91
+ The **premium version** offers you:
92
+
93
+ 1. Filter by **author**: Search by author
94
+ 2. Filter by **custom taxonomy**: Search by terms of registered taxonomies of a plugin or a theme
95
+ 3. Filter by **featured image size**: Search for small featured images below a given size
96
+ 4. Filter by **multimedia type**: Search for audio and video files
97
+ 5. Filter by **search**: Search by search term
98
+ 6. Filter by **status**: Search by several statuses (published, draft, private etc.). By **default all** statuses will be affected
99
+ 7. Filter by **time**: Search by time specifications
100
+ 8. Filter by **parent page**: Search child pages by parent page
101
+
102
+ If you want to use these filters then take a look the **premium version** [Quick Featured Images Pro](http://www.quickfeaturedimages.com/).
103
+
104
+ = Automatic Default Featured Images: Rules =
105
+
106
+ **You can set rules for default featured images of posts easily.** Every time you insert a new post or save an existing post Quick Featured Images will look for a rule to add and to change the preset featured image to the saved post.
107
+
108
+ You can define the rules based on
109
+
110
+ 1. always the **first content image**
111
+ 2. post **categories**
112
+ 3. post **tags**
113
+ 4. post **authors**
114
+ 5. **standard post types** 'Post' and 'Page'
115
+ 6. all other **custom post types** supporting featured images
116
+ 7. all other **custom taxonomies** supporting featured images
117
+
118
+ The rules are easy to set: choose an image, a taxonomy, a value and save the settings. That's it. **You do not need to code.**
119
+
120
+ You can add, change and delete every rule whenever you want. So you get an **unlimited and precise set of rules** for automatic default featured images in your website.
121
+
122
+ = Automatic Default Featured Images: Options =
123
+
124
+ You can switch between
125
+
126
+ 1. **overwriting existing featured images** or
127
+ 2. **keeping them unchanged**.
128
+
129
+ The latter setting is the default. The option is used every time a post is saved.
130
+
131
+ = Additional sortable image column in posts lists =
132
+
133
+ Quick Featured Images adds a new column in posts lists. The additional column shows the currently assigned featured image of each post. The new column called 'Featured Image' is sortable by the image ID.
134
+
135
+ With that column you can get a **quick overview about all used images**. You can also see posts with no featured image at a glance.
136
+
137
+ Under **'Featured Images'** &gt; **'Image Columns'** you can switch on and off the additional image column for every single post type, even custom post types if they support thumbnails.
138
+
139
+ = Your idea to improve the plugin is welcome =
140
+
141
+ If you have any new idea for Quick Featured Images post your questions and ideas in the [support forum at wordpress.org](http://wordpress.org/support/plugin/quick-featured-images). I will try to take a look and answer as soon as possible.
142
+
143
+ = Support =
144
+
145
+ Support for this plugin will be provided in the form of Product Support. This means that I intend to fix any confirmed bugs, listen to ideas for this plugin and improve the user experience when enhancements are identified and can reasonably be accomodated.
146
+
147
+ There is no User Support provided for this plugin. If you are having trouble with this plugin in your particular installation of WordPress, I will not be able to help you troubleshoot the problem.
148
+
149
+ = No warranty and liability! =
150
+
151
+ **Notice: This plugin has no Undo function!** This plugin is provided under the terms of the GPL, including the following:
152
+
153
+ BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. **THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.** SHOULD THE PROGRAM PROVE DEFECTIVE, **YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION**.
154
+
155
+ == Installation ==
156
+
157
+ = Using The WordPress Dashboard =
158
+
159
+ 1. Navigate to the 'Add New' in the plugins dashboard
160
+ 2. Search for 'Quick Featured Images'
161
+ 3. Click 'Install Now'
162
+ 4. Activate the plugin on the Plugin dashboard
163
+ 5. Go to 'Featured Images'
164
+
165
+ = Uploading in WordPress Dashboard =
166
+
167
+ 1. Navigate to the 'Add New' in the plugins dashboard
168
+ 2. Navigate to the 'Upload' area
169
+ 3. Select `quick-featured-images.zip` from your computer
170
+ 4. Click 'Install Now'
171
+ 5. Activate the plugin in the Plugin dashboard
172
+ 6. Go to 'Featured Images'
173
+
174
+ = Using FTP =
175
+
176
+ 1. Download `quick-featured-images.zip`
177
+ 2. Extract the `quick-featured-images` directory to your computer
178
+ 3. Upload the `quick-featured-images` directory to the `/wp-content/plugins/` directory
179
+ 4. Activate the plugin in the Plugin dashboard
180
+ 5. Go to 'Featured Images'
181
+
182
+
183
+ == Frequently Asked Questions ==
184
+
185
+ = How can I set a default featured image for existing posts? =
186
+
187
+ For that use the plugin twice:
188
+
189
+ 1. Under 'Set, replace, delete' **remove** all undesired featured images if there are some. If desired remove the images using the option 'Overwrite existing featured images'.
190
+ 2. Then choose the desired image and **set** it to the posts **without the option 'Overwrite existing featured images'**. This will set the image to all posts without a featured image.
191
+
192
+ = How can I set a default featured image for future posts? =
193
+
194
+ **Or: I want image X as default featured image if the post has category Y. How to set this?**
195
+
196
+ Look at some examples:
197
+
198
+ 1. To set a default featured image for every new post of the category 'Lorem ipsum':
199
+ 1. choose the image
200
+ 2. choose the taxonomy 'Category' and
201
+ 3. choose the value 'Lorem ipsum'.
202
+ 4. save the settings.
203
+ 2. To set a default featured image for every new post:
204
+ 1. choose the image
205
+ 2. choose the taxonomy 'Post Type' and
206
+ 3. choose the value 'Post'
207
+ 4. save the settings.
208
+ 3. To set a default featured image for every new custom taxonomy of a theme or a plugin, e.g. events of the category 'Concert':
209
+ 1. choose the image
210
+ 2. choose the taxonomy 'Event Category' and
211
+ 3. choose the value 'Concert'.
212
+ 4. save the settings.
213
+
214
+ = Who can see Quick Featured Images in the WordPress backend? =
215
+
216
+ All users who have the right to **edit others posts** have the access to Quick Featured Images. As long as the user roles are untouched after a fresh standard WordPress installation both **Administrators** and **Editors** can use this plugin.
217
+
218
+ For these users the menu item 'Featured Images' with its sub pages appears in the WordPress backend. All other users will not see this menu item or will get an error message if they would request a Quick Featured Images page via a direct link.
219
+
220
+ = Does the plugin work in a WordPress Multisite installation? =
221
+
222
+ Yes. It works either activated for all sites (network wide) or activated in each single site. It changes only the posts of the site where you use it.
223
+
224
+ = Will I lose all the featured images if I will delete the plugin? =
225
+
226
+ No. The featured images you have already set will remain set if you deactivate or delete the plugin.
227
+
228
+ = Why does the plugin say "No matches found" after confirmation? =
229
+
230
+ This could be the case if the images were not uploaded via WordPress' own media uploader. If you have uploaded images via FTP or other ways the plugin can not find images.
231
+
232
+ It does not matter where the images are stored on your server. They can be in any folder. But they have to be uploaded via WordPress' own media uploader to be found by this plugin. If this is the case the plugin will work fine.
233
+
234
+ = Why are there sometimes strange search results with custom taxonomies? =
235
+
236
+ The search for custom taxonomy terms could lead to surprising results. The reason is custom taxonomies can be used in many different ways. It is not possible to catch them all in one single code expression. If you should be unsatisfied with the result try other filters to get the result you want.
237
+
238
+ = Which languages does the plugin support? =
239
+
240
+ Actually these languages are supported:
241
+
242
+ * English
243
+ * German
244
+
245
+ Further translations are welcome. If you want to give in your translation please leave a notice in the [plugin's support forum](http://wordpress.org/support/plugin/quick-featured-images).
246
+
247
+ = Where is the *.pot file for translating the plugin in any language? =
248
+
249
+ If you want to contribute a translation of the plugin in your language it would be great! You would find the *.pot file in the 'languages' directory of this plugin. If you would send the *.po file to me I would include it in the next release of the plugin.
250
+
251
+ == Screenshots ==
252
+
253
+ 1. The first screen of Quick Featured Images: select an image and an action.
254
+ 2. The second screen: select a filter to narrow down to posts and pages you want to modify with the image. Alternatively you can drop filtering and jump to Screen 4 directly.
255
+ 3. The third screen: refine the filters.
256
+ 4. The fourth screen: take a preview. If the filtering does not correspond to your expectations you can refine the filters again under the list on this page.
257
+ 5. The fifth screen: take an overview of the success of the action.
258
+ 6. The sixth screen: take an look on the extra column (marked red) for assigned featured images.
259
+ 7. The seventh and last screen: take an overview of your rules for future default featured images.
260
+
261
+ == Changelog ==
262
+
263
+ = 11.0 =
264
+ * Improved performance of confirmation step by using cached results of preview step
265
+ * Improved security by changing $_REQUEST to $_POST and $_GET
266
+ * Premium version: Added option in 'Set, replace, remove' for selection of multiple images: Use each selected only once
267
+ * Premium version: Added option in 'Set, replace, remove' for selection of multiple images: Remove excess featured images after all selected images are used
268
+ * Premium version: Added option in 'Set, replace, remove': Remove first image in content
269
+ * Premium version: Added option in 'Set, replace, remove': Take first image of NextGen galleries
270
+ * Premium version: Added option in 'Set, replace, remove': Take first external image
271
+ * Premium version: Added option in 'Set, replace, remove': Take first attached image
272
+ * Tested successfully with WordPress 4.2.2
273
+ * Updated *.pot file and german translation
274
+
275
+ = 10.0 =
276
+ * Introducing **premium version** [Quick Featured Images Pro](http://www.quickfeaturedimages.com/)
277
+ * Deleted in 'Set, replace, remove': some filters and options in favor of the premium version
278
+ * Corrected CSS height for images in image column to keep the aspect ratio
279
+ * Updated *.pot file and german translation
280
+
281
+ = 9.1 =
282
+ * Added in 'Set, replace, remove': Option to find first image in WP galleries
283
+ * Added in 'Set, replace, remove': Informations about type and status of each post in preview list
284
+ * Fixed in 'Set, replace, remove': Only some assigned featured images were displayed; now all assigned images are displayed
285
+ * Fixed in 'Set, replace, remove': Hilited wrong step in process bar when user skips filters; now correct hilite
286
+ * Fixed in 'Image Columns': No more warning if no option was checked
287
+ * Slight design improvement on the post type filter
288
+ * Improved performance of preview list
289
+ * Adopted new core strings of WP 4.1
290
+ * Updated *.pot file and german translation
291
+
292
+ = 9.0 =
293
+ * Tested successfully with WP 4.1, especially the improved queries
294
+ * Added in 'Set, replace, remove': New filter 'Multimedia File Filter' for audio and video file types
295
+ * Added in 'Set, replace, remove': Option to ignore posts with featured images and consider only posts without any featured image
296
+ * Added in posts lists: Featured Image columns in posts lists are now sortable by image
297
+ * Fixed in 'Set, replace, remove': If no post type was selected in the post type filter all posts were returned as result; now no posts are returned as expected
298
+ * Fixed in 'Set, replace, remove': If a post had no title the link to this post was missing in the result lists; now a link with default '(no title)' is displayed
299
+ * Fixed in 'Set, replace, remove': If an image and the action 'Add first post image' were selected the design on the following pages was destroyed
300
+ * Improved performance in 'Set, replace, remove' for the result lists
301
+ * Changed sidebar content
302
+ * Updated *.pot file and german translation
303
+
304
+ = 8.3.1 =
305
+ * Fixed in 'Image Columns': bug which displayed undesired thumbnail columns. Please reset your image column settings.
306
+ * Tested successfully with WordPress 4.0.1
307
+ * Revised headlines in start page of 'Set, replace, remove' for better comprehension
308
+ * Updated *.pot file and german translation
309
+
310
+ = 8.3 =
311
+ * Fixed bug in 'Preset Featured Images' which prevented to recognize the first content image
312
+ * Improved algorithm for better detection of the id of the first content image
313
+ * Improved SQL performance in 'Set, replace, delete'
314
+ * Improved security by changing `(int)` to `absint()` for ID variables
315
+ * Fixed typo in german translation
316
+
317
+ = 8.2.2 =
318
+ * Added rule at the presets to overwrite existing featured images or to keep them by default
319
+ * Fixed bug at the presets where a rule based on a user could be ignored
320
+ * Updated *.pot file and german translation
321
+
322
+ = 8.2.1 =
323
+ * Successfully tested with WordPress 4.0
324
+ * Added icons for plugin search
325
+ * Changed order of links for this plugin on plugin list
326
+
327
+ = 8.2 =
328
+ * Added in 'Preset Featured Images': author as taxonomy
329
+ * Added in 'Set, replace, remove' a help text for the case of a white blank page while treating thousands of posts
330
+ * Improved in 'Preset Featured Images': featured image is set when a new post is created, so the rules work with auto-posting / auto-blogging plugins (aggregators)
331
+ * Improved uninstall routine
332
+ * Tested successfully with WordPress 3.9.2
333
+ * Updated *.pot file and german translation
334
+
335
+ = 8.1 =
336
+ * Added option to use the first content image as featured image only if there is no featured image
337
+ * Fixed empty pulldown menu on 'Preset Featured Images' if values have apostrophes
338
+ * Fixed PayPal button if WordPress locale value is not supported by PayPal
339
+ * Improved robustness and security of code for page 'Preset Featured Images'
340
+ * Renamed sub menu page 'Settings' to 'Image Columns'
341
+ * Changed illustration on page 'Image Columns'
342
+ * Updated *.pot file and german translation
343
+ * Updated screenshots
344
+
345
+ = 8.0 =
346
+ * Added the functionality of auto set featured images for new posts based on user defined rules
347
+ * Added a sub menu page 'Preset Featured Images'
348
+ * Updated menu page 'Overview'
349
+ * Moved menu item near menu item 'Media'
350
+ * Tested JavaScript in Opera, Firefox, Chrome and Internet Explorer
351
+ * Fixed wrong behaviour on Customize page if both image selection buttons were clicked
352
+ * Fixed HTML content section of custom taxonomies filter
353
+ * Updated uninstall file
354
+ * Updated *.pot file and german translation
355
+ * Added screenshot of page 'Preset Featured Images'
356
+
357
+ = 7.0 =
358
+ * Added a top level menu item 'Featured Images'
359
+ * Added a sub menu page 'Overview'
360
+ * Added a sub menu page 'Settings'
361
+ * Added a sub menu page 'Customize', moved the former menu link 'Media' - 'Quick Featured Images' to there
362
+ * Added additional image column in lists of posts for assigned featured images
363
+ * Added additional image column in lists of pages
364
+ * Added additional image column in lists of thumbnail supporting custom post types
365
+ * Added options to switch each of the additional image columns on or off
366
+ * Added uninstall file
367
+ * Raised the lowest required WordPress version from 3.7 to 3.8 because of the use of dashicons
368
+ * Significant refactoring
369
+ * Fixed width of selected image on the plugin's start page
370
+ * Fixed error message for too old WordPress version
371
+ * Tested on localized WordPress installations
372
+ * Updated *.pot file and german translation
373
+ * Updated screenshots
374
+
375
+ = 6.0 =
376
+ * Added action: Set multiple selected images as featured images randomly
377
+ * Revised layout of the plugin's start page
378
+ * Updated *.pot file and german translation
379
+
380
+ = 5.1.1 =
381
+ * Added a notice to the image selection button for the case of not working.
382
+ * Tiny text changes
383
+ * Refactoring for the image search function
384
+ * Updated *.pot file and german translation
385
+
386
+ = 5.1 =
387
+ * Added: Column in the preview list for the future featured image
388
+ * Added: Option whether to overwrite existing featured images or not
389
+ * Added: User selected filters and options in the information section
390
+ * Changed: Setting no filters jumps directly to confirmation page instead of displaying an error message
391
+ * Improved: Search for first image in posts finds more images
392
+ * Improved: Selected featured images which should be replaced are remembered if the user goes back to selection page
393
+ * Updated *.pot file and german translation
394
+
395
+ = 5.0 =
396
+ * Added action: Take the first image in a post as featured image
397
+ * Updated *.pot file and german translation
398
+
399
+ = 4.1.2 =
400
+ Fixed bug on using custom taxonomies
401
+
402
+ = 4.1.1 =
403
+ Fixed an insufficient security check which prevented to set a featured image
404
+
405
+ = 4.1 =
406
+ * Added link "Bulk set as featured image" under each image in the media library
407
+ * Changed hard coded plugin name to variable
408
+ * Tested with WordPress 3.9.1
409
+ * Updated *.pot file and german translation
410
+
411
+ = 4.0 =
412
+ * Added new filter "Filter by Time Specifications": Search in time periods on a year-month base
413
+ * Improved page speed at both the preview list and the result list
414
+ * Improved style for smartphones
415
+ * Updated *.pot file and german translation
416
+
417
+ = 3.2.1 =
418
+ * Added message after activation about the plugin's location in the backend
419
+ * Updated *.pot file and german translation
420
+
421
+ = 3.2 =
422
+ * Added thumbnails of current assigned featured images both in the preview and the result lists
423
+ * Design adjustment for links
424
+ * Updated *.pot file and german translation
425
+
426
+
427
+ = 3.1.1 =
428
+ * Fixed useless listing of custom post types which do not support thumbnails
429
+
430
+ = 3.1 =
431
+ * Fixed missing merge of post types and custom post types as default if post type filter was not selected
432
+ * Changed the style to be based more on WP standard style
433
+ * Changed selection modus for images to be replaced from single to multiple
434
+ * Changed names of custom post types into their more readable labels
435
+ * Changed names of custom taxonomies into their more readable labels
436
+ * Changed notice for untouched posts from "failed" to "unconsidered"
437
+ * Moved notice of selected action to the right of the selected image
438
+ * Updated *.pot file and german translation
439
+
440
+ = 3.0.2 =
441
+ * Fixed broken search filter
442
+
443
+ = 3.0.1 =
444
+ * Fixed: error message after plugin activation
445
+ * Fixed: no images in the image library
446
+ * Fixed: PHP error searching for posts in the backend
447
+ * Deleted uninstall.php to avoid a confusing uninstall message
448
+
449
+ = 3.0 =
450
+ * Added new filter "Filter by Custom Taxonomies"
451
+ * Changed default post types: ALL posts, pages and custom post types are included in the search by default
452
+ * Changed default selection in drop down selection lists into "nothing selected"
453
+ * Updated *.pot file and german translation
454
+ * Improved performance
455
+ * Improved design of confirmation page
456
+ * Revised functions
457
+
458
+ = 2.0.2 =
459
+ * Revised SQL statement for featured image size filter
460
+
461
+ = 2.0.1 =
462
+ * Fixed missing headline on confirmation page if action "remove any image" was selected
463
+ * Updated *.pot file and german translation
464
+
465
+ = 2.0 =
466
+ * Added new action "Remove any image"
467
+ * Added new filter "Filter by Featured Image Size"
468
+ * Added error notice if no image of the image replacement list was selected
469
+ * Changed design of the plugin's start page. I hope you find it more useful
470
+ * Improved processing speed of found posts
471
+ * Improved performance
472
+ * Improved security for input data and URLs
473
+
474
+ = 1.0 =
475
+ * The plugin was released.
476
+
477
+ == Upgrade Notice ==
478
+
479
+ = 11.0 =
480
+ Improved performance of confirmation step and better security, tested with WP 4.2.2
481
+
482
+ = 10.0 =
483
+ Introducing premium version Quick Featured Images Pro, corrected CSS
484
+
485
+ = 9.1 =
486
+ Added option in 'Set, replace, remove' to find first image in galleries, fixed bug and warning, some improvements
487
+
488
+ = 9.0 =
489
+ Tested successfully with WP 4.1, added filter for audio and video file types in 'Set, replace, remove', made Featured Image column sortable by image, fixed minor bugs.
490
+
491
+ = 8.3.1 =
492
+ Tiny text revision and fixed bug which displayed undesired thumbnail columns. Please reset your image column settings.
493
+
494
+ = 8.3 =
495
+ Bugfixing and improvements for detecting the first image in post contents
496
+
497
+ = 8.2.2 =
498
+ Added rule at the presets to keep existing featured images. Please refine your preset rules if you use the "first content image rule"!
499
+
500
+ = 8.2.1 =
501
+ Successfully tested with WordPress 4.0, added icons for plugin search
502
+
503
+ = 8.2 =
504
+ Improved presets, improved uninstall routine, tested with WordPress 3.9.2
505
+
506
+ = 8.1 =
507
+ Added option to use the first content image as featured image only if there is no featured image; more robust and secure code for page 'Preset Featured Images'
508
+
509
+ = 8.0 =
510
+ Added the functionality of auto set featured images for new posts based on user defined rules and a new sub menu page 'Default Images'
511
+
512
+ = 7.0 =
513
+ Added: new top level menu item, column for featured images in lists of posts, options page
514
+
515
+ = 6.0 =
516
+ New action: Set multiple selected images as featured images randomly
517
+
518
+ = 5.1.1 =
519
+ Added a notice to the image selection button for the case of not working.
520
+
521
+ = 5.1 =
522
+ New option and many user interface improvements
523
+
524
+ = 5.0 =
525
+ Added action: Take the first image in a post as featured image
526
+
527
+ = 4.1.2 =
528
+ Fixed bug on using custom taxonomies
529
+
530
+ = 4.1.1 =
531
+ Fixed security check
532
+
533
+ = 4.1 =
534
+ Added link "Bulk set as featured image" under each image in the media library. Tested with WordPress 3.9.1
535
+
536
+ = 4.0 =
537
+ Added new filter "Filter by Time Specifications": Search in time periods on a year-month base. Improved page speed at both the preview list and the result list. Improved style for smartphones
538
+
539
+ = 3.2.1 =
540
+ More orientation: After activation of this plugin a message tells you where you can find the plugin in the WordPress backend.
541
+
542
+ = 3.2 =
543
+ Better overview: Now you can see both in the preview and the result lists the current assigned featured image of each post.
544
+
545
+ = 3.1.1 =
546
+ Fixed useless listing of custom post types which do not support thumbnails
547
+
548
+ = 3.1 =
549
+ Many improvements of the user interface in style and labeling. Now you can select multiple images to be replaced instead of only a single one. Fixed some minor errors
550
+
551
+ = 3.0.2 =
552
+ Now the filter by search term works properly again.
553
+
554
+ = 3.0.1 =
555
+ Fixed error message after plugin activation and missed images in the library
556
+
557
+ = 3.0 =
558
+ Added new filter "Filter by Custom Taxonomies". Be aware of the changed default behaviour: ALL posts, pages and custom post types are included in the search by default. Improved performance. Improved design of confirmation page
559
+
560
+ = 2.0 =
561
+ Many improvements and additions
562
+
563
+ = 1.0 =
564
+ No upgrades, just the first release.
admin/assets/css/admin.css ADDED
@@ -0,0 +1,304 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* This stylesheet is used to style the admin option form of the plugin. */
2
+
3
+ /*
4
+ * Layout
5
+ *
6
+ */
7
+ .qfi_wrapper {
8
+ overflow: hidden;
9
+ }
10
+ #qfi_main {
11
+ float: left;
12
+ width: 66%;
13
+ }
14
+ #qfi_footer {
15
+ float: right;
16
+ width: 33%;
17
+ }
18
+ #qfi_main .qfi_content {
19
+ margin: 2em 1em 1em 0;
20
+ background-color: rgba(255, 255, 255, 0.8);
21
+ padding-bottom: 2em;
22
+ }
23
+ #qfi_footer .qfi_content {
24
+ margin: 2em 0 1em 1em;
25
+ background-color: #F5FBFD;
26
+ border-radius: 8px;
27
+ border: 1px solid #ccc;
28
+ }
29
+
30
+ /* floating halfs */
31
+ .qfi_w50percent {
32
+ width: 50%;
33
+ float: left;
34
+ display: block;
35
+ margin: 0;
36
+ border: 0 none;
37
+ padding: 0;
38
+ }
39
+
40
+ /*
41
+ * Elements
42
+ *
43
+ */
44
+
45
+ /* Footer */
46
+ #qfi_footer .qfi_content h3 {
47
+ background: none;
48
+ margin: 0;
49
+ }
50
+ #qfi_footer .qfi_content dl {
51
+ padding: 0 8px;
52
+ }
53
+ #qfi_footer .qfi_content li,
54
+ #qfi_footer .qfi_content dd {
55
+ overflow: hidden; /* correct height if inner flowing elements */
56
+ margin-bottom: 10px;
57
+ margin-left: 0;
58
+ }
59
+ #qfi_main .widefat a {
60
+ text-decoration: underline;
61
+ }
62
+
63
+ /* Filter 'Replace' */
64
+ #qfi_replace {
65
+ overflow: hidden;
66
+ }
67
+ #qfi_replace label {
68
+ display: block;
69
+ float: left;
70
+ overflow: hidden;
71
+ padding: 0 3em 3em 0;
72
+ }
73
+ #qfi_replace input[type="radio"]:checked:before,
74
+ #qfi_replace input[type="radio"]:checked,
75
+ #qfi_replace input[type="radio"],
76
+ #qfi_replace input[type="checkbox"]:checked:before,
77
+ #qfi_replace input[type="checkbox"]:checked,
78
+ #qfi_replace input[type="checkbox"] {
79
+ position: relative;
80
+ top: 2.5em;
81
+ left: 1.5em;
82
+ padding: 9px !important;
83
+ }
84
+
85
+ /* Progress Bar */
86
+ #progress {
87
+ }
88
+ #progress em {
89
+ font-weight: bold;
90
+ font-style: normal;
91
+ }
92
+ #progress #bar {
93
+ display: block;
94
+ overflow: hidden;
95
+ line-height: 1;
96
+ padding: 1em;
97
+ background: none repeat scroll 0 0 #e3e3e3;
98
+ color: #222;
99
+ }
100
+ #progress #bar span {
101
+ line-height: 1;
102
+ padding: 1em;
103
+ }
104
+ #progress #bar strong {
105
+ line-height: 1;
106
+ padding: 1em;
107
+ }
108
+
109
+ /* Other content elements */
110
+ body[class*=_page_quick-featured-images-defaults] #qfi_main .qfi_content table.widefat th:nth-of-type(1),
111
+ body[class*=_page_quick-featured-images-defaults] #qfi_main .qfi_content table.widefat td:nth-of-type(1),
112
+ body[class*=_page_quick-featured-images-defaults] #qfi_main .qfi_content table.widefat th:nth-of-type(4),
113
+ body[class*=_page_quick-featured-images-defaults] #qfi_main .qfi_content table.widefat td:nth-of-type(4) {
114
+ text-align: center;
115
+ }
116
+ body[class*=_page_quick-featured-images-defaults] #qfi_main .qfi_content table.widefat td:nth-of-type(4) {
117
+ vertical-align: middle;
118
+ }
119
+ body[class*=_page_quick-featured-images-defaults] #qfi_main .qfi_content table.form-table,
120
+ body[class*=_page_quick-featured-images-settings] #qfi_main .qfi_content table.form-table {
121
+ width: auto;
122
+ }
123
+ body[class*=_page_quick-featured-images-defaults] #qfi_main .qfi_content form select {
124
+ width: 100%;
125
+ }
126
+ body[class*=_page_quick-featured-images-defaults] #qfi_main .qfi_content table.form-table,
127
+ body[class*=_page_quick-featured-images-settings] #qfi_main .qfi_content table.form-table,
128
+ #qfi_main .qfi_content legend,
129
+ #qfi_main .qfi_content h5,
130
+ #qfi_main .qfi_content h4,
131
+ #qfi_main .qfi_content ul,
132
+ #qfi_main .qfi_content p {
133
+ margin-left: 8px;
134
+ margin-right: 8px;
135
+ }
136
+ #qfi_main .qfi_content h4 {
137
+ font-size: 1.12em;
138
+ line-height: 1.44;
139
+ }
140
+ #qfi_main .qfi_content h5 {
141
+ margin-bottom: 0;
142
+ font-size: 1em;
143
+ }
144
+ #qfi_main .qfi_content fieldset {
145
+ margin-bottom: 1em;
146
+ }
147
+
148
+ #qfi_main .qfi_content legend {
149
+ margin-bottom: .5em;
150
+ font-weight: bold;
151
+ }
152
+ #qfi_main .qfi_content ul {
153
+ list-style: disc outside none;
154
+ padding-left: 1em;
155
+ }
156
+ #qfi_main .qfi_content ul.selected_images {
157
+ padding-left: 0;
158
+ }
159
+ #qfi_main .qfi_content ul.selected_images li {
160
+ display: inline;
161
+ margin: 0 8px 0 0;
162
+ padding: 0;
163
+ }
164
+ #qfi_main .qfi_content ol {
165
+ margin-left: 3em;
166
+ margin-right: 8px;
167
+ }
168
+ #qfi_year {
169
+ width: 4em;
170
+ }
171
+ .wrap h3 {
172
+ background: none repeat scroll 0 0 #DDD;
173
+ color: #222222;
174
+ padding: 8px;
175
+ }
176
+ .wrap h3.nobottom {
177
+ margin-bottom: 0;
178
+ }
179
+ .qfi_content_inside .failure {
180
+ color: #000;
181
+ font-size: 1.5em;
182
+ font-weight: bold;
183
+ margin-top: 0.5em;
184
+ padding: 0 15px;
185
+ }
186
+ .qfi_content_inside .success {
187
+ color: #555;
188
+ font-size: 1.5em;
189
+ font-weight: bold;
190
+ margin-top: 0.5em;
191
+ padding: 0 15px;
192
+ }
193
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content ul li span.dashicons {
194
+ font-size: 15em;
195
+ width: auto;
196
+ height: auto;
197
+ line-height: 1;
198
+ text-align: center;
199
+ text-decoration: none;
200
+ vertical-align: baseline;
201
+ }
202
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content ul li:nth-of-type(1) a span {
203
+ color: #3399CC; /*#236ea3;*/
204
+ }
205
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content ul li:nth-of-type(1) a:focus span,
206
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content ul li:nth-of-type(1) a:hover span {
207
+ color: #66B3D9; /*#2e91d6;*/
208
+ }
209
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content ul li:nth-of-type(2) a span {
210
+ color: #FF9900; /*#17826a;*/
211
+ }
212
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content ul li:nth-of-type(2) a:focus span,
213
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content ul li:nth-of-type(2) a:hover span {
214
+ color: #FFB340; /*#20b594;*/
215
+ }
216
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content ul li:nth-of-type(3) a span {
217
+ color: #99CCCC; /*#a6321f;*/
218
+ }
219
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content ul li:nth-of-type(3) a:focus span,
220
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content ul li:nth-of-type(3) a:hover span {
221
+ color: #B3D9D9; /*#d94128;*/
222
+ }
223
+ #qfi_main .qfi_content .failure {
224
+ font-weight: bold;
225
+ }
226
+ #template_row {
227
+ display: none;
228
+ }
229
+ .attachment-thumbnail {
230
+ border: 2px solid #444;
231
+ border-radius: 3px;
232
+ box-shadow: 3px 3px 3px 1px #999;
233
+ -webkit-box-shadow: 3px 3px 3px 1px #999;
234
+ margin-bottom: .5em;
235
+ }
236
+ #qfi_max_width,
237
+ #qfi_max_height {
238
+ width: 4em;
239
+
240
+ }
241
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content ul {
242
+ list-style: none;
243
+ margin-left: 0;
244
+ margin-right: 0;
245
+ padding-left: 0;
246
+ overflow: hidden;
247
+ }
248
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content li {
249
+ display: block;
250
+ float: left;
251
+ width: 50%;
252
+ height: 310px;
253
+ }
254
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content ul li a:focus img,
255
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content ul li a:hover img {
256
+ opacity: .6;
257
+ }
258
+ #qfi_main .qfi_content img.alignleft,
259
+ #qfi_footer .qfi_content img.avatar {
260
+ display: inline;
261
+ float: left;
262
+ margin: 3px .8em 5px 0;
263
+ }
264
+ #qfi_main .qfi_content img#paypal_button {
265
+ max-width: 195px;
266
+ }
267
+ .qfi_ad_for_pro {
268
+ font-weight: bold;
269
+ }
270
+ /* If auto-folding of the admin menu */
271
+ @media only screen and (max-width: 900px) {
272
+ /* dissolve floating */
273
+ #qfi_main,
274
+ #qfi_footer,
275
+ #qfi_main .qfi_content,
276
+ #qfi_footer .qfi_content {
277
+ float: none;
278
+ width: auto;
279
+ margin: 0;
280
+ }
281
+ #progress #bar span {
282
+ line-height: 4;
283
+ }
284
+ }
285
+ /* Smartphone */
286
+ @media screen and (max-width: 600px) {
287
+ /* Progress Bar */
288
+ #progress #bar span.sep,
289
+ #progress #bar span.wp-ui-notification,
290
+ #progress #bar strong.wp-ui-highlight {
291
+ display: block;
292
+ line-height: 1;
293
+ }
294
+ #progress #bar span.sep {
295
+ padding: .5em 1em;
296
+ }
297
+ /* floating halfs */
298
+ .toplevel_page_quick-featured-images-overview #qfi_main .qfi_content li,
299
+ .qfi_w50percent {
300
+ float: none;
301
+ width: auto;
302
+ height: auto;
303
+ }
304
+ }
admin/assets/css/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
admin/assets/images/first-content-image.gif ADDED
Binary file
admin/assets/images/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
admin/assets/images/logo_qfi_pro.gif ADDED
Binary file
admin/assets/images/overwrite-image.jpg ADDED
Binary file
admin/assets/images/posts_list_w_image_column.gif ADDED
Binary file
admin/assets/js/admin-defaults.js ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( document ).ready( function( $ ){
2
+
3
+ /*
4
+ * Media uploader
5
+ */
6
+
7
+ // placeholder url
8
+ var blank_url = $( '#placeholder_url' ).val();
9
+
10
+ // bind the media uploader at current and future ( 'live()' ) image upload buttons
11
+ $( '.imageupload' ).live( 'click', function( e ) {
12
+
13
+ e.preventDefault();
14
+
15
+ var custom_uploader;
16
+ // get number of row
17
+ var row_number = this.id.match( /[0-9]+/ );
18
+ // set selector names
19
+ var selector_image_id_element = '#image_id_' + row_number;
20
+ var selector_image_element = '#selected_image_' + row_number;
21
+
22
+ //Extend the wp.media object
23
+ var selector_upload_text = '#upload_image_XX';
24
+ custom_uploader = wp.media.frames.file_frame = wp.media( {
25
+ title: $( selector_upload_text ).val(),
26
+ button: {
27
+ text: $( selector_upload_text ).val()
28
+ },
29
+ multiple: false
30
+ } );
31
+
32
+ //When a file is selected, grab the URL and set it as the text field's value
33
+ custom_uploader.on( 'select', function() {
34
+ var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
35
+ $( selector_image_id_element ).val( attachment.id );
36
+ $( selector_image_element ).attr( 'src', attachment.url );
37
+ $( selector_image_element ).attr( 'class', 'attachment-thumbnail' );
38
+ $( selector_image_element ).attr( 'style', 'width:80px; display: block;' );
39
+ } );
40
+
41
+ //Open the uploader dialog
42
+ custom_uploader.open();
43
+
44
+ } );
45
+
46
+ /*
47
+ * Remove rule row
48
+ */
49
+ // clear default image
50
+ selector_clear_image_button = '.remove_rule';
51
+ $( selector_clear_image_button ).live( 'click', function( e ) {
52
+
53
+ e.preventDefault();
54
+
55
+ if( confirm( $( '#confirmation_question' ).val() ) ) {
56
+
57
+ // get number of row
58
+ var row_number = this.id.match( /[0-9]+/ );
59
+
60
+ // remove image if first row, else remove row
61
+ /*if ( '1' == row_number ) {
62
+ var selector_image_id_element = '#image_id_1';
63
+ var selector_image_element = '#selected_image_1';
64
+ $( selector_image_id_element ).val( 0 );
65
+ $( selector_image_element ).attr( 'src', blank_url );
66
+ $( selector_image_element ).attr( 'class', '' );
67
+ $( selector_image_element ).attr( 'style', '' );
68
+ $( selector_image_element ).attr( 'width', '' );
69
+ $( selector_image_element ).attr( 'height', '' );
70
+ } else {
71
+ $( '#row_' + row_number ).remove();
72
+ }*/
73
+ $( '#row_' + row_number ).remove();
74
+ }
75
+ } );
76
+
77
+ /*
78
+ * Add rule row
79
+ */
80
+ $( '#add_rule_button' ).click( function( e ){
81
+
82
+ e.preventDefault();
83
+
84
+ // get template html
85
+ template_row = $( '#template_row' ).clone();
86
+ // detect new row number
87
+ row_number = parseInt( $( 'table.widefat tbody tr' ).last().prev().attr( 'id' ).match( /[0-9]+/ )) + 1;
88
+ if ( ! isFinite( row_number ) ) {
89
+ row_number = 2; // assume second row if not a valid number
90
+ }
91
+
92
+ // replace placeholder with row number:
93
+ // text replacements
94
+ template_row.find( '#image_id_XX' ).each( function( index, el ) {
95
+ el_val = String( $( el ).attr( 'name' ));
96
+ $( el ).attr( 'name', el_val.replace( 'XX', row_number ));
97
+ } );
98
+ template_row.find( '[ for*="taxonomy_XX" ]' ).each( function( index, el ) {
99
+ el_val = String( $( el ).attr( 'for' ));
100
+ $( el ).attr( 'for', el_val.replace( 'XX', row_number ));
101
+ } );
102
+ template_row.find( '#taxonomy_XX' ).each( function( index, el ) {
103
+ el_val = String( $( el ).attr( 'name' ));
104
+ $( el ).attr( 'name', el_val.replace( 'XX', row_number ));
105
+ } );
106
+ template_row.find( '[ for*="matchterm_XX" ]' ).each( function( index, el ) {
107
+ el_val = String( $( el ).attr( 'for' ));
108
+ $( el ).attr( 'for', el_val.replace( 'XX', row_number ));
109
+ } );
110
+ template_row.find( '#matchterm_XX' ).each( function( index, el ) {
111
+ el_val = String( $( el ).attr( 'name' ));
112
+ $( el ).attr( 'name', el_val.replace( 'XX', row_number ));
113
+ } );
114
+ // attribute replacements
115
+ template_row.attr( 'id', 'row_' + row_number );
116
+ template_row.find( 'td.num' ).text( row_number );
117
+ template_row.find( '#image_id_XX' ).attr( 'id', 'image_id_' + row_number );
118
+ template_row.find( '#selected_image_XX' ).attr( 'id', 'selected_image_' + row_number );
119
+ template_row.find( '#upload_image_XX' ).attr( 'name', 'upload_image_' + row_number );
120
+ template_row.find( '#upload_image_XX' ).attr( 'id', 'upload_image_' + row_number );
121
+ template_row.find( '#taxonomy_XX' ).attr( 'id', 'taxonomy_' + row_number );
122
+ template_row.find( '#matchterm_XX' ).attr( 'id', 'matchterm_' + row_number );
123
+ template_row.find( '#remove_rule_XX' ).attr( 'name', 'remove_rule_' + row_number );
124
+ template_row.find( '#remove_rule_XX' ).attr( 'id', 'remove_rule_' + row_number );
125
+ // add row color alternation if row number is odd
126
+ if ( row_number % 2 == 0 ) {
127
+ template_row.attr( 'class', 'alt' );
128
+ }
129
+
130
+ // display new row
131
+ template_row.insertBefore( '#template_row' );
132
+
133
+ } );
134
+
135
+ /*
136
+ * Do not submit template row
137
+ */
138
+ $( '#submit' ).click( function(){
139
+ $( '#template_row' ).remove();
140
+ return true;
141
+ } );
142
+
143
+ } );
admin/assets/js/admin.js ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( document ).ready( function( $ ){
2
+
3
+
4
+ // single image selection
5
+ var selector_single_image_button = '#upload_image_button';
6
+ $( selector_single_image_button ).click( function( e ) {
7
+
8
+ e.preventDefault();
9
+
10
+ var custom_uploader;
11
+
12
+ //Extend the wp.media object
13
+ custom_uploader = wp.media.frames.file_frame = wp.media( {
14
+ title: $( selector_single_image_button ).val(),
15
+ button: {
16
+ text: $( selector_single_image_button ).val()
17
+ },
18
+ multiple: false
19
+ } );
20
+
21
+ //When a file is selected, grab the URL and set it as the text field's value
22
+ custom_uploader.on( 'select', function() {
23
+ var selector_image = '#selected_image';
24
+ var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
25
+ $( '#image_id' ).val( attachment.id );
26
+ $( selector_image ).attr( 'src', attachment.url );
27
+ $( selector_image ).attr( 'class', 'attachment-thumbnail' );
28
+ $( selector_image ).attr( 'style', 'width:95%' );
29
+ } );
30
+
31
+ //Open the uploader dialog
32
+ custom_uploader.open();
33
+
34
+ } );
35
+
36
+ // multiple images selection
37
+ var selector_multiple_images_button = '#select_images_multiple';
38
+ $( selector_multiple_images_button ).click( function( e ) {
39
+
40
+ e.preventDefault();
41
+
42
+ var custom_uploader;
43
+
44
+ //Extend the wp.media object
45
+ custom_uploader = wp.media.frames.file_frame = wp.media( {
46
+ title: $( selector_multiple_images_button ).val(),
47
+ button: {
48
+ text: $( selector_multiple_images_button ).val()
49
+ },
50
+ multiple: true
51
+ } );
52
+
53
+ //When a file is selected, grab the URL and set it as the text field's value
54
+ custom_uploader.on( 'select', function() {
55
+ var attachments = custom_uploader.state().get( 'selection' ).toJSON();
56
+ var attachments_ids = [];
57
+ for ( i = 0; i < attachments.length; i++ ) {
58
+ attachments_ids[ i ] = attachments[ i ].id
59
+ }
60
+ $( '#multiple_image_ids' ).val( attachments_ids.toString() );
61
+ } );
62
+
63
+ //Open the uploader dialog
64
+ custom_uploader.open();
65
+
66
+ } );
67
+
68
+ } );
admin/assets/js/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
admin/class-quick-featured-images-admin.php ADDED
@@ -0,0 +1,577 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Quick Featured Images
4
+ *
5
+ * @package Quick_Featured_Images
6
+ * @author Martin Stehle <m.stehle@gmx.de>
7
+ * @license GPL-2.0+
8
+ * @link http://stehle-internet.de
9
+ * @copyright 2014 Martin Stehle
10
+ */
11
+
12
+ class Quick_Featured_Images_Admin {
13
+
14
+ /**
15
+ * Plugin version, used for cache-busting of style and script file references.
16
+ *
17
+ * @since 1.0.0
18
+ * @updated with every version
19
+ *
20
+ * @var string
21
+ */
22
+ protected $plugin_version = '11.0';
23
+
24
+ /**
25
+ * Instance of this class.
26
+ *
27
+ * @since 1.0.0
28
+ *
29
+ * @var object
30
+ */
31
+ protected static $instance = null;
32
+
33
+ /**
34
+ * Required user capability to use this plugin
35
+ *
36
+ * @since 7.0
37
+ *
38
+ * @var string
39
+ */
40
+ protected $required_user_cap = 'edit_others_posts'; // minimum required right to see this plugin in the WP backend
41
+
42
+ /**
43
+ * Slug of the plugin screen.
44
+ *
45
+ * @since 7.0
46
+ *
47
+ * @var string
48
+ */
49
+ protected $plugin_screen_hook_suffix = null;
50
+
51
+ /**
52
+ * Name of this plugin.
53
+ *
54
+ *
55
+ * @since 4.1
56
+ *
57
+ * @var string
58
+ */
59
+ protected $plugin_name = 'Quick Featured Images';
60
+
61
+ /**
62
+ * Unique identifier for your plugin.
63
+ *
64
+ *
65
+ * The variable is used as the text domain when internationalizing strings
66
+ * of text. Its value should match the Text Domain file header in the main
67
+ * plugin file.
68
+ *
69
+ * @since 1.0.0
70
+ *
71
+ * @var string
72
+ */
73
+ protected $plugin_slug = 'quick-featured-images';
74
+
75
+ /**
76
+ * Unique slug for the admin page of this class
77
+ *
78
+ * @since 7.0
79
+ *
80
+ * @var string
81
+ */
82
+ protected $page_slug = 'quick-featured-images-overview';
83
+
84
+ /**
85
+ * Unique identifier in the WP options table
86
+ *
87
+ * @since 7.0
88
+ *
89
+ * @var string
90
+ */
91
+ private $settings_db_slug = 'quick-featured-images-settings';
92
+
93
+ /**
94
+ * Initialize the plugin by setting localization and loading public scripts
95
+ * and styles.
96
+ *
97
+ * @since 1.0.0
98
+ * @updated 3.2.1: hook on displaying a message after plugin activation
99
+ * @updated 8.0: removed action display_menu_icon
100
+ */
101
+ private function __construct() {
102
+
103
+ // Load plugin text domain
104
+ add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
105
+
106
+ // Activate plugin when new blog is added
107
+ add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
108
+
109
+ // Add the admin page and menu item.
110
+ add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ) );
111
+
112
+ // Load admin style sheet and JavaScript.
113
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
114
+
115
+ // style for top level menu item
116
+ //add_action( 'admin_head', array( $this, 'display_menu_icon' ) );
117
+
118
+ // hook on displaying a message after plugin activation
119
+ // if single activation via link or bulk activation
120
+ if ( isset( $_GET[ 'activate' ] ) or isset( $_GET[ 'activate-multi' ] ) ) {
121
+ $plugin_was_activated = get_transient( $this->plugin_slug );
122
+ if ( false !== $plugin_was_activated ) {
123
+ add_action( 'admin_notices', array( $this, 'display_activation_message' ) );
124
+ delete_transient( $this->plugin_slug );
125
+ }
126
+ }
127
+ }
128
+
129
+ /**
130
+ *
131
+ * Render the header of the admin page
132
+ *
133
+ * @access public
134
+ * @since 7.0
135
+ */
136
+ public function main() {
137
+ $this->display_header();
138
+ include_once( 'views/section_overview.php' );
139
+ $this->display_footer();
140
+ }
141
+
142
+ /**
143
+ * Return an instance of this class.
144
+ *
145
+ * @since 1.0.0
146
+ *
147
+ * @return object A single instance of this class.
148
+ */
149
+ public static function get_instance() {
150
+
151
+ // If the single instance hasn't been set, set it now.
152
+ if ( null == self::$instance ) {
153
+ self::$instance = new self;
154
+ }
155
+
156
+ return self::$instance;
157
+ }
158
+
159
+ /**
160
+ * Return the plugin name.
161
+ *
162
+ * @since 4.1
163
+ *
164
+ * @return Plugin name variable.
165
+ */
166
+ public function get_plugin_name() {
167
+ return $this->plugin_name;
168
+ }
169
+
170
+ /**
171
+ * Return the plugin slug.
172
+ *
173
+ * @since 1.0.0
174
+ *
175
+ *@return Plugin slug variable.
176
+ */
177
+ public function get_plugin_slug() {
178
+ return $this->plugin_slug;
179
+ }
180
+
181
+ /**
182
+ * Return the page headline.
183
+ *
184
+ * @since 7.0
185
+ *
186
+ *@return page headline variable.
187
+ */
188
+ public function get_page_headline() {
189
+ $text = 'Overview';
190
+ return __( $text );
191
+ }
192
+
193
+ /**
194
+ * Return the page description.
195
+ *
196
+ * @since 8.0
197
+ *
198
+ *@return page description variable.
199
+ */
200
+ public function get_page_description() {
201
+ return __( 'Your time-saving Swiss Army Knife for featured images: Set, replace and delete them in bulk, set default images, get overview lists.', $this->plugin_slug );
202
+ }
203
+
204
+ /**
205
+ * Return the page slug.
206
+ *
207
+ * @since 7.0
208
+ *
209
+ *@return page slug variable.
210
+ */
211
+ public function get_page_slug() {
212
+ return $this->page_slug;
213
+ }
214
+
215
+ /**
216
+ * Return the plugin version.
217
+ *
218
+ * @since 7.0
219
+ *
220
+ *@return Plugin version variable.
221
+ */
222
+ public function get_plugin_version() {
223
+ return $this->plugin_version;
224
+ }
225
+
226
+ /**
227
+ * Return the options slug in the WP options table.
228
+ *
229
+ * @since 7.0
230
+ *
231
+ * @return Plugin slug variable.
232
+ */
233
+ public function get_settings_db_slug() {
234
+ return $this->settings_db_slug;
235
+ }
236
+
237
+ /**
238
+ * Fired when the plugin is activated.
239
+ *
240
+ * @since 1.0.0
241
+ *
242
+ * @param boolean $network_wide True if WPMU superadmin uses
243
+ * "Network Activate" action, false if
244
+ * WPMU is disabled or plugin is
245
+ * activated on an individual blog.
246
+ */
247
+ public static function activate( $network_wide ) {
248
+
249
+ // Lowest Wordpress version to run with this plugin
250
+ $required_wp_version = '3.8'; /* because of dashicons, at least 3.7 because of WP_DATE_QUERY */
251
+ $plugin_slug = 'quick-featured-images';
252
+
253
+ // check minimum version
254
+ if ( ! version_compare( $GLOBALS['wp_version'], $required_wp_version, '>=' ) ) {
255
+ // deactivate plugin
256
+ deactivate_plugins( plugin_basename( __FILE__ ), false, is_network_admin() );
257
+ // load language file for a message in the language of the WP installation
258
+ load_plugin_textdomain( $plugin_slug, false, dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' );
259
+ // stop WP request and display the message with backlink. Is there a proper way than wp_die()?
260
+ wp_die(
261
+ // message in browser viewport
262
+ sprintf(
263
+ '<p>%s</p>',
264
+ sprintf(
265
+ __( 'The plugin requires WordPress version %s or higher. Therefore, WordPress did not activate it. If you want to use this plugin update the Wordpress files to the latest version.', $plugin_slug ),
266
+ $required_wp_version
267
+ )
268
+ ),
269
+ // title in title tag
270
+ 'Wordpress &rsaquo; Plugin Activation Error',
271
+ array(
272
+ // HTML status code returned
273
+ 'response' => 200,
274
+ // display a back link in the returned page
275
+ 'back_link' => true
276
+ )
277
+ );
278
+ }
279
+
280
+ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
281
+
282
+ if ( $network_wide ) {
283
+
284
+ // Get all blog ids
285
+ $blog_ids = self::get_blog_ids();
286
+
287
+ foreach ( $blog_ids as $blog_id ) {
288
+
289
+ switch_to_blog( $blog_id );
290
+ self::single_activate();
291
+ }
292
+
293
+ restore_current_blog();
294
+
295
+ } else {
296
+ self::single_activate();
297
+ }
298
+
299
+ } else {
300
+ self::single_activate();
301
+ }
302
+
303
+ }
304
+
305
+ /**
306
+ * Fired when the plugin is deactivated.
307
+ *
308
+ * @since 1.0.0
309
+ *
310
+ * @param boolean $network_wide True if WPMU superadmin uses
311
+ * "Network Deactivate" action, false if
312
+ * WPMU is disabled or plugin is
313
+ * deactivated on an individual blog.
314
+ */
315
+ public static function deactivate( $network_wide ) {
316
+
317
+ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
318
+
319
+ if ( $network_wide ) {
320
+
321
+ // Get all blog ids
322
+ $blog_ids = self::get_blog_ids();
323
+
324
+ foreach ( $blog_ids as $blog_id ) {
325
+
326
+ switch_to_blog( $blog_id );
327
+ self::single_deactivate();
328
+
329
+ }
330
+
331
+ restore_current_blog();
332
+
333
+ } else {
334
+ self::single_deactivate();
335
+ }
336
+
337
+ } else {
338
+ self::single_deactivate();
339
+ }
340
+
341
+ }
342
+
343
+ /**
344
+ * Fired when a new site is activated with a WPMU environment.
345
+ *
346
+ * @since 1.0.0
347
+ *
348
+ * @param int $blog_id ID of the new blog.
349
+ */
350
+ public function activate_new_site( $blog_id ) {
351
+
352
+ if ( 1 !== did_action( 'wpmu_new_blog' ) ) {
353
+ return;
354
+ }
355
+
356
+ switch_to_blog( $blog_id );
357
+ self::single_activate();
358
+ restore_current_blog();
359
+
360
+ }
361
+
362
+ /**
363
+ * Get all blog ids of blogs in the current network that are:
364
+ * - not archived
365
+ * - not spam
366
+ * - not deleted
367
+ *
368
+ * @since 1.0.0
369
+ *
370
+ * @return array|false The blog ids, false if no matches.
371
+ */
372
+ private static function get_blog_ids() {
373
+
374
+ global $wpdb;
375
+
376
+ // get an array of blog ids
377
+ $sql = "SELECT blog_id FROM $wpdb->blogs WHERE archived = '0' AND spam = '0' AND deleted = '0'";
378
+ return $wpdb->get_col( $sql );
379
+
380
+ }
381
+
382
+ /**
383
+ * Fired for each blog when the plugin is activated.
384
+ *
385
+ * @since 1.0.0
386
+ * @updated 3.2.1: added setting of transient
387
+ */
388
+ private static function single_activate() {
389
+ // store the flag into the db to trigger the display of a message after activation
390
+ set_transient( 'quick-featured-images', '1', 60 ); // plugin_slug
391
+ }
392
+
393
+ /**
394
+ * Fired for each blog when the plugin is deactivated.
395
+ *
396
+ * @since 1.0.0
397
+ */
398
+ private static function single_deactivate() {
399
+ // @TODO: Define deactivation functionality here
400
+ }
401
+
402
+ /**
403
+ * Load the plugin text domain for translation.
404
+ *
405
+ * @since 1.0.0
406
+ */
407
+ public function load_plugin_textdomain() {
408
+
409
+ $domain = $this->plugin_slug;
410
+ #$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
411
+ #load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo' );
412
+ load_plugin_textdomain( $domain, false, dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' );
413
+
414
+ }
415
+
416
+ /**
417
+ * Register and enqueue public-facing style sheet.
418
+ *
419
+ * @since 1.0.0
420
+ */
421
+ public function enqueue_admin_styles() {
422
+
423
+ if ( ! isset( $this->plugin_screen_hook_suffix ) ) {
424
+ return;
425
+ }
426
+
427
+ // request css only if this plugin was called
428
+ $screen = get_current_screen();
429
+ if ( $this->plugin_screen_hook_suffix == $screen->id ) {
430
+ wp_enqueue_style( $this->plugin_slug . '-plugin-styles', plugins_url( 'assets/css/admin.css', __FILE__ ), array(), $this->plugin_version );
431
+ }
432
+ }
433
+
434
+ /**
435
+ * Returns the url to the installation folder of this plugin
436
+ *
437
+ * @since 1.0.0
438
+ */
439
+ public function get_plugin_base_url () {
440
+ return dirname( plugin_dir_url( __FILE__ ) );
441
+ }
442
+
443
+ /**
444
+ * Returns the url of the plugin's public part
445
+ *
446
+ * @since 1.0.0
447
+ */
448
+ public function get_plugin_public_url () {
449
+ return plugin_dir_url( __FILE__ );
450
+ }
451
+
452
+ /**
453
+ * Print a message about the location of the plugin in the WP backend
454
+ *
455
+ * @since 3.2.1
456
+ * @updated 7.0: changed url and message (page moved from media sub menu to own object menu)
457
+ */
458
+ public function display_activation_message () {
459
+ $url = admin_url( sprintf( 'admin.php?page=%s', $this->page_slug ) );
460
+ $text = 'Featured Images';
461
+ $link = sprintf( '<a href="%s">%s</a>', $url, __( $text ) );
462
+ $msg = sprintf( __( 'Welcome to %s! You can find the plugin at %s.', $this->plugin_slug ), $this->plugin_name, $link );
463
+ $html = sprintf( '<div class="updated"><p>%s</p></div>', $msg );
464
+ print $html;
465
+ }
466
+
467
+ /**
468
+ * Register the administration menu for this plugin into the WordPress Dashboard menu.
469
+ *
470
+ * @since 1.0.0
471
+ * @updated 4.1: change hard coded plugin name to variable
472
+ * @updated 7.0: page moved from media sub menu to own object menu
473
+ */
474
+ public function add_plugin_admin_menu() {
475
+
476
+ // get translated string of the menu label and page headline
477
+ $label = $this->get_page_headline();
478
+
479
+ $page_title = sprintf( '%s: %s', $this->plugin_name, $label );
480
+ $text = 'Featured Images';
481
+ $menu_title = __( $text );
482
+ $function = array( $this, 'main' ); // to execute when loading this page
483
+
484
+ /*
485
+ * Add the top level menu page of this plugin
486
+ *
487
+ */
488
+ $this->plugin_screen_hook_suffix = add_menu_page(
489
+ $page_title,
490
+ $menu_title, // menu_title
491
+ $this->required_user_cap, // capability to use the following function
492
+ $this->page_slug,
493
+ $function,
494
+ 'dashicons-images-alt2', // icon
495
+ 11 // position after menu item 'Media'
496
+ );
497
+
498
+ // Give first sub level menu link a different label than the top level menu link
499
+ // by calling the add_submenu_page function the first time with the parent_slug and menu_slug as same values
500
+ add_submenu_page(
501
+ $this->page_slug, // parent slug
502
+ $page_title,
503
+ $label, // menu_title
504
+ $this->required_user_cap, // capability to use the following function
505
+ $this->page_slug, // menu slug
506
+ $function
507
+ );
508
+
509
+ }
510
+
511
+ /**
512
+ *
513
+ * Render the header of the admin page
514
+ *
515
+ * @access private
516
+ * @since 1.0.0
517
+ */
518
+ private function display_header() {
519
+ include_once( 'views/section_header.php' );
520
+ }
521
+
522
+ /**
523
+ *
524
+ * Render the footer of the admin page
525
+ *
526
+ * @access private
527
+ * @since 1.0.0
528
+ */
529
+ private function display_footer() {
530
+ include_once( 'views/section_footer.php' );
531
+ }
532
+
533
+ /**
534
+ * Print icon for top level menu item of this plugin
535
+ *
536
+ * @since 7.0
537
+ * @updated 8.0: deprecated
538
+ *
539
+ * @return null
540
+ */
541
+ /*public function display_menu_icon(){
542
+ print '<style type="text/css">';
543
+ print '/* Quick Featured Images Menu Icon * /';
544
+ print "\n";
545
+ printf( '#toplevel_page_%s .dashicons-admin-generic:before {', $this->page_slug );
546
+ #print ' content: "\f232";';
547
+ #print ' content: "\f233";';
548
+ print '}';
549
+ print "\n";
550
+ print '</style>';
551
+ }*/
552
+
553
+ }
554
+
555
+ /**
556
+ * Library class for all QFI classes with common variables and functions
557
+ * Status: experimental, actually not in use
558
+ *
559
+ * @since: 8.0
560
+ *
561
+ */
562
+ class Quick_Featured_Images_Base {
563
+
564
+ /**
565
+ * For development: Display a var_dump() of the variable within HTML 'pre' elements and die if true
566
+ *
567
+ * about the term dambedei (read: "dump and die"): If you know what it is you know my home region ;-)
568
+ *
569
+ * @since 1.0.0
570
+ */
571
+ function dambedei ( $v, $die = false ) {
572
+ print "<pre>";
573
+ var_dump( $v );
574
+ print "</pre>";
575
+ if ( $die ) die();
576
+ }
577
+ }
admin/class-quick-featured-images-columns.php ADDED
@@ -0,0 +1,307 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Quick Featured Images
4
+ *
5
+ * @package Quick_Featured_Images_Columns
6
+ * @author Martin Stehle <m.stehle@gmx.de>
7
+ * @license GPL-2.0+
8
+ * @link http://wordpress.org/plugins/quick-featured-images/
9
+ * @copyright 2014
10
+ */
11
+
12
+ /**
13
+ * @package Quick_Featured_Images_Columns
14
+ * @author Martin Stehle <m.stehle@gmx.de>
15
+ */
16
+ class Quick_Featured_Images_Columns {
17
+
18
+ /**
19
+ * Instance of this class.
20
+ *
21
+ * @since 7.0
22
+ *
23
+ * @var object
24
+ */
25
+ protected static $instance = null;
26
+
27
+ /**
28
+ * Slug of the plugin screen.
29
+ *
30
+ * @since 7.0
31
+ *
32
+ * @var string
33
+ */
34
+ protected $plugin_screen_hook_suffix = null;
35
+
36
+ /**
37
+ * Name of this plugin.
38
+ *
39
+ * @since 7.0
40
+ *
41
+ * @var string
42
+ */
43
+ protected $plugin_name = null;
44
+
45
+ /**
46
+ * Unique identifier for this plugin.
47
+ *
48
+ * It is the same as in class Quick_Featured_Images_Admin
49
+ * Has to be set here to be used in non-object context, e.g. callback functions
50
+ *
51
+ * @since 7.0
52
+ *
53
+ * @var string
54
+ */
55
+ protected $plugin_slug = null;
56
+
57
+ /**
58
+ * Plugin version, used for cache-busting of style and script file references.
59
+ *
60
+ * @since 7.0
61
+ *
62
+ * @var string
63
+ */
64
+ protected $plugin_version = null;
65
+
66
+ /**
67
+ * Unique identifier in the WP options table
68
+ *
69
+ *
70
+ * @since 7.0
71
+ *
72
+ * @var string
73
+ */
74
+ protected $settings_db_slug = null;
75
+
76
+ /**
77
+ * Stored settings in an array
78
+ *
79
+ *
80
+ * @since 7.0
81
+ *
82
+ * @var array
83
+ */
84
+ protected $stored_settings = array();
85
+
86
+ /**
87
+ * Name of the additional column.
88
+ *
89
+ * @since 7.0
90
+ *
91
+ * @var string
92
+ */
93
+ protected $column_name = 'qfi-thumbnail';
94
+
95
+ /**
96
+ * Initialize the plugin by loading admin scripts & styles and adding a
97
+ * settings page and menu.
98
+ *
99
+ * @since 7.0
100
+ *
101
+ * @updated 8.3.1: sanitized recognition of key names, fixed bug on displaying undesired columns
102
+ * @updated 9.0: added column sort function
103
+ */
104
+ private function __construct() {
105
+
106
+ // Call variables from public plugin class.
107
+ $plugin = Quick_Featured_Images_Admin::get_instance();
108
+ $this->plugin_name = $plugin->get_plugin_name();
109
+ $this->plugin_slug = $plugin->get_plugin_slug();
110
+ $this->plugin_version = $plugin->get_plugin_version();
111
+ $this->settings_db_slug = $plugin->get_settings_db_slug();
112
+
113
+ // add featured image columns if desired
114
+ $add_column_function = array( $this, 'add_thumbnail_column' );
115
+ $display_column_function = array( $this, 'display_thumbnail_in_column' );
116
+ $add_sort_function = array( $this, 'add_sortable_column' );
117
+ // get current or default settings
118
+ $this->stored_settings = get_option( $this->settings_db_slug, array() );
119
+
120
+ // add Featured Image column in desired posts lists
121
+ foreach ( $this->stored_settings as $key => $value ) {
122
+ if ( '1' == $value ) {
123
+ if ( preg_match('/^column_thumb_([a-z0-9_\-]+)$/', $key, $matches ) ) {
124
+ // make the following lines more readable
125
+ $post_type = $matches[ 1 ];
126
+
127
+ // get the hook name for the columns filter
128
+ $hook = sprintf( 'manage_%s_posts_columns', $post_type );
129
+ // add a column to list of desired post type and
130
+ // sanitizing: check with has_filter() to prevent multiple columns in a row
131
+ if ( ! has_filter( $hook, $add_column_function ) ) {
132
+ add_filter( $hook, $add_column_function );
133
+ }
134
+
135
+ // get the hook name for the sortable columns filter
136
+ $hook = sprintf( 'manage_edit-%s_sortable_columns', $post_type );
137
+ // add the column to list of sortable columns
138
+ // sanitizing: check with has_filter() to prevent more than 1 call
139
+ if ( ! has_filter( $hook, $add_sort_function ) ) {
140
+ add_filter( $hook, $add_sort_function );
141
+ }
142
+
143
+ // get the hook name for the column edit action
144
+ $hook = sprintf( 'manage_%s_posts_custom_column', $post_type );
145
+ // add thumbnail in column per post
146
+ // sanitizing: check with has_filter() to prevent multiple contents in a column
147
+ if ( ! has_action( $hook, $display_column_function ) ) {
148
+ add_action( $hook, $display_column_function, 10, 2 );
149
+ }
150
+
151
+ } // if ( preg_match() )
152
+ } // if ( value == 1 )
153
+ } // foreach( stored_settings )
154
+
155
+ // load admin style sheet
156
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
157
+ // print style for thumbnail column
158
+ add_action( 'admin_head', array( $this, 'display_thumbnail_column_style' ) );
159
+ // define image column sort order
160
+ add_filter( 'pre_get_posts', array( $this, 'sort_column_by_image_id' ) );
161
+ }
162
+
163
+ /**
164
+ * Return an instance of this class.
165
+ *
166
+ * @since 7.0
167
+ *
168
+ * @return object A single instance of this class.
169
+ */
170
+ public static function get_instance() {
171
+
172
+ // If the single instance hasn't been set, set it now.
173
+ if ( null == self::$instance ) {
174
+ self::$instance = new self;
175
+ }
176
+
177
+ return self::$instance;
178
+ }
179
+
180
+ /**
181
+ * Register and enqueue admin-specific style sheet.
182
+ *
183
+ * @since 7.0
184
+ *
185
+ * @return null
186
+ */
187
+ public function enqueue_admin_styles() {
188
+
189
+ if ( ! isset( $this->plugin_screen_hook_suffix ) ) {
190
+ return;
191
+ }
192
+
193
+ // request css only if this plugin was called
194
+ $screen = get_current_screen();
195
+ if ( $this->plugin_screen_hook_suffix == $screen->id ) {
196
+ wp_enqueue_style( $this->plugin_slug .'-admin-styles', plugins_url( 'assets/css/admin.css', __FILE__ ), array( ), $this->plugin_version );
197
+ }
198
+
199
+ }
200
+
201
+ /**
202
+ * Add a column with the title 'Featured Image' in the post lists
203
+ *
204
+ * @since 7.0
205
+ *
206
+ * @return array list of columns
207
+ */
208
+ public function add_thumbnail_column( $cols ) {
209
+ $text = 'Featured Image';
210
+ $cols[ $this->column_name ] = __( $text );
211
+ return $cols;
212
+ }
213
+
214
+ /**
215
+ * Add the Featured Image column to sortable columns
216
+ *
217
+ * @since 9.0
218
+ *
219
+ * @return array extended list of sortable columns
220
+ */
221
+ public function add_sortable_column( $cols ) {
222
+ $cols[ $this->column_name ] = $this->column_name;
223
+
224
+ return $cols;
225
+ }
226
+
227
+ /**
228
+ * Print the featured image in the column
229
+ *
230
+ * @since 7.0
231
+ * @updated 9.1: revised label text for WP 4.1
232
+ *
233
+ * @return array extended list of columns
234
+ */
235
+ public function display_thumbnail_in_column( $column_name, $post_id ) {
236
+ /*
237
+ // export to class wide vars to call it only once
238
+ $max_dimension = 110; // width of thumbnail column in px at 1024 px window width
239
+ $default_value = $max_dimension * 2;
240
+ // set dimensions with values in Settings => Media => Thumbnail Size
241
+ $width = absint( get_option( 'thumbnail_size_w', $default_value ) / 2 );
242
+ $height = absint( get_option( 'thumbnail_size_h', $default_value ) / 2 );
243
+ // set maximum value if necessary
244
+ $width = $width > $max_dimension ? $max_dimension : $width;
245
+ $height = $height > $max_dimension ? $max_dimension : $height;
246
+ */
247
+ $width = $height = 80;
248
+ if ( $this->column_name == $column_name ) {
249
+ $thumbnail_id = get_post_thumbnail_id( $post_id );
250
+ // image from gallery
251
+ if ( $thumbnail_id ) {
252
+ echo wp_get_attachment_image( $thumbnail_id, array( $width, $height ) );
253
+ } else {
254
+ $text = 'No image set';
255
+ echo __( $text );
256
+ }
257
+ }
258
+ }
259
+
260
+ /**
261
+ * Print CSS for image column
262
+ *
263
+ * @since 7.0
264
+ *
265
+ * @return null
266
+ */
267
+ public function display_thumbnail_column_style(){
268
+ print '<style type="text/css">';
269
+ print '/* Quick Featured Images plugin styles */';
270
+ print "\n";
271
+ print '/* Fit thumbnails in posts list column */';
272
+ printf( '.column-%s img {', $this->column_name );
273
+ print ' width: 100%;';
274
+ print ' height: auto;';
275
+ printf( ' max-width: %dpx;', 80 );
276
+ printf( ' max-height: %dpx;', 80 );
277
+ print '}';
278
+ print "\n";
279
+ print '/* Auto-hiding of the thumbnail column in posts lists */';
280
+ print '@media screen and ( max-width: 782px ) {';
281
+ printf( ' .column-%s {', $this->column_name );
282
+ print ' display: none;';
283
+ print ' }';
284
+ print '}';
285
+ print "\n";
286
+ print '</style>';
287
+ }
288
+
289
+ /**
290
+ * Define sort order: order posts by featured image id
291
+ *
292
+ * @since 9.0
293
+ *
294
+ * @param $query
295
+ */
296
+ public function sort_column_by_image_id( $query ) {
297
+
298
+ // if user wants to get rows sorted by featured image
299
+ if ( $query->get( 'orderby' ) === $this->column_name ) {
300
+ // set thumbnail id as sort value
301
+ $query->set( 'meta_key', '_thumbnail_id' );
302
+ // change sorting from alphabetical to numeric
303
+ $query->set( 'orderby', 'meta_value_num' );
304
+ }
305
+ }
306
+
307
+ }
admin/class-quick-featured-images-defaults.php ADDED
@@ -0,0 +1,754 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Quick Featured Images
4
+ *
5
+ * @package Quick_Featured_Images_Defaults
6
+ * @author Martin Stehle <m.stehle@gmx.de>
7
+ * @license GPL-2.0+
8
+ * @link http://stehle-internet.de/downloads/quick-featured-images/
9
+ * @copyright 2014
10
+ */
11
+
12
+ /**
13
+ * @package Quick_Featured_Images_Defaults
14
+ * @author Martin Stehle <m.stehle@gmx.de>
15
+ */
16
+ class Quick_Featured_Images_Defaults {
17
+
18
+ /**
19
+ * Instance of this class.
20
+ *
21
+ * @since 8.0
22
+ *
23
+ * @var object
24
+ */
25
+ protected static $instance = null;
26
+
27
+ /**
28
+ * Required user capability to use this plugin
29
+ *
30
+ * @since 8.0
31
+ *
32
+ * @var string
33
+ */
34
+ protected $required_user_cap = 'edit_others_posts';
35
+
36
+ /**
37
+ * Slug of the plugin screen.
38
+ *
39
+ * @since 8.0
40
+ *
41
+ * @var string
42
+ */
43
+ protected $plugin_screen_hook_suffix = null;
44
+
45
+ /**
46
+ * Name of this plugin.
47
+ *
48
+ * @since 8.0
49
+ *
50
+ * @var string
51
+ */
52
+ protected $plugin_name = null;
53
+
54
+ /**
55
+ * Unique identifier for this plugin.
56
+ *
57
+ * It is the same as in class Quick_Featured_Images_Admin
58
+ * Has to be set here to be used in non-object context, e.g. callback functions
59
+ *
60
+ * @since 8.0
61
+ *
62
+ * @var string
63
+ */
64
+ protected $plugin_slug = null;
65
+
66
+ /**
67
+ * Unique identifier for the admin page of this class.
68
+ *
69
+ * @since 8.0
70
+ *
71
+ * @var string
72
+ */
73
+ protected $page_slug = null;
74
+
75
+ /**
76
+ * Unique identifier for the admin parent page of this class.
77
+ *
78
+ * @since 8.0
79
+ *
80
+ * @var string
81
+ */
82
+ protected $parent_page_slug = null;
83
+
84
+ /**
85
+ * Plugin version, used for cache-busting of style and script file references.
86
+ *
87
+ * @since 8.0
88
+ *
89
+ * @var string
90
+ */
91
+ protected $plugin_version = null;
92
+
93
+ /**
94
+ * Unique identifier in the WP options table
95
+ *
96
+ *
97
+ * @since 8.0
98
+ *
99
+ * @var string
100
+ */
101
+ protected $settings_db_slug = 'quick-featured-images-defaults';
102
+
103
+ /**
104
+ * Slug of the menu page on which to display the form sections
105
+ *
106
+ *
107
+ * @since 8.0
108
+ *
109
+ * @var array
110
+ */
111
+ protected $main_options_page_slug = 'quick-featured-images-defaultspage';
112
+
113
+ /**
114
+ * Group name of options
115
+ *
116
+ *
117
+ * @since 8.0
118
+ *
119
+ * @var array
120
+ */
121
+ protected $settings_fields_slug = 'quick-featured-images-defaults';
122
+
123
+ /**
124
+ * Stored settings in an array
125
+ *
126
+ *
127
+ * @since 8.0
128
+ *
129
+ * @var array
130
+ */
131
+ protected $stored_settings = array();
132
+
133
+ /**
134
+ * User selected rules
135
+ *
136
+ * @since 8.0
137
+ *
138
+ * @var string
139
+ */
140
+ protected $selected_rules = null;
141
+
142
+ /**
143
+ * Initialize the plugin by loading admin scripts & styles and adding a
144
+ * settings page and menu.
145
+ *
146
+ * @since 8.0
147
+ */
148
+ private function __construct() {
149
+
150
+ // Call variables from public plugin class.
151
+ $plugin = Quick_Featured_Images_Admin::get_instance();
152
+ $this->plugin_name = $plugin->get_plugin_name();
153
+ $this->plugin_slug = $plugin->get_plugin_slug();
154
+ $this->page_slug = $this->plugin_slug . '-defaults';
155
+ $this->parent_page_slug = $plugin->get_page_slug();
156
+ $this->plugin_version = $plugin->get_plugin_version();
157
+
158
+ // Load admin style sheet and JavaScript.
159
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
160
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
161
+
162
+ // Add the options page and menu item.
163
+ add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ) );
164
+
165
+ // Auto set featured image on saving a post
166
+ add_action('save_post', array( $this, 'add_featured_image' ), 10 , 3 );
167
+
168
+ /*
169
+ // check whether the query parameter 'qfi_notice' is in the URL; if yes, show admin notice
170
+ if ( isset( $_REQUEST[ 'qfi_notice' ] ) ) {
171
+ add_action( 'admin_notices', array( $this, 'display_qfi_notice' ) );
172
+ }
173
+ */
174
+ }
175
+
176
+ /**
177
+ * Render the settings page for this plugin.
178
+ *
179
+ * @since 8.0
180
+ */
181
+ public function main() {
182
+ $this->display_header();
183
+ // store user selections
184
+ if ( ! empty( $_POST ) ) {
185
+ // verify allowed submission
186
+ check_admin_referer( 'save_default_images', 'knlk235rf' );
187
+ // sanitze user input
188
+ $settings = $this->sanitize_options( $_POST );
189
+ // store in db
190
+ if ( update_option( $this->settings_db_slug, $settings ) ) {
191
+ $msg = __( 'Changes saved.', $this->plugin_slug );
192
+ $class = 'updated';
193
+ } else {
194
+ $msg = __( 'No changes were saved.', $this->plugin_slug );
195
+ $class = 'error';
196
+ }
197
+ printf ( '<div class="%s"><p><strong>%s</strong></p></div>', $class, $msg );
198
+ }
199
+ // get rules
200
+ $this->selected_rules = $this->get_stored_settings();
201
+ // print rest of page
202
+ $this->display_page_content();
203
+ $this->display_footer();
204
+ }
205
+
206
+ /**
207
+ * Return an instance of this class.
208
+ *
209
+ * @since 8.0
210
+ *
211
+ * @return object A single instance of this class.
212
+ */
213
+ public static function get_instance() {
214
+
215
+ // If the single instance hasn't been set, set it now.
216
+ if ( null == self::$instance ) {
217
+ self::$instance = new self;
218
+ }
219
+
220
+ return self::$instance;
221
+ }
222
+
223
+ /**
224
+ * Return the page headline.
225
+ *
226
+ * @since 8.0
227
+ *
228
+ *@return page headline variable.
229
+ */
230
+ public function get_page_headline() {
231
+ return __( 'Preset Featured Images', $this->plugin_slug );
232
+ }
233
+
234
+ /**
235
+ * Return the page description.
236
+ *
237
+ * @since 8.0
238
+ *
239
+ *@return page description variable.
240
+ */
241
+ public function get_page_description() {
242
+ return __( 'Set default featured images for future posts', $this->plugin_slug );
243
+ }
244
+
245
+ /**
246
+ * Return the page slug.
247
+ *
248
+ * @since 8.0
249
+ *
250
+ *@return page slug variable.
251
+ */
252
+ public function get_page_slug() {
253
+ return $this->page_slug;
254
+ }
255
+
256
+ /**
257
+ * Return the required user capability.
258
+ *
259
+ * @since 8.0
260
+ *
261
+ *@return required user capability variable.
262
+ */
263
+ public function get_required_user_cap() {
264
+ return $this->required_user_cap;
265
+ }
266
+
267
+ /**
268
+ * Define parameters and return thumbnail supporting custom post types
269
+ *
270
+ * @access private
271
+ * @since 7.0
272
+ *
273
+ * @return array the names and labels of the registered and thumbnail supporting custom post types
274
+ */
275
+ private function get_custom_post_types_labels() {
276
+ $args = array(
277
+ '_builtin' => false # only custom post types
278
+ );
279
+ $name_labels = array();
280
+ // get the registered custom post types as objects
281
+ $objects = get_post_types( $args, 'objects' );
282
+ // store their names and labels
283
+ foreach ( $objects as $name => $object ) {
284
+ if ( post_type_supports( $name, 'thumbnail' ) ) {
285
+ $name_labels[ $name ] = $object->label;
286
+ }
287
+ }
288
+ // return the result
289
+ return $name_labels;
290
+ }
291
+
292
+ /**
293
+ * Return registered custom taxonomies with their labels
294
+ *
295
+ * @access private
296
+ * @since 8.0
297
+ *
298
+ * @return array the names of the registered custom taxonomies
299
+ */
300
+ private function get_custom_taxonomies_labels() {
301
+ $args = array(
302
+ '_builtin' => false # only custon post types
303
+ );
304
+ $name_labels = array();
305
+ // get the registered custom post types as objects
306
+ $objects = get_taxonomies( $args, 'objects' );
307
+ // store their names and labels
308
+ foreach ( $objects as $name => $object ) {
309
+ $name_labels[ $name ] = $object->label;
310
+ }
311
+ // return the result
312
+ return $name_labels;
313
+ }
314
+
315
+ /**
316
+ * Get current or default settings
317
+ *
318
+ * @since 8.0
319
+ *
320
+ * @return array Return settings for default featured images
321
+ */
322
+ public function get_stored_settings() {
323
+ // try to load current settings. If they are not in the DB return set default settings
324
+ $stored_settings = get_option( $this->settings_db_slug, array() );
325
+ // if empty array set and store default values
326
+ if ( 0 == sizeof( $stored_settings ) ) {
327
+ $this->set_default_settings();
328
+ // try to load current settings again. Now there should be the data
329
+ $stored_settings = get_option( $this->settings_db_slug, array() );
330
+ }
331
+
332
+ return $this->sanitize_options( $stored_settings );
333
+ }
334
+
335
+ /**
336
+ * Register and enqueue admin-specific style sheet.
337
+ *
338
+ * @since 8.0
339
+ *
340
+ * @return null Return early if no settings page is registered.
341
+ */
342
+ public function enqueue_admin_styles() {
343
+
344
+ if ( ! isset( $this->plugin_screen_hook_suffix ) ) {
345
+ return;
346
+ }
347
+
348
+ // request css only if this plugin was called
349
+ $screen = get_current_screen();
350
+ if ( $this->plugin_screen_hook_suffix == $screen->id ) {
351
+ wp_enqueue_style( $this->plugin_slug .'-admin-styles', plugins_url( 'assets/css/admin.css', __FILE__ ), array( ), $this->plugin_version );
352
+ }
353
+
354
+ }
355
+
356
+ /**
357
+ * Register and enqueue admin-specific JavaScript.
358
+ *
359
+ * @since 8.0
360
+ *
361
+ * @return null Return early if no settings page is registered.
362
+ */
363
+ public function enqueue_admin_scripts() {
364
+
365
+ if ( ! isset( $this->plugin_screen_hook_suffix ) ) {
366
+ return;
367
+ }
368
+
369
+ /* collect js for the color picker */
370
+ $screen = get_current_screen();
371
+ if ( $this->plugin_screen_hook_suffix == $screen->id ) {
372
+ wp_enqueue_script( $this->plugin_slug . '-admin-script', plugins_url( 'assets/js/admin-defaults.js', __FILE__ ), array( 'jquery' ), $this->plugin_version );
373
+ }
374
+ }
375
+
376
+ /**
377
+ * Register the administration menu for this plugin into the WordPress Dashboard menu.
378
+ *
379
+ * @since 8.0
380
+ */
381
+ public function add_plugin_admin_menu() {
382
+
383
+ // get translated string of the menu label and page headline
384
+ $label = $this->get_page_headline();
385
+
386
+ // Add a defaults page for this plugin to the Settings menu.
387
+ $this->plugin_screen_hook_suffix = add_submenu_page(
388
+ $this->parent_page_slug, // parent_slug
389
+ sprintf( '%s: %s', $this->plugin_name, $label ), // page_title
390
+ $label, // menu_title
391
+ $this->required_user_cap, // capability to use the following function
392
+ $this->page_slug, // menu_slug
393
+ array( $this, 'main' ) // function to execute when loading this page
394
+ );
395
+
396
+ }
397
+
398
+ /**
399
+ * Add defaults action link to the plugins page.
400
+ *
401
+ * @since 8.0
402
+ */
403
+ public function add_action_links( $links ) {
404
+ $url = sprintf( 'admin.php?page=%s-defaults', $this->plugin_slug );
405
+ return array_merge(
406
+ $links,
407
+ array(
408
+ 'defaults' => sprintf( '<a href="%s">%s</a>', admin_url( $url ), $this->get_page_headline() )
409
+ )
410
+ );
411
+
412
+ }
413
+
414
+ /**
415
+ * Set default settings
416
+ *
417
+ * @since 8.0
418
+ */
419
+ private static function set_default_settings() {
420
+
421
+ $db_slug = 'quick-featured-images-settings'; // todo: get the value from $settings_db_slug both in object and non-object context
422
+ // check if there are already stored settings under the option's database slug
423
+ if ( false === get_option( $db_slug, false ) ) {
424
+ // store default values in the db as a single and serialized entry
425
+ add_option(
426
+ $db_slug,
427
+ array()
428
+ );
429
+ } // if ( false )
430
+
431
+ }
432
+
433
+ /**
434
+ * Check and return correct values for the settings
435
+ *
436
+ * @since 8.0
437
+ * @updated 8.1: add first image handling
438
+ *
439
+ * @param array $input Options and their values after submitting the form
440
+ *
441
+ * @return array Options and their sanatized values
442
+ */
443
+ public function sanitize_options ( $input ) {
444
+ $sanitized_input = array();
445
+ foreach ( $input as $key => $value ) {
446
+ // ignore values with 'false' value, ie. 'null', zero, empty string, empty array
447
+ if ( ! $value ) {
448
+ continue;
449
+ }
450
+ // checkboxes
451
+ if ( 'overwrite_automatically' == $key or 'use_first_image_as_default' == $key ) {
452
+ $sanitized_input[ $key ] = isset( $input[ $key ] ) ? '1' : '0';
453
+ continue;
454
+ }
455
+ // radio buttons
456
+ if ( 'first_image_handling' == $key ) {
457
+ $sanitized_input[ $key ] = ( in_array( $input[ $key ], array( 'always', 'use_if_no_img' ) ) ? $input[ $key ] : 'always' );
458
+ continue;
459
+ }
460
+ // positive integers
461
+ if ( 'default_image_id' == $key ) {
462
+ $sanitized_input[ $key ] = absint( $value );
463
+ continue;
464
+ }
465
+ // rules
466
+ if ( 'rules' == $key and is_array( $value ) ) {
467
+ $c = 1;
468
+ foreach ( $value as $rules ) {
469
+ // ignored only partially defined rule
470
+ if ( ! $rules[ 'id' ] or ! $rules[ 'taxonomy' ] or ! $rules[ 'matchterm' ] ) {
471
+ continue;
472
+ }
473
+ // clean complete rule
474
+ foreach ( $rules as $name => $setting ) {
475
+ switch ( $name ) {
476
+ case 'id':
477
+ $sanitized_input[ $key ][ $c ][ $name ] = absint( $setting );
478
+ break;
479
+ case 'taxonomy':
480
+ $sanitized_input[ $key ][ $c ][ $name ] = sanitize_text_field( $setting );
481
+ break;
482
+ case 'matchterm':
483
+ if ( 'post_type' == $rules[ 'taxonomy' ] ) {
484
+ $sanitized_input[ $key ][ $c ][ $name ] = sanitize_text_field( $setting );
485
+ } else {
486
+ $sanitized_input[ $key ][ $c ][ $name ] = absint( $setting );
487
+ }
488
+ break;
489
+ } // switch()
490
+ } // foreach
491
+ $c = $c + 1;
492
+ } // foreach
493
+ } // if (rules)
494
+ } // foreach()
495
+ return $sanitized_input;
496
+ } // end sanitize_options()
497
+
498
+ /**
499
+ *
500
+ * Render the header of the admin page
501
+ *
502
+ * @access private
503
+ * @since 8.0
504
+ */
505
+ private function display_header() {
506
+ include_once( 'views/section_header.php' );
507
+ }
508
+
509
+ /**
510
+ *
511
+ * Render the footer of the admin page
512
+ *
513
+ * @access private
514
+ * @since 8.0
515
+ */
516
+ private function display_footer() {
517
+ include_once( 'views/section_footer.php' );
518
+ }
519
+
520
+ /**
521
+ *
522
+ * Render the the admin page
523
+ *
524
+ * @access private
525
+ * @since 8.0
526
+ */
527
+ private function display_page_content() {
528
+ include_once( 'views/section_defaults.php' );
529
+ }
530
+
531
+ /**
532
+ *
533
+ * Auto set featured image at saving a post
534
+ *
535
+ * @access private
536
+ * @since 8.0
537
+ * @updated 8.1: add first image handling, small refactoring
538
+ * @updated 8.2: added user (author) rule
539
+ * @updated 8.2.2: added overwrite rule
540
+ * @updated 8.2.2: added user to array of skipped taxonomies
541
+ * @updated 8.3: deleted check wp_attachment_is_image()
542
+ */
543
+ public function add_featured_image( $post_id, $post, $is_update ) {
544
+ // get out if post is autosave type
545
+ if ( wp_is_post_autosave( $post_id ) ) return;
546
+ // get out if post is revision
547
+ if ( wp_is_post_revision( $post_id ) ) return;
548
+ // get out if post is a newly created post, with no content
549
+ if ( 'auto-draft' == get_post_status( $post_id ) ) return;
550
+ // get post object if not valid
551
+ if ( ! $post ) {
552
+ $post = get_post( $post_id );
553
+ }
554
+ // get out if post does not support featured images
555
+ if ( ! post_type_supports( $post->post_type, 'thumbnail' ) ) return;
556
+ // else go on
557
+
558
+ // load all rules
559
+ $settings = $this->get_stored_settings();
560
+
561
+ // get out if user wishes not to overwrite existing featured images and post has already a featured image
562
+ if ( has_post_thumbnail( $post_id ) and ( ! isset( $settings[ 'overwrite_automatically' ] ) ) ) return;
563
+
564
+ // set the thumbnail if a rule matches
565
+ /*
566
+ * Rule cascade order:
567
+ * 1. first embedded content image
568
+ * 2. matched custom taxonomy
569
+ * 3. matched tag
570
+ * 4. matched category
571
+ * 5. matched user
572
+ * 6. matched post type
573
+ */
574
+ $thumb_id = 0;
575
+ // 1. Image by first embedded content image
576
+ if ( isset( $settings[ 'use_first_image_as_default' ] ) ) {
577
+ // get first content image
578
+ #if ( in_array( $post->post_type, $settings[ 'allowed_post_types' ] ) {
579
+ $thumb_id = $this->get_first_content_image_id( $post->post_content );
580
+ #}
581
+ } // if(use_first_image_as_default)
582
+ // determine post's properties matched with specified rules
583
+ if ( ! $thumb_id and isset( $settings[ 'rules' ] ) ) {
584
+ $args = array( 'fields' => 'ids' );
585
+ // 2. Image by matched custom taxonomy
586
+ $skipped_taxonomies = array( 'post_tag', 'category', 'user', 'post_type' );
587
+ foreach ( $settings[ 'rules' ] as $rule ) {
588
+ if ( in_array( $rule[ 'taxonomy' ], $skipped_taxonomies ) ) {
589
+ continue;
590
+ }
591
+ $thumb_id = $this->get_thumb_id( $post_id, $rule );
592
+ if ( $thumb_id ) {
593
+ break;
594
+ }
595
+ } // foreach()
596
+ // 3. Image by matched tag
597
+ if ( ! $thumb_id ) {
598
+ foreach ( $settings[ 'rules' ] as $rule ) {
599
+ if ( 'post_tag' != $rule[ 'taxonomy' ] ) {
600
+ continue; // ommit non-post-tag rules here
601
+ }
602
+ $thumb_id = $this->get_thumb_id( $post_id, $rule );
603
+ if ( $thumb_id ) {
604
+ break;
605
+ }
606
+ } // foreach()
607
+ } // if(no thumb)
608
+ // 4. Image by matched category
609
+ if ( ! $thumb_id ) {
610
+ foreach ( $settings[ 'rules' ] as $rule ) {
611
+ if ( 'category' != $rule[ 'taxonomy' ] ) {
612
+ continue; // ommit non-post-category rules here
613
+ }
614
+ $thumb_id = $this->get_thumb_id( $post_id, $rule );
615
+ if ( $thumb_id ) {
616
+ break;
617
+ }
618
+ } // foreach()
619
+ } // if(no thumb)
620
+ // 5. Image by matched user
621
+ if ( ! $thumb_id ) {
622
+ foreach ( $settings[ 'rules' ] as $rule ) {
623
+ if ( 'user' != $rule[ 'taxonomy' ] ) {
624
+ continue; // ommit non-post-author rules here
625
+ }
626
+ if ( $post->post_author != $rule[ 'matchterm' ] ) {
627
+ continue;
628
+ }
629
+ if ( wp_attachment_is_image( $rule[ 'id' ] ) ) {
630
+ $thumb_id = $rule[ 'id' ];
631
+ break;
632
+ }
633
+ } // foreach()
634
+ } // if(no thumb)
635
+ // 6. Image by post type
636
+ if ( ! $thumb_id ) {
637
+ foreach ( $settings[ 'rules' ] as $rule ) {
638
+ if ( 'post_type' != $rule[ 'taxonomy' ] ) {
639
+ continue; // ommit non-post-type rules here
640
+ }
641
+ if ( $post->post_type != $rule[ 'matchterm' ] ) {
642
+ continue;
643
+ }
644
+ if ( wp_attachment_is_image( $rule[ 'id' ] ) ) {
645
+ $thumb_id = $rule[ 'id' ];
646
+ break;
647
+ }
648
+ } // foreach()
649
+ } // if(no thumb)
650
+ } // if(rules)
651
+ // set image as featured image to post
652
+ $success = false;
653
+ if ( $thumb_id ) {
654
+ $success = set_post_thumbnail( $post_id, $thumb_id );
655
+ }
656
+ // set admin notice
657
+ /*if ( $success ) {
658
+ add_filter( 'redirect_post_location', array( $this, 'add_qfi_param' ) );
659
+ } else {
660
+ }*/
661
+ }
662
+ /*
663
+ function add_qfi_param( $loc ) {
664
+ return esc_url( add_query_arg( 'qfi_notice', 1, $loc ) );
665
+ }
666
+
667
+ function display_qfi_notice() {
668
+ if ( 1 == $_REQUEST[ 'qfi_notice' ] ) {
669
+ printf( '<div class="updated"><p>%s</p></div>', __( 'Changed featured image successfully.', $this->plugin-slug ) );
670
+ } else {
671
+ #printf( '<div class="error"><p>%s</p></div>', __( 'Featured image not changed.', $this->plugin-slug ) );
672
+ }
673
+ }
674
+ */
675
+ /**
676
+ *
677
+ * Test term and image id
678
+ *
679
+ * @access private
680
+ * @since 8.0
681
+ */
682
+ private function get_thumb_id ( $post_id, $rule ) {
683
+
684
+ $terms = wp_get_post_terms( $post_id, $rule[ 'taxonomy' ], array( 'fields' => 'ids' ) );
685
+
686
+ if ( is_wp_error( $terms ) ) {
687
+ return 0;
688
+ }
689
+ if ( ! in_array( $rule[ 'matchterm' ], $terms ) ) {
690
+ return 0;
691
+ }
692
+ if ( ! wp_attachment_is_image( $rule[ 'id' ] ) ) {
693
+ return 0;
694
+ }
695
+ return $rule[ 'id' ];
696
+ }
697
+
698
+ /**
699
+ * Returns the id of the first image in the content, else 0
700
+ *
701
+ * @access private
702
+ * @since 5.0
703
+ * @updated 5.1.1: refactored
704
+ * @updated 7.0: improved performance by changing intval() to (int)
705
+ * @updated 8.3: deleted detection for site url, added detection for id in img's class attribute
706
+ * @updated 8.3: improved security by changing (int) to absint()
707
+ *
708
+ * @return integer the post id of the image
709
+ */
710
+ private function get_first_content_image_id ( $content ) {
711
+ // set variables
712
+ global $wpdb;
713
+ // look for images in HTML code
714
+ preg_match_all( '/<img[^>]+>/i', $content, $all_img_tags );
715
+ if ( $all_img_tags ) {
716
+ foreach ( $all_img_tags[ 0 ] as $img_tag ) {
717
+ // find class attribute and catch its value
718
+ preg_match( '/<img.*?class\s*=\s*[\'"]([^\'"]+)[\'"][^>]*>/i', $img_tag, $img_class );
719
+ if ( $img_class ) {
720
+ // Look for the WP image id
721
+ preg_match( '/wp-image-([\d]+)/i', $img_class[ 1 ], $found_id );
722
+ // if first image id found: check whether is image
723
+ if ( $found_id ) {
724
+ $img_id = absint( $found_id[ 1 ] );
725
+ // if is image: return its id
726
+ if ( wp_get_attachment_image_src( $img_id ) ) {
727
+ return $img_id;
728
+ }
729
+ } // if(found_id)
730
+ } // if(img_class)
731
+
732
+ // else: try to catch image id by its url as stored in the database
733
+ // find src attribute and catch its value
734
+ preg_match( '/<img.*?src\s*=\s*[\'"]([^\'"]+)[\'"][^>]*>/i', $img_tag, $img_src );
735
+ if ( $img_src ) {
736
+ // delete optional query string in img src
737
+ $url = preg_replace( '/([^?]+).*/', '\1', $img_src[ 1 ] );
738
+ // delete image dimensions data in img file name, just take base name and extension
739
+ $guid = preg_replace( '/(.+)-\d+x\d+\.(\w+)/', '\1.\2', $url );
740
+ // look up its ID in the db
741
+ $found_id = $wpdb->get_var( $wpdb->prepare( "SELECT `ID` FROM $wpdb->posts WHERE `guid` = '%s'", $guid ) );
742
+ // if first image id found: return it
743
+ if ( $found_id ) {
744
+ return absint( $found_id );
745
+ } // if(found_id)
746
+ } // if(img_src)
747
+ } // foreach(img_tag)
748
+ } // if(all_img_tags)
749
+
750
+ // if nothing found: return 0
751
+ return 0;
752
+ }
753
+
754
+ }
admin/class-quick-featured-images-settings.php ADDED
@@ -0,0 +1,504 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Quick Featured Images
4
+ *
5
+ * @package Quick_Featured_Images_Settings
6
+ * @author Martin Stehle <m.stehle@gmx.de>
7
+ * @license GPL-2.0+
8
+ * @link http://wordpress.org/plugins/quick-featured-images/
9
+ * @copyright 2014
10
+ */
11
+
12
+ /**
13
+ * @package Quick_Featured_Images_Settings
14
+ * @author Martin Stehle <m.stehle@gmx.de>
15
+ */
16
+ class Quick_Featured_Images_Settings {
17
+
18
+ /**
19
+ * Instance of this class.
20
+ *
21
+ * @since 7.0
22
+ *
23
+ * @var object
24
+ */
25
+ protected static $instance = null;
26
+
27
+ /**
28
+ * Required user capability to use this plugin
29
+ *
30
+ * @since 7.0
31
+ *
32
+ * @var string
33
+ */
34
+ protected $required_user_cap = 'edit_others_posts';
35
+
36
+ /**
37
+ * Slug of the plugin screen.
38
+ *
39
+ * @since 7.0
40
+ *
41
+ * @var string
42
+ */
43
+ protected $plugin_screen_hook_suffix = null;
44
+
45
+ /**
46
+ * Name of this plugin.
47
+ *
48
+ * @since 7.0
49
+ *
50
+ * @var string
51
+ */
52
+ protected $plugin_name = null;
53
+
54
+ /**
55
+ * Unique identifier for this plugin.
56
+ *
57
+ * It is the same as in class Quick_Featured_Images_Admin
58
+ * Has to be set here to be used in non-object context, e.g. callback functions
59
+ *
60
+ * @since 7.0
61
+ *
62
+ * @var string
63
+ */
64
+ protected $plugin_slug = null;
65
+
66
+ /**
67
+ * Unique identifier for the admin page of this class.
68
+ *
69
+ * @since 7.0
70
+ *
71
+ * @var string
72
+ */
73
+ protected $page_slug = null;
74
+
75
+ /**
76
+ * Unique identifier for the admin parent page of this class.
77
+ *
78
+ * @since 7.0
79
+ *
80
+ * @var string
81
+ */
82
+ protected $parent_page_slug = null;
83
+
84
+ /**
85
+ * Plugin version, used for cache-busting of style and script file references.
86
+ *
87
+ * @since 7.0
88
+ *
89
+ * @var string
90
+ */
91
+ protected $plugin_version = null;
92
+
93
+ /**
94
+ * Unique identifier in the WP options table
95
+ *
96
+ *
97
+ * @since 7.0
98
+ *
99
+ * @var string
100
+ */
101
+ protected $settings_db_slug = null;
102
+
103
+ /**
104
+ * Slug of the menu page on which to display the form sections
105
+ *
106
+ *
107
+ * @since 7.0
108
+ *
109
+ * @var array
110
+ */
111
+ protected $main_options_page_slug = 'quick-featured-images-optionspage';
112
+
113
+ /**
114
+ * Group name of options
115
+ *
116
+ *
117
+ * @since 7.0
118
+ *
119
+ * @var array
120
+ */
121
+ protected $settings_fields_slug = 'quick-featured-images-options';
122
+
123
+ /**
124
+ * Stored settings in an array
125
+ *
126
+ *
127
+ * @since 7.0
128
+ *
129
+ * @var array
130
+ */
131
+ protected $stored_settings = array();
132
+
133
+ /**
134
+ * Initialize the plugin by loading admin scripts & styles and adding a
135
+ * settings page and menu.
136
+ *
137
+ * @since 7.0
138
+ */
139
+ private function __construct() {
140
+
141
+ // Call variables from public plugin class.
142
+ $plugin = Quick_Featured_Images_Admin::get_instance();
143
+ $this->plugin_name = $plugin->get_plugin_name();
144
+ $this->plugin_slug = $plugin->get_plugin_slug();
145
+ $this->page_slug = $this->plugin_slug . '-settings';
146
+ $this->parent_page_slug = $plugin->get_page_slug();
147
+ $this->plugin_version = $plugin->get_plugin_version();
148
+ $this->settings_db_slug = $plugin->get_settings_db_slug();
149
+
150
+ // Load admin style sheet and JavaScript.
151
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
152
+
153
+ // Add the options page and menu item.
154
+ add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ) );
155
+
156
+ // Add an action link pointing to the options page.
157
+ $plugin_basename = plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_slug . '.php' );
158
+ add_filter( 'plugin_action_links_' . $plugin_basename, array( $this, 'add_action_links' ) );
159
+
160
+ /*
161
+ * Add registering options
162
+ *
163
+ */
164
+ add_action( 'admin_init', array( $this, 'register_options' ) );
165
+
166
+ }
167
+
168
+ /**
169
+ * Render the settings page for this plugin.
170
+ *
171
+ * @since 7.0
172
+ */
173
+ public function main() {
174
+ $this->display_header();
175
+ include_once( 'views/section_settings.php' );
176
+ $this->display_footer();
177
+ }
178
+
179
+ /**
180
+ * Return an instance of this class.
181
+ *
182
+ * @since 7.0
183
+ *
184
+ * @return object A single instance of this class.
185
+ */
186
+ public static function get_instance() {
187
+
188
+ // If the single instance hasn't been set, set it now.
189
+ if ( null == self::$instance ) {
190
+ self::$instance = new self;
191
+ }
192
+
193
+ return self::$instance;
194
+ }
195
+
196
+ /**
197
+ * Return the page headline.
198
+ *
199
+ * @since 7.0
200
+ *
201
+ *@return page headline variable.
202
+ */
203
+ public function get_page_headline() {
204
+ return __( 'Image Columns', $this->plugin_slug );
205
+ }
206
+
207
+ /**
208
+ * Return the page description.
209
+ *
210
+ * @since 8.0
211
+ *
212
+ *@return page description variable.
213
+ */
214
+ public function get_page_description() {
215
+ return __( 'Set the visibility of columns of featured images in posts lists', $this->plugin_slug );
216
+ }
217
+
218
+ /**
219
+ * Return the page slug.
220
+ *
221
+ * @since 7.0
222
+ *
223
+ *@return page slug variable.
224
+ */
225
+ public function get_page_slug() {
226
+ return $this->page_slug;
227
+ }
228
+
229
+ /**
230
+ * Return the required user capability.
231
+ *
232
+ * @since 7.0
233
+ *
234
+ *@return required user capability variable.
235
+ */
236
+ public function get_required_user_cap() {
237
+ return $this->required_user_cap;
238
+ }
239
+
240
+ /**
241
+ * Register and enqueue admin-specific style sheet.
242
+ *
243
+ * @since 7.0
244
+ *
245
+ * @return null Return early if no settings page is registered.
246
+ */
247
+ public function enqueue_admin_styles() {
248
+
249
+ if ( ! isset( $this->plugin_screen_hook_suffix ) ) {
250
+ return;
251
+ }
252
+
253
+ // request css only if this plugin was called
254
+ $screen = get_current_screen();
255
+ if ( $this->plugin_screen_hook_suffix == $screen->id ) {
256
+ wp_enqueue_style( $this->plugin_slug .'-admin-styles', plugins_url( 'assets/css/admin.css', __FILE__ ), array( ), $this->plugin_version );
257
+ }
258
+
259
+ }
260
+
261
+ /**
262
+ * Register the administration menu for this plugin into the WordPress Dashboard menu.
263
+ *
264
+ * @since 7.0
265
+ */
266
+ public function add_plugin_admin_menu() {
267
+
268
+ // get translated string of the menu label and page headline
269
+ $label = $this->get_page_headline();
270
+
271
+ // Add a settings page for this plugin to the Settings menu.
272
+ $this->plugin_screen_hook_suffix = add_submenu_page(
273
+ $this->parent_page_slug, // parent_slug
274
+ sprintf( '%s: %s', $this->plugin_name, $label ), // page_title
275
+ $label, // menu_title
276
+ $this->required_user_cap, // capability to use the following function
277
+ $this->page_slug, // menu_slug
278
+ array( $this, 'main' ) // function to execute when loading this page
279
+ );
280
+
281
+ }
282
+
283
+ /**
284
+ * Add settings action link to the plugins page.
285
+ *
286
+ * @since 7.0
287
+ */
288
+ public function add_action_links( $links ) {
289
+ $url = sprintf( 'admin.php?page=%s', $this->page_slug );
290
+ return array_merge(
291
+ $links,
292
+ array(
293
+ 'settings' => sprintf( '<a href="%s">%s</a>', admin_url( $url ), $this->get_page_headline() )
294
+ )
295
+ );
296
+
297
+ }
298
+
299
+ /**
300
+ * Set default settings
301
+ *
302
+ * @since 7.0
303
+ */
304
+ private static function set_default_settings() {
305
+
306
+ $db_slug = 'quick-featured-images-settings'; // todo: get the value from $settings_db_slug both in object and non-object context
307
+ // check if there are already stored settings under the option's database slug
308
+ if ( false === get_option( $db_slug, false ) ) {
309
+ // store default values in the db as a single and serialized entry
310
+ add_option(
311
+ $db_slug,
312
+ array(
313
+ 'show_posts_images' => '1',
314
+ 'show_pages_images' => '1',
315
+ )
316
+ );
317
+ } // if ( false )
318
+
319
+ }
320
+
321
+ /**
322
+ * Get current or default settings
323
+ *
324
+ * @since 7.0
325
+ */
326
+ public function get_stored_settings() {
327
+ // try to load current settings. If they are not in the DB return set default settings
328
+ $stored_settings = get_option( $this->settings_db_slug, false );
329
+ // if empty array set and store default values
330
+ if ( false === $stored_settings ) {
331
+ $this->set_default_settings();
332
+ }
333
+ // try to load current settings again. Now there should be the data
334
+ $stored_settings = get_option( $this->settings_db_slug, false );
335
+
336
+ return $stored_settings; # todo: return $this->sanitize_stored_settings( $stored_settings );
337
+ }
338
+
339
+ /**
340
+ * Define and register the options
341
+ * Run on admin_init()
342
+ *
343
+ * @since 7.0
344
+ */
345
+ public function register_options () {
346
+
347
+ $title = null;
348
+ $html = null;
349
+
350
+ // get current or default settings
351
+ $this->stored_settings = $this->get_stored_settings();
352
+
353
+ /*
354
+ * 1st section
355
+ */
356
+
357
+ // build the form section for column toggles
358
+ $section_key = '1st_section';
359
+ // register the section
360
+ add_settings_section(
361
+ // 'id' attribute of tags
362
+ $section_key,
363
+ // title of the section.
364
+ __( 'Columns for featured images in posts lists', $this->plugin_slug ),
365
+ // callback function that fills the section with the desired content
366
+ array( $this, 'print_section_' . $section_key ),
367
+ // menu page on which to display this section
368
+ $this->main_options_page_slug
369
+ ); // end add_settings_section()
370
+
371
+ // register the options for the section
372
+ $title = __( 'Show additional column for featured images in lists of', $this->plugin_slug );
373
+ add_settings_field(
374
+ // form field name for use in the 'id' attribute of tags
375
+ 'column_toggles',
376
+ // title of the form field
377
+ $title . sprintf( '<br />&nbsp;<br /><img src="%s" alt="%s" width="200" height="104" />', plugins_url( 'assets/images/posts_list_w_image_column.gif' , __FILE__ ), __( 'Posts list with image column', $this->plugin_slug ) ),
378
+ // callback function to print the form field
379
+ array( $this, 'print_columns_options' ),
380
+ // menu page on which to display this field for do_settings_section()
381
+ $this->main_options_page_slug,
382
+ // section where the form field appears
383
+ $section_key,
384
+ // arguments passed to the callback function
385
+ array( $title )
386
+ ); // end add_settings_field()
387
+
388
+ /*
389
+ * Finally register all options. They will be stored in the database
390
+ * in the wp_options table under the options name $this->settings_db_slug.
391
+ */
392
+ register_setting(
393
+ // group name in settings_fields()
394
+ $this->settings_fields_slug,
395
+ // name of the option to sanitize and save in the db
396
+ $this->settings_db_slug,
397
+ // callback function that sanitizes the option's values.
398
+ array( $this, 'sanitize_options' )
399
+ ); // end register_setting()
400
+
401
+ } // end register_options()
402
+
403
+ /**
404
+ * Check and return correct values for the settings
405
+ *
406
+ * @since 7.0
407
+ *
408
+ * @param array $input Options and their values after submitting the form
409
+ *
410
+ * @return array Options and their sanatized values
411
+ *
412
+ * @updated 8.3.1: sanitized recognition of key names
413
+ * @updated 9.1: Fixed warning if $input = null
414
+ */
415
+ public function sanitize_options ( $input ) {
416
+ // exit with empty array if no option was checked
417
+ if ( ! $input ) {
418
+ return array();
419
+ }
420
+ $sanitized_input = array();
421
+ foreach ( $input as $key => $value ) {
422
+ // checkboxes
423
+ if ( preg_match( '/^column_thumb_[a-z0-9_\-]+$/', $key ) ) {
424
+ $sanitized_input[ $key ] = isset( $input[ $key ] ) ? '1' : '0' ;
425
+ }
426
+ } // foreach()
427
+ return $sanitized_input;
428
+ } // end sanitize_options()
429
+
430
+ /**
431
+ *
432
+ * Render the header of the admin page
433
+ *
434
+ * @access private
435
+ * @since 7.0
436
+ */
437
+ private function display_header() {
438
+ include_once( 'views/section_header.php' );
439
+ }
440
+
441
+ /**
442
+ *
443
+ * Render the footer of the admin page
444
+ *
445
+ * @access private
446
+ * @since 7.0
447
+ */
448
+ private function display_footer() {
449
+ include_once( 'views/section_footer.php' );
450
+ }
451
+
452
+ /**
453
+ * Print the option
454
+ *
455
+ * @since 7.0
456
+ *
457
+ * @updated 8.3.1: rename keys for column thumb post types
458
+ */
459
+ public function print_columns_options ( $args ) {
460
+ // define the form sections, order by appereance, with headlines, and options
461
+ $label_posts = 'Posts';
462
+ $label_pages = 'Pages';
463
+ $post_types = array(
464
+ 'column_thumb_post' => _x( $label_posts, 'post type general name' ),
465
+ 'column_thumb_page' => _x( $label_pages, 'post type general name' ),
466
+ );
467
+ // get the registered custom post types as objects
468
+ $custom_post_types = get_post_types( array( '_builtin' => false ), 'objects' );
469
+ // add their names and labels to the standard WP post types
470
+ foreach ( $custom_post_types as $name => $object ) {
471
+ if ( post_type_supports( $name, 'thumbnail' ) ) {
472
+ $key = sprintf( 'column_thumb_%s', $name );
473
+ $post_types[ $key ] = $object->label;
474
+ }
475
+ }
476
+ $html = sprintf( '<fieldset><legend class="screen-reader-text"><span>%s</span></legend>', $args[ 0 ] );
477
+ foreach ( $post_types as $value => $label ) {
478
+ $stored_value = isset( $this->stored_settings[ $value ] ) ? esc_attr( $this->stored_settings[ $value ] ) : '0';
479
+ $checked = $stored_value ? checked( '1', $stored_value, false ) : '0';
480
+ $html .= sprintf(
481
+ '<label for="%s"><input name="%s[%s]" type="checkbox" id="%s" value="1"%s /> %s</label><br />',
482
+ $value,
483
+ $this->settings_db_slug,
484
+ $value,
485
+ $value,
486
+ $checked,
487
+ $label
488
+ );
489
+ } // foreach()
490
+ $html .= '</fieldset>';
491
+ $html .= sprintf( '<p class="description">%s</p>', __( 'Activate the checkboxes at each post type to show the extra columns in the post lists.', $this->plugin_slug ) );
492
+ print $html;
493
+ }
494
+
495
+ /**
496
+ * Print the explanation for section 1
497
+ *
498
+ * @since 7.0
499
+ */
500
+ public function print_section_1st_section () {
501
+ printf( "<p>%s</p>\n", __( 'The additional columns give you a quick overview about all used featured images for every post. The Featured Image column is sortable.', $this->plugin_slug ) );
502
+ }
503
+
504
+ }
admin/class-quick-featured-images-tools.php ADDED
@@ -0,0 +1,2129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Quick_Featured_Images_Tools
4
+ * @author Martin Stehle <m.stehle@gmx.de>
5
+ * @license GPL-2.0+
6
+ * @link http://stehle-internet.de
7
+ * @copyright 2014 Martin Stehle
8
+ */
9
+
10
+ class Quick_Featured_Images_Tools { // only for debugging: extends Quick_Featured_Images_Base {
11
+
12
+ /**
13
+ * Instance of this class.
14
+ *
15
+ * @since 1.0.0
16
+ *
17
+ * @var object
18
+ */
19
+ protected static $instance = null;
20
+
21
+ /**
22
+ * Required user capability to use this plugin
23
+ *
24
+ * @since 1.0.0
25
+ *
26
+ * @var string
27
+ */
28
+ protected $required_user_cap = 'edit_others_posts'; // - user role must be edit_post and edit_others_posts
29
+
30
+ /**
31
+ * Slug of the plugin screen.
32
+ *
33
+ * @since 1.0.0
34
+ *
35
+ * @var string
36
+ */
37
+ protected $plugin_screen_hook_suffix = null;
38
+
39
+ /**
40
+ * Name of this plugin.
41
+ *
42
+ * @since 7.0
43
+ *
44
+ * @var string
45
+ */
46
+ protected $plugin_name = null;
47
+
48
+ /**
49
+ * Unique identifier for this plugin.
50
+ *
51
+ * It is the same as in class Quick_Featured_Images_Admin
52
+ * Has to be set here to be used in non-object context, e.g. callback functions
53
+ *
54
+ * @since 7.0
55
+ *
56
+ * @var string
57
+ */
58
+ protected $plugin_slug = null;
59
+
60
+ /**
61
+ * Unique identifier for the admin page of this class.
62
+ *
63
+ * @since 7.0
64
+ *
65
+ * @var string
66
+ */
67
+ protected $page_slug = null;
68
+
69
+ /**
70
+ * Unique identifier for the admin parent page of this class.
71
+ *
72
+ * @since 7.0
73
+ *
74
+ * @var string
75
+ */
76
+ protected $parent_page_slug = null;
77
+
78
+ /**
79
+ * Valid progress steps
80
+ *
81
+ * @since 1.0.0
82
+ *
83
+ * @var array
84
+ */
85
+ protected $valid_steps = null;
86
+
87
+ /**
88
+ * User selected progress step
89
+ *
90
+ * @since 1.0.0
91
+ *
92
+ * @var array
93
+ */
94
+ protected $selected_step = null;
95
+
96
+ /**
97
+ * Whether an image id is required or not (depends on the selected action)
98
+ *
99
+ * @since 2.0
100
+ *
101
+ * @var bool
102
+ */
103
+ protected $is_image_required = null;
104
+
105
+ /**
106
+ * User selected ID of the new featured image
107
+ *
108
+ * @since 1.0.0
109
+ *
110
+ * @var integer
111
+ */
112
+ protected $selected_image_id = null;
113
+
114
+ /**
115
+ * User selected IDs of the new featured images
116
+ *
117
+ * @since 6.0
118
+ *
119
+ * @var array
120
+ */
121
+ protected $selected_multiple_image_ids = null;
122
+
123
+ /**
124
+ * User selected ID of the featured image to replace
125
+ *
126
+ * @since 1.0.0
127
+ *
128
+ * @var integer
129
+ */
130
+ protected $selected_old_image_ids = null;
131
+
132
+ /**
133
+ * Whether the id of a to be replaced image is set or not
134
+ *
135
+ * @since 2.0
136
+ *
137
+ * @var bool
138
+ */
139
+ protected $is_error_no_old_image = null;
140
+
141
+ /**
142
+ * Whether the user jumps from 'select' directly to 'confirm' omitting 'refine'
143
+ *
144
+ * @since 5.1
145
+ *
146
+ * @var bool
147
+ */
148
+ protected $is_skip_refine = null;
149
+
150
+ /**
151
+ * Width of thumbnail images in the current WordPress settings
152
+ *
153
+ * @since 2.0
154
+ *
155
+ * @var integer
156
+ */
157
+ protected $used_thumbnail_width = null;
158
+
159
+ /**
160
+ * Height of thumbnail images in the current WordPress settings
161
+ *
162
+ * @since 2.0
163
+ *
164
+ * @var integer
165
+ */
166
+ protected $used_thumbnail_height = null;
167
+
168
+ /**
169
+ * Minimum length of image dimensions to search for
170
+ *
171
+ * @since 2.0
172
+ *
173
+ * @var integer
174
+ */
175
+ protected $min_image_length = null;
176
+
177
+ /**
178
+ * Maximum length of image dimensions to search for
179
+ *
180
+ * @since 2.0
181
+ *
182
+ * @var integer
183
+ */
184
+ protected $max_image_length = null;
185
+
186
+ /**
187
+ * User selected action the plugin should perform
188
+ *
189
+ * @since 1.0.0
190
+ *
191
+ * @var string
192
+ */
193
+ protected $selected_action = null;
194
+
195
+ /**
196
+ * Valid names and descriptions of the actions
197
+ *
198
+ * @since 1.0.0
199
+ *
200
+ * @var array
201
+ */
202
+ protected $valid_actions = null;
203
+
204
+ /**
205
+ * Valid names and descriptions of the actions without a user selected image
206
+ *
207
+ * @since 5.0
208
+ *
209
+ * @var array
210
+ */
211
+ protected $valid_actions_without_image = null;
212
+
213
+ /**
214
+ * Valid names and descriptions of the actions with multiple user selected images
215
+ *
216
+ * @since 6.0
217
+ *
218
+ * @var array
219
+ */
220
+ protected $valid_actions_multiple_images = null;
221
+
222
+ /**
223
+ * User selected filters the plugin should perform
224
+ *
225
+ * @since 1.0.0
226
+ *
227
+ * @var array
228
+ */
229
+ protected $selected_filters = null;
230
+
231
+ /**
232
+ * Valid names and descriptions of the filters
233
+ *
234
+ * @since 1.0.0
235
+ *
236
+ * @var array
237
+ */
238
+ protected $valid_filters = null;
239
+
240
+ /**
241
+ * User selected options the plugin should consider
242
+ *
243
+ * @since 5.1
244
+ *
245
+ * @var array
246
+ */
247
+ protected $selected_options = null;
248
+
249
+ /**
250
+ * Valid names and descriptions of the options
251
+ *
252
+ * @since 5.1
253
+ *
254
+ * @var array
255
+ */
256
+ protected $valid_options = null;
257
+
258
+ /**
259
+ * User selected statuses the plugin should perform
260
+ *
261
+ * @since 1.0.0
262
+ *
263
+ * @var array
264
+ */
265
+ protected $selected_statuses = null;
266
+
267
+ /**
268
+ * Valid names and descriptions of the post statuses
269
+ *
270
+ * @since 1.0.0
271
+ *
272
+ * @var array
273
+ */
274
+ protected $valid_statuses = null;
275
+
276
+ /**
277
+ * User selected search term
278
+ *
279
+ * @since 1.0.0
280
+ *
281
+ * @var string
282
+ */
283
+ protected $selected_search_term = null;
284
+
285
+ /**
286
+ * User selected category
287
+ *
288
+ * @since 1.0.0
289
+ *
290
+ * @var integer
291
+ */
292
+ protected $selected_category_id = null;
293
+
294
+ /**
295
+ * User selected parent page
296
+ *
297
+ * @since 1.0.0
298
+ *
299
+ * @var integer
300
+ */
301
+ protected $selected_parent_page_id = null;
302
+
303
+ /**
304
+ * User selected author
305
+ *
306
+ * @since 1.0.0
307
+ *
308
+ * @var integer
309
+ */
310
+ protected $selected_author_id = null;
311
+
312
+ /**
313
+ * User selected tag
314
+ *
315
+ * @since 1.0.0
316
+ *
317
+ * @var integer
318
+ */
319
+ protected $selected_tag_id = null;
320
+
321
+ /**
322
+ * User selected names and descriptions of post types supporting featured images by default
323
+ *
324
+ * @since 1.0.0
325
+ *
326
+ * @var array
327
+ */
328
+ protected $selected_post_types = null;
329
+
330
+ /**
331
+ * Valid names and descriptions of the post types supporting featured images by default
332
+ *
333
+ * @since 1.0.0
334
+ *
335
+ * @var array
336
+ */
337
+ protected $valid_post_types = null;
338
+
339
+ /**
340
+ * User selected names and descriptions of custom post types
341
+ *
342
+ * @since 1.0.0
343
+ *
344
+ * @var array
345
+ */
346
+ protected $selected_custom_post_types = null;
347
+
348
+ /**
349
+ * User selected names and descriptions of mime types supporting featured images by default
350
+ *
351
+ * @since 9.0
352
+ *
353
+ * @var array
354
+ */
355
+ protected $selected_mime_types = null;
356
+
357
+ /**
358
+ * Valid names and descriptions of the mime types supporting featured images by default
359
+ *
360
+ * @since 9.0
361
+ *
362
+ * @var array
363
+ */
364
+ protected $valid_mime_types = null;
365
+
366
+ /**
367
+ * Valid names and descriptions of the custom post types
368
+ *
369
+ * @since 3.0
370
+ *
371
+ * @var array
372
+ */
373
+ protected $valid_custom_post_types = null;
374
+
375
+ /**
376
+ * User selected names and descriptions of custom taxonomies
377
+ *
378
+ * @since 3.0
379
+ *
380
+ * @var array
381
+ */
382
+ protected $selected_custom_taxonomies = null;
383
+
384
+ /**
385
+ * Valid names and descriptions of the custom taxonomies
386
+ *
387
+ * @since 3.0
388
+ *
389
+ * @var array
390
+ */
391
+ protected $valid_custom_taxonomies = null;
392
+
393
+ /**
394
+ * User selected date queries the plugin should perform
395
+ *
396
+ * @since 4.0
397
+ *
398
+ * @var array
399
+ */
400
+ protected $selected_date_queries = null;
401
+
402
+ /**
403
+ * Post dates as stored in the db
404
+ *
405
+ * @since 4.0
406
+ *
407
+ * @var array
408
+ */
409
+ protected $valid_post_dates = null;
410
+
411
+ /**
412
+ * Valid names and descriptions of the date queries
413
+ *
414
+ * @since 1.0.0
415
+ *
416
+ * @var array
417
+ */
418
+ protected $valid_date_queries = null;
419
+
420
+ /**
421
+ * User selected custom fields the plugin should perform
422
+ *
423
+ * @since 1.0.0
424
+ *
425
+ * @var array
426
+ */
427
+ protected $selected_custom_field = null;
428
+
429
+ /**
430
+ * Valid names and descriptions of the custom fields
431
+ *
432
+ * @since 1.0.0
433
+ *
434
+ * @var array
435
+ */
436
+ protected $valid_custom_field = null;
437
+
438
+ /**
439
+ * User selected post ids
440
+ *
441
+ * @since 1.0.0
442
+ *
443
+ * @var array
444
+ */
445
+ protected $selected_post_ids = null;
446
+
447
+ /**
448
+ * Valid names and descriptions of image sizes
449
+ *
450
+ * @since 2.0
451
+ *
452
+ * @var array
453
+ */
454
+ protected $valid_image_dimensions = null;
455
+
456
+ /**
457
+ * User given image sizes
458
+ *
459
+ * @since 2.0
460
+ *
461
+ * @var array
462
+ */
463
+ protected $selected_image_dimensions = null;
464
+
465
+ /**
466
+ * Transient reference for temporary storaging of data
467
+ *
468
+ * @since 2.0.0 pro
469
+ *
470
+ * @var string
471
+ */
472
+ protected $transient_name = null;
473
+
474
+ /**
475
+ * Initialize the plugin by loading admin scripts & styles and adding a
476
+ * settings page and menu.
477
+ *
478
+ * @access private
479
+ * @since 1.0.0
480
+ */
481
+ private function __construct() {
482
+
483
+ // Call some values from public plugin class.
484
+ $plugin = Quick_Featured_Images_Admin::get_instance();
485
+ $this->plugin_name = $plugin->get_plugin_name();
486
+ $this->plugin_slug = $plugin->get_plugin_slug();
487
+ $this->page_slug = $this->plugin_slug . '-tools';
488
+ $this->parent_page_slug = $plugin->get_page_slug();
489
+ $this->plugin_version = $plugin->get_plugin_version();
490
+
491
+ // Load admin style sheet and JavaScript.
492
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
493
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
494
+
495
+ // Add the admin page and menu item.
496
+ add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ) );
497
+
498
+ // Add 'Bulk set' link in rows of media library list
499
+ add_filter( 'media_row_actions', array( &$this, 'add_media_row_action' ), 10, 2 );
500
+
501
+ }
502
+
503
+ /**
504
+ * Do the admin main function
505
+ *
506
+ * @since 1.0.0
507
+ *
508
+ */
509
+ public function main() {
510
+ // set variables
511
+ $this->set_default_values();
512
+ // get current step
513
+ $this->selected_step = $this->get_sanitized_step();
514
+ #$this->dambedei( $_REQUEST );
515
+ #$this->dambedei( $_SERVER );
516
+ /*
517
+ * print content
518
+ */
519
+ // no action and image required, just the start page
520
+ if ( 'start' == $this->selected_step ) {
521
+ // print header
522
+ $this->display_header();
523
+ include_once( 'views/form_start.php' );
524
+ } else {
525
+ // get user selected action
526
+ $this->selected_action = $this->get_sanitized_action();
527
+ // check if action is defined, else print error page
528
+ if ( ! $this->selected_action ) {
529
+ $this->display_error( 'wrong_action', false );
530
+ } else {
531
+ // check whether thumb id is not required due to selected action
532
+ if ( in_array( $this->selected_action, array_merge( array_keys( $this->valid_actions_without_image ), array_keys( $this->valid_actions_multiple_images ) ) ) ) {
533
+ $this->is_image_required = false;
534
+ }
535
+ // get selected image id, else 0
536
+ $this->selected_image_id = $this->get_sanitized_image_id();
537
+ // get selected image ids, else empty array
538
+ $this->selected_multiple_image_ids = $this->get_sanitized_multiple_image_ids();
539
+ // check whether an image id is available if required
540
+ if ( $this->is_image_required && ! $this->selected_image_id ) {
541
+ $this->display_error( 'no_image', false );
542
+ // check whether selected attachment is an image if required
543
+ } elseif ( $this->is_image_required && ! wp_get_attachment_image_src( $this->selected_image_id ) ) {
544
+ $this->display_error( 'no_result', sprintf( __( 'Wrong image ID %d', $this->plugin_slug ), $this->selected_image_id ) );
545
+ // check whether there are selected images if required
546
+ } elseif ( 'assign_randomly' == $this->selected_action && ! $this->selected_multiple_image_ids ) {
547
+ $this->display_error( 'no_image', false );
548
+ } else {
549
+ // get user selected filters
550
+ $this->selected_filters = $this->get_sanitized_filter_names();
551
+ // get user selected options
552
+ $this->selected_options = $this->get_sanitized_option_names();
553
+ // after the old image selection page (filter_replace.php) and if no old image was selected
554
+ if ( 'replace' == $this->selected_action && 'confirm' == $this->selected_step && ! isset( $_POST[ 'replacement_image_ids' ] ) ) {
555
+ // stay on the selection page with a warning
556
+ $this->selected_step = 'select';
557
+ $this->is_error_no_old_image = true;
558
+ // check if user comes from direct link in media page
559
+ } elseif ( 'assign' == $this->selected_action && 'select' == $this->selected_step && $this->selected_image_id && isset( $_POST[ '_wpnonce' ] ) ) {
560
+ // go to the filter selection page directly
561
+ $this->is_direct_access = true;
562
+ // check if user comes from the selection page and has not select any filter
563
+ } elseif ( 'refine' == $this->selected_step && empty( $this->selected_filters ) ) {
564
+ // skip refine page, go to the confirm page directly
565
+ $this->selected_step = 'confirm';
566
+ $this->is_skip_refine = true;
567
+ }
568
+
569
+ // print header
570
+ $this->display_header();
571
+ // print content based of process
572
+ switch ( $this->selected_step ) {
573
+ case 'select':
574
+ if ( $this->is_error_no_old_image ) {
575
+ check_admin_referer( 'quickfi_refine', $this->plugin_slug . '_nonce' );
576
+ } elseif ( $this->is_direct_access ) {
577
+ // no referer check
578
+ check_admin_referer( 'bulk-assign' );
579
+ } else {
580
+ check_admin_referer( 'quickfi_start', $this->plugin_slug . '_nonce' );
581
+ }
582
+ // print selected thumbnail if required
583
+ include_once( 'views/section_image.php' );
584
+ // print form to select the posts to apply the action to
585
+ include_once( 'views/form_select.php' );
586
+ break;
587
+ case 'refine':
588
+ check_admin_referer( 'quickfi_select', $this->plugin_slug . '_nonce' );
589
+ // print selected thumbnail if required
590
+ include_once( 'views/section_image.php' );
591
+ // print form to refine choice
592
+ include_once( 'views/form_refine.php' );
593
+ // print form for going back to the filter selection without loosing input data
594
+ include_once( 'views/form_back_to_selection.php' );
595
+ break;
596
+ case 'confirm':
597
+ if ( $this->is_skip_refine ) {
598
+ check_admin_referer( 'quickfi_select', $this->plugin_slug . '_nonce' );
599
+ } else {
600
+ check_admin_referer( 'quickfi_refine', $this->plugin_slug . '_nonce' );
601
+ }
602
+ // filter posts
603
+ $results = $this->find_posts();
604
+ // print selected thumbnail if required
605
+ include_once( 'views/section_image.php' );
606
+ // print refine form again if there are no results
607
+ include_once( 'views/form_confirm.php' );
608
+ // print form to refine choice if filters were selected
609
+ if ( $this->selected_filters ) {
610
+ include_once( 'views/form_refine.php' );
611
+ }
612
+ // print form for going back to the filter selection without loosing input data
613
+ include_once( 'views/form_back_to_selection.php' );
614
+ break;
615
+ case 'perform':
616
+ check_admin_referer( 'quickfi_confirm', $this->plugin_slug . '_nonce' );
617
+ // filter posts and apply action to found posts
618
+ $results = $this->perform_action();
619
+ // print results
620
+ include_once( 'views/section_results.php' );
621
+ } // switch( selected step )
622
+ } // if( image available )
623
+ } // if( action available )
624
+ } // if( is start )
625
+ // print footer
626
+ $this->display_footer();
627
+ }
628
+
629
+ /**
630
+ * Set variables
631
+ *
632
+ * @access private
633
+ * @since 1.0.0
634
+ */
635
+ private function set_default_values() {
636
+ /*
637
+ * Note: The order of the entries affects the order in the frontend page
638
+ *
639
+ */
640
+ // process steps
641
+ $this->valid_steps = array(
642
+ 'start' => __( 'Select', $this->plugin_slug ),
643
+ 'select' => __( 'Add filter', $this->plugin_slug ),
644
+ 'refine' => __( 'Refine', $this->plugin_slug ),
645
+ 'confirm' => __( 'Confirm', $this->plugin_slug ),
646
+ 'perform' => __( 'Perform', $this->plugin_slug ),
647
+ );
648
+ // actions
649
+ $this->valid_actions = array(
650
+ 'assign' => __( 'Set the selected image as new featured image', $this->plugin_slug ),
651
+ 'replace' => __( 'Replace featured images by the selected image', $this->plugin_slug ),
652
+ 'remove' => __( 'Remove the selected image as featured image', $this->plugin_slug ),
653
+ );
654
+ $this->valid_actions_without_image = array(
655
+ 'remove_any_img' => __( 'Remove any image as featured image', $this->plugin_slug ),
656
+ );
657
+ $this->valid_actions_multiple_images = array(
658
+ 'assign_randomly' => __( 'Set multiple images randomly as featured images', $this->plugin_slug ),
659
+ );
660
+ // process options
661
+ $this->valid_options = array(
662
+ 'overwrite' => __( 'Overwrite featured images', $this->plugin_slug ),
663
+ 'orphans_only' => __( 'Consider only posts without any featured image', $this->plugin_slug ),
664
+ );
665
+ // filters
666
+ $this->valid_filters = array(
667
+ 'filter_post_types' => __( 'Post Type Filter', $this->plugin_slug ),
668
+ 'filter_category' => __( 'Category Filter', $this->plugin_slug ),
669
+ 'filter_tag' => __( 'Tag Filter', $this->plugin_slug ),
670
+ );
671
+ // post types (generic and custom)
672
+ $label_posts = 'Posts';
673
+ $label_pages = 'Pages';
674
+ $this->valid_post_types = array(
675
+ 'post' => _x( $label_posts, 'post type general name' ),
676
+ 'page' => _x( $label_pages, 'post type general name' ),
677
+ );
678
+ $this->valid_custom_post_types = $this->get_registered_custom_post_types();
679
+ // mime types (supporting feat. images by default)
680
+ $this->valid_mime_types = array(
681
+ 'audio' => __( 'Audio files', $this->plugin_slug ),
682
+ 'video' => __( 'Video files', $this->plugin_slug ),
683
+ );
684
+ // statuses
685
+ $text = 'Private';
686
+ $label_private = _x( $text, 'post' );
687
+ $text = 'Published';
688
+ $label_publish = _x( $text, 'post' );
689
+ $text = 'Scheduled';
690
+ $label_future = _x( $text, 'post' );
691
+ $text = 'Pending';
692
+ $label_pending = _x( $text, 'post' );
693
+ $text = 'Draft';
694
+ $label_draft = _x( $text, 'post' );
695
+ $this->valid_statuses = array(
696
+ 'publish' => $label_publish,
697
+ 'pending' => $label_pending,
698
+ 'draft' => $label_draft,
699
+ 'future' => $label_future,
700
+ 'private' => $label_private
701
+ );
702
+ // time and dates
703
+ $this->valid_date_queries = array(
704
+ 'after' => __( 'Start Date', $this->plugin_slug ),
705
+ 'before' => __( 'End Date', $this->plugin_slug ),
706
+ 'inclusive' => __( 'Include the posts of the selected dates', $this->plugin_slug )
707
+ );
708
+ // custom fields
709
+ $this->valid_custom_field = array(
710
+ 'key' => __( 'Custom field name', $this->plugin_slug ),
711
+ 'compare' => __( 'Operator to test with the value in the custom field', $this->plugin_slug ),
712
+ 'value' => __( 'Custom field value to compare with', $this->plugin_slug ),
713
+ 'type' => __( 'Custom field type', $this->plugin_slug )
714
+ );
715
+ // custom taxonomies
716
+ $this->valid_custom_taxonomies = $this->get_registered_custom_taxonomies();
717
+ // image dimensions
718
+ $this->valid_image_dimensions = array(
719
+ 'max_width' => __( 'Image width in pixels lower than', $this->plugin_slug ),
720
+ 'max_height' => __( 'Image height in pixels lower than', $this->plugin_slug ),
721
+ );
722
+ // default: user selected image is required
723
+ $this->is_image_required = true;
724
+ // default: start form
725
+ $this->selected_step = 'start';
726
+ // default: no images
727
+ $this->selected_old_image_ids = array();
728
+ $this->selected_image_id = 0;
729
+ $this->selected_multiple_image_ids = array();
730
+ $this->is_error_no_old_image = false;
731
+ $this->is_direct_access = false;
732
+ $this->is_skip_refine = false;
733
+ // default: no category
734
+ $this->selected_category_id = 0;
735
+ // default: no parent page
736
+ $this->selected_parent_page_id = 0;
737
+ // default: no author
738
+ $this->selected_author_id = 0;
739
+ // default: no tag
740
+ $this->selected_tag_id = 0;
741
+ // default: no date query
742
+ $this->selected_date_queries = array( 'inclusive' => "1" ); // default: include posts matching selected time specifications
743
+ // default: all post statuses
744
+ $this->selected_statuses = array_keys( $this->valid_statuses ); // default: all statuses
745
+ // default: all post types
746
+ $this->selected_post_types = array_keys( $this->valid_post_types ); // default: all posts, pages and custom post types. old: posts only. No pages, no custom post types. old string: array_keys( $this->valid_post_types );
747
+ // default: all custom post types
748
+ $this->selected_custom_post_types = $this->valid_custom_post_types;
749
+ // default: no mime types
750
+ $this->selected_mime_types = array();
751
+ // default: no custom taxonomies
752
+ $this->selected_custom_taxonomies = array();
753
+ // default: no custom field
754
+ $this->selected_custom_field = array();
755
+ // default: no selected posts
756
+ $this->selected_post_ids = array();
757
+ // get user defined dimensions for thumbnails, else take 150 px and set maximum value if necessary
758
+ $max_dimension = 160; // width of thumbnail column in px at 1024 px window width
759
+ $this->used_thumbnail_width = get_option( 'thumbnail_size_w', $max_dimension );
760
+ $this->used_thumbnail_height = get_option( 'thumbnail_size_h', $max_dimension );
761
+ $this->used_thumbnail_width = $this->used_thumbnail_width > $max_dimension ? $max_dimension : $this->used_thumbnail_width;
762
+ $this->used_thumbnail_height = $this->used_thumbnail_height > $max_dimension ? $max_dimension : $this->used_thumbnail_height;
763
+ // default: stored sizes for thumbnails
764
+ $this->selected_image_dimensions = array(
765
+ 'max_width' => $this->used_thumbnail_width,
766
+ 'max_height' => $this->used_thumbnail_height,
767
+ );
768
+ // default: min 1 x 1 px, max 9999 x 9999 px images
769
+ $this->min_image_length = 1;
770
+ $this->max_image_length = 9999;
771
+ // slug for cached results
772
+ $this->transient_name = 'quick_featured_images_results';
773
+ }
774
+
775
+ /**
776
+ *
777
+ * Render the header of the admin page
778
+ *
779
+ * @access private
780
+ * @since 1.0.0
781
+ */
782
+ private function display_header() {
783
+ include_once( 'views/section_header_progress.php' );
784
+ }
785
+
786
+ /**
787
+ *
788
+ * Render the footer of the admin page
789
+ *
790
+ * @access private
791
+ * @since 1.0.0
792
+ */
793
+ private function display_footer() {
794
+ include_once( 'views/section_footer.php' );
795
+ }
796
+
797
+ /**
798
+ *
799
+ * Render the error page
800
+ *
801
+ * @access private
802
+ * @since 1.0.0
803
+ * @updated 9.1: added header to fixed bug in process bar when user skips filters
804
+ */
805
+ private function display_error( $reason, $value_name ) {
806
+ // print header
807
+ $this->display_header();
808
+ // print error message
809
+ switch ( $reason ) {
810
+ case 'missing_input_value':
811
+ $msg = sprintf( __( 'The input field %s is empty.', $this->plugin_slug ), $value_name );
812
+ $solution = __( 'Type in a value into the input field.', $this->plugin_slug );
813
+ break;
814
+ case 'missing_variable':
815
+ $msg = sprintf( __( '%s is not defined.', $this->plugin_slug ), $value_name );
816
+ $solution = __ ('Check how to define the value.', $this->plugin_slug );
817
+ break;
818
+ case 'no_image':
819
+ $msg = __( 'There is no selected image.', $this->plugin_slug );
820
+ $solution = __( 'Select an image from the media library.', $this->plugin_slug );
821
+ break;
822
+ case 'wrong_action':
823
+ $msg = __( 'You have not selected an action.', $this->plugin_slug );
824
+ $solution = __( 'Start again and select which action you want to apply.', $this->plugin_slug );
825
+ break;
826
+ case 'wrong_value':
827
+ $msg = sprintf( __( 'The input field %s has an invalid value.', $this->plugin_slug ), $value_name );
828
+ $solution = __( 'Type in valid values in the input field.', $this->plugin_slug );
829
+ break;
830
+ case 'no_result':
831
+ $msg = $value_name;
832
+ $solution = __( 'Type in values stored by WordPress.', $this->plugin_slug );
833
+ break;
834
+ } // switch ( $reason )
835
+ include_once( 'views/section_errormsg.php' );
836
+ //die();
837
+ } // display_error()
838
+
839
+ /**
840
+ * Call the WP Query and apply the selected action to found posts
841
+ *
842
+ * Is an alias to 'find_posts( true )' for more readability
843
+ *
844
+ * @access private
845
+ * @since 1.0.0
846
+ *
847
+ */
848
+ private function perform_action() {
849
+ return $this->find_posts( true );
850
+ }
851
+
852
+ /**
853
+ * Do the loop to find posts, change the thumbnail if param is true
854
+ *
855
+ * @access private
856
+ * @since 1.0.0
857
+ *
858
+ * @return array affected posts
859
+ */
860
+ private function find_posts( $perform = false ) {
861
+ // initialise result array
862
+ $results = array();
863
+ // define thumbnail properties
864
+ $size = array(
865
+ absint( $this->used_thumbnail_width / 2 ),
866
+ absint( $this->used_thumbnail_height / 2 )
867
+ );
868
+ $attr = array( 'class' => 'attachment-thumbnail' );
869
+ // define caching arrays for better performance while calculating attachment images
870
+ $false_id = 'false_id'; // something to use as an array key
871
+ $current_featured_images = array();
872
+ $future_featured_images = array();
873
+ $current_featured_images[ $false_id ] = false;
874
+ $future_featured_images[ $false_id ] = false;
875
+ // get selected options once
876
+ $is_option = array();
877
+ foreach ( array_keys( $this->valid_options ) as $key ) {
878
+ $is_option[ $key ] = in_array( $key, $this->selected_options );
879
+ }
880
+
881
+ /* three types of tasks:
882
+ if perform:
883
+ if no transient:
884
+ 1: set thumbs via query
885
+ else:
886
+ 2: set thumbs via transient
887
+ else:
888
+ 3: get preview via query
889
+ */
890
+ if ( $perform ) { // really make changes
891
+ // check for cached data; use them for fast processing, else use query
892
+ // if removal was selected use query, too
893
+ if ( false === ( $query_results = get_transient( $this->transient_name ) ) ) {
894
+ // they weren't there, so use the query
895
+ $the_query = new WP_Query( $this->get_query_args() );
896
+ //printf( '<p>%s</p>', $the_query->request ); // just for debugging
897
+ // The Loop
898
+ if ( $the_query->have_posts() ) {
899
+ // do task dependent on selected action
900
+ switch ( $this->selected_action ) {
901
+ case 'assign':
902
+ while ( $the_query->have_posts() ) {
903
+ $the_query->the_post();
904
+ // get the post id once
905
+ $post_id = get_the_ID();
906
+ // check if there is an existing featured image
907
+ $thumb_id = get_post_thumbnail_id( $post_id );
908
+ // if post with featured images should be ignored, jump to next loop
909
+ if ( $thumb_id and $is_option[ 'orphans_only' ] ) {
910
+ continue;
911
+ }
912
+ $success = false;
913
+ // if no existing featured image or if permission to overwrite it
914
+ if ( ! $thumb_id or $is_option[ 'overwrite' ] ) {
915
+ // set featured image id
916
+ $thumb_id = $this->selected_image_id;
917
+ // do the task
918
+ $success = set_post_thumbnail( $post_id, $thumb_id );
919
+ }
920
+ // get html for featured image for check
921
+ $thumb_id = get_post_thumbnail_id( $post_id );
922
+ // if existing featured image
923
+ if ( $thumb_id ) {
924
+ // get thumbnail html if not yet got
925
+ if ( ! isset( $current_featured_images[ $thumb_id ] ) ) {
926
+ $current_featured_images[ $thumb_id ] = wp_get_attachment_image( $thumb_id, $size, false, $attr );
927
+ }
928
+ } else {
929
+ // nothing changed
930
+ $thumb_id = $false_id; // cast from '' or 'false' to a value to use as an array key
931
+ }
932
+ // store edit link, post title, image html, success of action (true or false)
933
+ $results[] = array(
934
+ get_edit_post_link(),
935
+ get_the_title(),
936
+ $current_featured_images[ $thumb_id ],
937
+ $success
938
+ );
939
+ } // while(have_posts)
940
+ break;
941
+ case 'assign_randomly':
942
+ $last_index = count( $this->selected_multiple_image_ids ) - 1;
943
+ while ( $the_query->have_posts() ) {
944
+ $the_query->the_post();
945
+ // get the post id once
946
+ $post_id = get_the_ID();
947
+ // check if there is an existing featured image
948
+ $thumb_id = get_post_thumbnail_id( $post_id );
949
+ // if post with featured images should be ignored, jump to next loop
950
+ if ( $thumb_id and $is_option[ 'orphans_only' ] ) {
951
+ continue;
952
+ }
953
+ $success = false;
954
+ // if no existing featured image or if permission to overwrite it
955
+ if ( ! $thumb_id or $is_option[ 'overwrite' ] ) {
956
+ // set featured image id
957
+ $thumb_id = $this->selected_multiple_image_ids[ rand( 0, $last_index ) ];
958
+ // do the task
959
+ $success = set_post_thumbnail( $post_id, $thumb_id );
960
+ }
961
+ // get html for featured image for check
962
+ $thumb_id = get_post_thumbnail_id( $post_id );
963
+ // if existing featured image
964
+ if ( $thumb_id ) {
965
+ // get thumbnail html if not yet got
966
+ if ( ! isset( $current_featured_images[ $thumb_id ] ) ) {
967
+ $current_featured_images[ $thumb_id ] = wp_get_attachment_image( $thumb_id, $size, false, $attr );
968
+ }
969
+ } else {
970
+ // nothing changed
971
+ $thumb_id = $false_id; // cast from '' or 'false' to a value to use as an array key
972
+ }
973
+ // store edit link, post title, image html, success of action (true or false)
974
+ $results[] = array(
975
+ get_edit_post_link(),
976
+ get_the_title(),
977
+ $current_featured_images[ $thumb_id ],
978
+ $success
979
+ );
980
+ } // while(have_posts)
981
+ break;
982
+ case 'replace':
983
+ while ( $the_query->have_posts() ) {
984
+ $the_query->the_post();
985
+ // get the post id once
986
+ $post_id = get_the_ID();
987
+ // do the task
988
+ $success = set_post_thumbnail( $post_id, $this->selected_image_id );
989
+ // get html for featured image for check
990
+ $thumb_id = get_post_thumbnail_id( $post_id );
991
+ if ( $thumb_id ) {
992
+ // get thumbnail html if not yet got
993
+ if ( ! isset( $current_featured_images[ $thumb_id ] ) ) {
994
+ $current_featured_images[ $thumb_id ] = wp_get_attachment_image( $thumb_id, $size, false, $attr );
995
+ }
996
+ } else {
997
+ // nothing changed
998
+ $thumb_id = $false_id; // cast from '' or 'false' to a value to use as an array key
999
+ }
1000
+ // store edit link, post title, image html, success of action (true or false)
1001
+ $results[] = array(
1002
+ get_edit_post_link(),
1003
+ get_the_title(),
1004
+ $current_featured_images[ $thumb_id ],
1005
+ $success
1006
+ );
1007
+ } // while(have_posts)
1008
+ break;
1009
+ case 'remove':
1010
+ case 'remove_any_img':
1011
+ while ( $the_query->have_posts() ) {
1012
+ $the_query->the_post();
1013
+ // get the post id once
1014
+ $post_id = get_the_ID();
1015
+ // do the task
1016
+ $success = delete_post_thumbnail( $post_id );
1017
+ // get html for featured image for check
1018
+ $thumb_id = get_post_thumbnail_id( $post_id );
1019
+ // if existing featured image
1020
+ if ( $thumb_id ) {
1021
+ // get thumbnail html if not yet got
1022
+ if ( ! isset( $current_featured_images[ $thumb_id ] ) ) {
1023
+ $current_featured_images[ $thumb_id ] = wp_get_attachment_image( $thumb_id, $size, false, $attr );
1024
+ }
1025
+ } else {
1026
+ // nothing changed
1027
+ $thumb_id = $false_id; // cast from '' or 'false' to a value to use as an array key
1028
+ }
1029
+ // store edit link, post title, image html, success of action (true or false)
1030
+ $results[] = array(
1031
+ get_edit_post_link(),
1032
+ get_the_title(),
1033
+ $current_featured_images[ $thumb_id ],
1034
+ $success
1035
+ );
1036
+ } // while(have_posts)
1037
+ break;
1038
+ } // switch(selected_action)
1039
+ } // if( have_posts )
1040
+ // Restore original post data after the query
1041
+ wp_reset_postdata();
1042
+ } else {
1043
+ // else if there are cached results
1044
+ // do task dependent on selected action
1045
+ switch ( $this->selected_action ) {
1046
+ case 'assign':
1047
+ foreach ( $query_results as $post_id => $thumb_id ) {
1048
+ // cast "false" value to boolean false
1049
+ if ( $thumb_id == $false_id ) {
1050
+ $thumb_id = false;
1051
+ }
1052
+ // check if there is an existing featured image
1053
+ $current_thumb_id = get_post_thumbnail_id( $post_id );
1054
+ // if post with featured images should be ignored, jump to next loop
1055
+ if ( $current_thumb_id and $is_option[ 'orphans_only' ] ) {
1056
+ continue;
1057
+ }
1058
+ $success = false;
1059
+ // if no existing featured image or if permission to overwrite it
1060
+ if ( ! $current_thumb_id or $is_option[ 'overwrite' ] ) {
1061
+ // do the task
1062
+ $success = set_post_thumbnail( $post_id, $thumb_id );
1063
+ }
1064
+ // get html for featured image for check
1065
+ $thumb_id = get_post_thumbnail_id( $post_id );
1066
+ // if existing featured image
1067
+ if ( $thumb_id ) {
1068
+ // get thumbnail html if not yet got
1069
+ if ( ! isset( $current_featured_images[ $thumb_id ] ) ) {
1070
+ $current_featured_images[ $thumb_id ] = wp_get_attachment_image( $thumb_id, $size, false, $attr );
1071
+ }
1072
+ } else {
1073
+ // nothing changed
1074
+ $thumb_id = $false_id; // cast from '' or 'false' to a value to use as an array key
1075
+ }
1076
+ // store edit link, post title, image html, success of action (true or false)
1077
+ $results[] = array(
1078
+ get_edit_post_link(),
1079
+ get_the_title(),
1080
+ $current_featured_images[ $thumb_id ],
1081
+ $success
1082
+ );
1083
+ } // foreach()
1084
+ break;
1085
+ case 'assign_randomly':
1086
+ foreach ( $query_results as $post_id => $thumb_id ) {
1087
+ // cast "false" value to boolean false
1088
+ if ( $thumb_id == $false_id ) {
1089
+ $thumb_id = false;
1090
+ }
1091
+ // if post with featured images should be ignored, jump to next loop
1092
+ if ( $thumb_id and $is_option[ 'orphans_only' ] ) {
1093
+ continue;
1094
+ }
1095
+ $success = false;
1096
+ // check if there is an existing featured image
1097
+ $current_thumb_id = get_post_thumbnail_id( $post_id );
1098
+ // if existing featured image
1099
+ if ( $current_thumb_id ) {
1100
+ // if new image
1101
+ if ( $thumb_id ) {
1102
+ // if permission to overwrite existing image
1103
+ if ( $is_option[ 'overwrite' ] ) {
1104
+ // do the task
1105
+ $success = set_post_thumbnail( $post_id, $thumb_id );
1106
+ } else {
1107
+ // do nothing : keep existing image
1108
+ } // if ( overwrite )
1109
+ } // if ( new image )
1110
+ // if no existing featured image
1111
+ } else {
1112
+ // if new image
1113
+ if ( $thumb_id ) {
1114
+ // do the task
1115
+ $success = set_post_thumbnail( $post_id, $thumb_id );
1116
+ } else {
1117
+ // do nothing : no image
1118
+ } // if ( new image )
1119
+ } // if ( existing image )
1120
+ // get html for featured image for check
1121
+ $thumb_id = get_post_thumbnail_id( $post_id );
1122
+ // if existing featured image
1123
+ if ( $thumb_id ) {
1124
+ // get thumbnail html if not yet got
1125
+ if ( ! isset( $current_featured_images[ $thumb_id ] ) ) {
1126
+ $current_featured_images[ $thumb_id ] = wp_get_attachment_image( $thumb_id, $size, false, $attr );
1127
+ }
1128
+ } else {
1129
+ // nothing changed
1130
+ $thumb_id = $false_id; // cast from '' or 'false' to a value to use as an array key
1131
+ }
1132
+ // store edit link, post title, image html, success of action (true or false)
1133
+ $results[] = array(
1134
+ get_edit_post_link(),
1135
+ get_the_title(),
1136
+ $current_featured_images[ $thumb_id ],
1137
+ $success
1138
+ );
1139
+ } // foreach()
1140
+ break;
1141
+ case 'replace':
1142
+ foreach ( $query_results as $post_id => $thumb_id ) {
1143
+ // do the task
1144
+ $success = set_post_thumbnail( $post_id, $thumb_id );
1145
+ // get html for featured image for check
1146
+ $thumb_id = get_post_thumbnail_id( $post_id );
1147
+ if ( $thumb_id ) {
1148
+ // get thumbnail html if not yet got
1149
+ if ( ! isset( $current_featured_images[ $thumb_id ] ) ) {
1150
+ $current_featured_images[ $thumb_id ] = wp_get_attachment_image( $thumb_id, $size, false, $attr );
1151
+ }
1152
+ } else {
1153
+ // nothing changed
1154
+ $thumb_id = $false_id; // cast from '' or 'false' to a value to use as an array key
1155
+ }
1156
+ // store edit link, post title, image html, success of action (true or false)
1157
+ $results[] = array(
1158
+ get_edit_post_link(),
1159
+ get_the_title(),
1160
+ $current_featured_images[ $thumb_id ],
1161
+ $success
1162
+ );
1163
+ } // foreach()
1164
+ break;
1165
+ case 'remove':
1166
+ case 'remove_any_img':
1167
+ foreach ( $query_results as $post_id => $thumb_id ) {
1168
+ // do the task
1169
+ $success = delete_post_thumbnail( $post_id );
1170
+ // get html for featured image for check
1171
+ $thumb_id = get_post_thumbnail_id( $post_id );
1172
+ if ( $thumb_id ) {
1173
+ // get thumbnail html if not yet got
1174
+ if ( ! isset( $current_featured_images[ $thumb_id ] ) ) {
1175
+ $current_featured_images[ $thumb_id ] = wp_get_attachment_image( $thumb_id, $size, false, $attr );
1176
+ }
1177
+ } else {
1178
+ // nothing changed
1179
+ $thumb_id = $false_id; // cast from '' or 'false' to a value to use as an array key
1180
+ }
1181
+ // store edit link, post title, image html, success of action (true or false)
1182
+ $results[] = array(
1183
+ get_edit_post_link(),
1184
+ get_the_title(),
1185
+ $current_featured_images[ $thumb_id ],
1186
+ $success
1187
+ );
1188
+ } // foreach()
1189
+ break;
1190
+ } // switch(selected_action)
1191
+ // delete cached results manually
1192
+ delete_transient( $this->transient_name );
1193
+ } // if transient
1194
+ } else {
1195
+ $query_results = array();
1196
+ $the_query = new WP_Query( $this->get_query_args() );
1197
+ //printf( '<p>%s</p>', $the_query->request ); // just for debugging
1198
+ // The Loop
1199
+ if ( $the_query->have_posts() ) {
1200
+ // do task dependent on selected action
1201
+ switch ( $this->selected_action ) {
1202
+ case 'assign':
1203
+ while ( $the_query->have_posts() ) {
1204
+ $the_query->the_post();
1205
+ // get the post id once
1206
+ $post_id = get_the_ID();
1207
+ // check if there is an existing featured image
1208
+ $current_thumb_id = get_post_thumbnail_id( $post_id );
1209
+ // if post with featured images should be ignored, jump to next loop
1210
+ if ( $current_thumb_id and $is_option[ 'orphans_only' ] ) {
1211
+ continue;
1212
+ }
1213
+ if ( $current_thumb_id ) {
1214
+ // get thumbnail html if not yet got
1215
+ if ( ! isset( $current_featured_images[ $current_thumb_id ] ) ) {
1216
+ $current_featured_images[ $current_thumb_id ] = wp_get_attachment_image( $current_thumb_id, $size, false, $attr );
1217
+ }
1218
+ // get html of future thumbnail
1219
+ if ( $is_option[ 'overwrite' ] ) {
1220
+ // preview old thumb + new thumb
1221
+ $future_thumb_id = $this->selected_image_id;
1222
+ // get thumbnail html if not yet got
1223
+ if ( ! isset( $future_featured_images[ $future_thumb_id ] ) ) {
1224
+ $future_featured_images[ $future_thumb_id ] = wp_get_attachment_image( $future_thumb_id, $size, false, $attr );
1225
+ }
1226
+ } else {
1227
+ // preview old thumb + old thumb
1228
+ $future_thumb_id = $current_thumb_id;
1229
+ $future_featured_images[ $future_thumb_id ] = $current_featured_images[ $current_thumb_id ];
1230
+ }
1231
+ } else {
1232
+ // preview no old thumb + new thumb
1233
+ $current_thumb_id = $false_id; // cast from '' or 'false' to a value to use as an array key
1234
+ // get html of future thumbnail
1235
+ $future_thumb_id = $this->selected_image_id;
1236
+ // get thumbnail html if not yet got
1237
+ if ( ! isset( $future_featured_images[ $future_thumb_id ] ) ) {
1238
+ $future_featured_images[ $future_thumb_id ] = wp_get_attachment_image( $future_thumb_id, $size, false, $attr );
1239
+ }
1240
+ }
1241
+ // store edit link, post title, post date, post author, current image html, future image html
1242
+ $results[] = array(
1243
+ get_edit_post_link(),
1244
+ get_the_title(),
1245
+ get_the_date(),
1246
+ get_the_author(),
1247
+ $current_featured_images[ $current_thumb_id ],
1248
+ $future_featured_images[ $future_thumb_id ],
1249
+ get_post_status(),
1250
+ get_post_type(),
1251
+ );
1252
+ // notice result for cache
1253
+ $query_results[ $post_id ] = $future_thumb_id;
1254
+ } // while(have_posts)
1255
+ break;
1256
+ case 'assign_randomly':
1257
+ $last_index = count( $this->selected_multiple_image_ids ) - 1;
1258
+ /*
1259
+ * 1. use selected images multiple times randomly and
1260
+ * 2. overwrite existing featured images
1261
+ */
1262
+ if ( $is_option[ 'overwrite' ] ) {
1263
+ while ( $the_query->have_posts() ) {
1264
+ $the_query->the_post();
1265
+ // get the post id once
1266
+ $post_id = get_the_ID();
1267
+ // check if there is an existing featured image
1268
+ $current_thumb_id = get_post_thumbnail_id( $post_id );
1269
+ // if post with featured images should be ignored, jump to next loop
1270
+ if ( $current_thumb_id and $is_option[ 'orphans_only' ] ) {
1271
+ continue;
1272
+ }
1273
+ // if existing featured image
1274
+ if ( $current_thumb_id ) {
1275
+ // get thumbnail html if not yet got
1276
+ if ( ! isset( $current_featured_images[ $current_thumb_id ] ) ) {
1277
+ $current_featured_images[ $current_thumb_id ] = wp_get_attachment_image( $current_thumb_id, $size, false, $attr );
1278
+ }
1279
+ } else {
1280
+ $current_thumb_id = $false_id; // cast from '' or 'false' to a value to use as an array key
1281
+ }
1282
+ // set image randomly : future image = new image
1283
+ $future_thumb_id = $this->selected_multiple_image_ids[ rand( 0, $last_index ) ]; // get thumb id randomly
1284
+ // get thumbnail html if not yet got
1285
+ if ( ! isset( $future_featured_images[ $future_thumb_id ] ) ) {
1286
+ $future_featured_images[ $future_thumb_id ] = wp_get_attachment_image( $future_thumb_id, $size, false, $attr );
1287
+ }
1288
+ // store edit link, post title, post date, post author, current image html, future image html
1289
+ $results[] = array(
1290
+ get_edit_post_link(),
1291
+ get_the_title(),
1292
+ get_the_date(),
1293
+ get_the_author(),
1294
+ $current_featured_images[ $current_thumb_id ],
1295
+ $future_featured_images[ $future_thumb_id ],
1296
+ get_post_status(),
1297
+ get_post_type(),
1298
+ );
1299
+ // notice result for cache
1300
+ $query_results[ $post_id ] = $future_thumb_id;
1301
+ } // while(have_posts)
1302
+ /* else
1303
+ * 1. use selected images multiple times randomly and
1304
+ * 2. do not overwrite existing featured images
1305
+ */
1306
+ } else {
1307
+ while ( $the_query->have_posts() ) {
1308
+ $the_query->the_post();
1309
+ // get the post id once
1310
+ $post_id = get_the_ID();
1311
+ // check if there is an existing featured image
1312
+ $current_thumb_id = get_post_thumbnail_id( $post_id );
1313
+ // if post with featured images should be ignored, jump to next loop
1314
+ if ( $current_thumb_id and $is_option[ 'orphans_only' ] ) {
1315
+ continue;
1316
+ }
1317
+ // if existing featured image
1318
+ if ( $current_thumb_id ) {
1319
+ // get thumbnail html if not yet got
1320
+ if ( ! isset( $current_featured_images[ $current_thumb_id ] ) ) {
1321
+ $current_featured_images[ $current_thumb_id ] = wp_get_attachment_image( $current_thumb_id, $size, false, $attr );
1322
+ }
1323
+ // do nothing : future image = current image
1324
+ $future_thumb_id = $current_thumb_id;
1325
+ $future_featured_images[ $future_thumb_id ] = $current_featured_images[ $current_thumb_id ];
1326
+ } else {
1327
+ $current_thumb_id = $false_id; // cast from '' or 'false' to a value to use as an array key
1328
+ // set image randomly : future image = new image
1329
+ $future_thumb_id = $this->selected_multiple_image_ids[ rand( 0, $last_index ) ]; // get thumb id randomly
1330
+ // get thumbnail html if not yet got
1331
+ if ( ! isset( $future_featured_images[ $future_thumb_id ] ) ) {
1332
+ $future_featured_images[ $future_thumb_id ] = wp_get_attachment_image( $future_thumb_id, $size, false, $attr );
1333
+ }
1334
+ }
1335
+ // store edit link, post title, post date, post author, current image html, future image html
1336
+ $results[] = array(
1337
+ get_edit_post_link(),
1338
+ get_the_title(),
1339
+ get_the_date(),
1340
+ get_the_author(),
1341
+ $current_featured_images[ $current_thumb_id ],
1342
+ $future_featured_images[ $future_thumb_id ],
1343
+ get_post_status(),
1344
+ get_post_type(),
1345
+ );
1346
+ // notice result for cache
1347
+ $query_results[ $post_id ] = $future_thumb_id;
1348
+ } // while(have_posts)
1349
+ } // if ( overwrite )
1350
+ break;
1351
+ case 'replace':
1352
+ while ( $the_query->have_posts() ) {
1353
+ $the_query->the_post();
1354
+ // get the post id once
1355
+ $post_id = get_the_ID();
1356
+ // check if there is an existing featured image
1357
+ $current_thumb_id = get_post_thumbnail_id( $post_id );
1358
+ if ( $current_thumb_id ) {
1359
+ // get thumbnail html if not yet got
1360
+ if ( ! isset( $current_featured_images[ $current_thumb_id ] ) ) {
1361
+ $current_featured_images[ $current_thumb_id ] = wp_get_attachment_image( $current_thumb_id, $size, false, $attr );
1362
+ }
1363
+ } else {
1364
+ $current_thumb_id = $false_id; // cast from '' or 'false' to a value to use as an array key
1365
+ }
1366
+ // get html of future thumbnail
1367
+ $future_thumb_id = $this->selected_image_id;
1368
+ // get thumbnail html if not yet got
1369
+ if ( ! isset( $future_featured_images[ $future_thumb_id ] ) ) {
1370
+ $future_featured_images[ $future_thumb_id ] = wp_get_attachment_image( $future_thumb_id, $size, false, $attr );
1371
+ }
1372
+ // store edit link, post title, post date, post author, current image html, future image html
1373
+ $results[] = array(
1374
+ get_edit_post_link(),
1375
+ get_the_title(),
1376
+ get_the_date(),
1377
+ get_the_author(),
1378
+ $current_featured_images[ $current_thumb_id ],
1379
+ $future_featured_images[ $future_thumb_id ],
1380
+ get_post_status(),
1381
+ get_post_type(),
1382
+ );
1383
+ // notice result for cache
1384
+ $query_results[ $post_id ] = $future_thumb_id;
1385
+ } // while(have_posts)
1386
+ break;
1387
+ case 'remove':
1388
+ case 'remove_any_img':
1389
+ $future_thumb_id = false;
1390
+ while ( $the_query->have_posts() ) {
1391
+ $the_query->the_post();
1392
+ // get the post id once
1393
+ $post_id = get_the_ID();
1394
+ // get html for featured image
1395
+ $current_thumb_id = get_post_thumbnail_id( $post_id );
1396
+ if ( $current_thumb_id ) {
1397
+ // get thumbnail html if not yet got
1398
+ if ( ! isset( $current_featured_images[ $current_thumb_id ] ) ) {
1399
+ $current_featured_images[ $current_thumb_id ] = wp_get_attachment_image( $current_thumb_id, $size, false, $attr );
1400
+ }
1401
+ } else {
1402
+ $current_thumb_id = $false_id; // cast from '' or 'false' to a value to use as an array key
1403
+ }
1404
+ // store edit link, post title, post date, post author, current image html, future image html
1405
+ $results[] = array(
1406
+ get_edit_post_link(),
1407
+ get_the_title(),
1408
+ get_the_date(),
1409
+ get_the_author(),
1410
+ $current_featured_images[ $current_thumb_id ],
1411
+ $future_thumb_id,
1412
+ get_post_status(),
1413
+ get_post_type(),
1414
+ );
1415
+ // notice result for cache
1416
+ $query_results[ $post_id ] = $future_thumb_id;
1417
+ } // while(have_posts)
1418
+ } // switch(selected_action)
1419
+ } // if( have_posts )
1420
+ // Restore original post data after the query
1421
+ wp_reset_postdata();
1422
+ // store results as transient for 1 day at the longest
1423
+ set_transient( $this->transient_name, $query_results, DAY_IN_SECONDS );
1424
+ } // if perform
1425
+
1426
+ // return results
1427
+ return $results;
1428
+ }
1429
+
1430
+ /**
1431
+ * Check the arguments for WP_Query depended on users selection
1432
+ *
1433
+ * @access private
1434
+ * @since 1.0.0
1435
+ *
1436
+ * @return array the args
1437
+ */
1438
+ private function get_query_args() {
1439
+ // define default params
1440
+ $args[ 'posts_per_page' ] = -1; // do not use pagination, return whole result at once
1441
+ $args[ 'no_found_rows' ] = true; // since no pagination: tell WordPress not to run SQL_CALC_FOUND_ROWS on the SQL query; drastically speeding up the query
1442
+ $args[ 'orderby' ] = 'title';
1443
+ $args[ 'order' ] = 'ASC';
1444
+ $args[ 'ignore_sticky_posts' ] = true;
1445
+ $args[ 'post_type' ] = array_merge ( $this->selected_post_types, $this->selected_custom_post_types );
1446
+ switch ( $this->selected_action ) {
1447
+ case 'replace':
1448
+ $this->selected_post_ids = $this->get_post_ids_of_old_thumbnails();
1449
+ $args[ 'post__in' ] = $this->get_id_array_for_query( $this->selected_post_ids );
1450
+ break;
1451
+ case 'remove':
1452
+ $this->selected_post_ids = $this->get_post_ids_of_thumbnail();
1453
+ $args[ 'post__in' ] = $this->get_id_array_for_query( $this->selected_post_ids );
1454
+ } // switch(selected_action)
1455
+
1456
+ if ( $this->selected_filters ) {
1457
+ // set desired post types and statusses
1458
+ if ( in_array( 'filter_post_types', $this->selected_filters ) ) {
1459
+ $this->selected_post_types = $this->get_sanitized_post_types();
1460
+ if ( ! $this->selected_post_types ) {
1461
+ // add a fictitious post type to get no result (and not to get a list of all posts)
1462
+ $args[ 'post_type' ] = 'abcdefghi'; // assume there is not and will be never a post type with this name
1463
+ }
1464
+ }
1465
+ // add other user inputs
1466
+ foreach ( $this->selected_filters as $filter ) {
1467
+ switch ( $filter ) {
1468
+ case 'filter_category':
1469
+ $this->selected_category_id = $this->get_sanitized_category_id();
1470
+ // if there is a selected category assign it to the query
1471
+ if ( 0 < $this->selected_category_id ) {
1472
+ $args[ 'cat' ] = $this->selected_category_id; // todo: user selects more than 1 category, 'category__in'
1473
+ }
1474
+ break;
1475
+ case 'filter_tag':
1476
+ $this->selected_tag_id = $this->get_sanitized_tag_id();
1477
+ // if there is a selected tag assign it to the query
1478
+ if ( 0 < $this->selected_tag_id ) {
1479
+ $args[ 'tag_id' ] = $this->selected_tag_id; // todo: user selects more than 1 tag, 'tag__in'
1480
+ }
1481
+ break;
1482
+ } // switch(filter)
1483
+ } // foreach(filter)
1484
+ } // if(filters)
1485
+ #$this->dambedei($args);
1486
+ return $args;
1487
+ }
1488
+
1489
+ /**
1490
+ *
1491
+ * Render options of HTML selection lists with strings as values
1492
+ *
1493
+ * @access private
1494
+ * @since 1.0.0
1495
+ */
1496
+ private function get_html_options_strings( $arr, $key, $options, $first_empty = true ) {
1497
+ $output = $first_empty ? $this->get_html_empty_option() : '';
1498
+ $is_key = isset( $arr[ $key ] );
1499
+ if ( $is_key ) {
1500
+ foreach ( $options as $key => $label ) {
1501
+ $output .= sprintf( '<option value="%s" %s>%s</option>', $key, selected( $is_key , true, false ), $label );
1502
+ }
1503
+ } else {
1504
+ foreach ( $options as $key => $label ) {
1505
+ $output .= sprintf( '<option value="%s">%s</option>', $key, $label );
1506
+ }
1507
+ }
1508
+ return $output;
1509
+ }
1510
+
1511
+ /**
1512
+ *
1513
+ * Return empty option for selection field
1514
+ *
1515
+ * @access private
1516
+ * @since 3.0
1517
+ */
1518
+ private function get_html_empty_option() {
1519
+ $text = '&mdash; Select &mdash;';
1520
+ return sprintf( '<option value="">%s</option>', __( $text ) );
1521
+ }
1522
+
1523
+ /**
1524
+ * Returns the post ids which are assigned with the featured images which should be replaced
1525
+ *
1526
+ * @access private
1527
+ * @since 1.0.0
1528
+ *
1529
+ * @return array the post ids assigned with the thumbnails
1530
+ */
1531
+ private function get_post_ids_of_old_thumbnails() {
1532
+ $this->selected_old_image_ids = $this->get_sanitized_array( 'replacement_image_ids', $this->get_featured_image_ids() );
1533
+ return $this->get_post_ids_of_featured_image_ids( $this->selected_old_image_ids );
1534
+ }
1535
+
1536
+ /**
1537
+ * Returns the post ids which are assigned with the featured image which should be removed
1538
+ *
1539
+ * @access private
1540
+ * @since 1.0.0
1541
+ *
1542
+ * @return array the post ids assigned with the thumbnail
1543
+ */
1544
+ private function get_post_ids_of_thumbnail() {
1545
+ $post_ids = array();
1546
+ global $wpdb;
1547
+ // get a normal array all names of meta keys except the WP builtins meta keys beginning with an underscore '_'
1548
+ $results = $wpdb->get_results( $wpdb->prepare( "SELECT `post_id` FROM $wpdb->postmeta WHERE `meta_key` = '_thumbnail_id' AND `meta_value` = %d", $this->selected_image_id ), ARRAY_N );
1549
+ // flatten and sanitize results
1550
+ if ( $results ) {
1551
+ foreach ( $results as $r ) {
1552
+ $post_ids[] = absint( $r[ 0 ] );
1553
+ }
1554
+ }
1555
+ if ( empty( $post_ids ) ) {
1556
+ $post_ids[] = 0; // enter at least one element with no sense to yield 0 results with WP_QUERY()
1557
+ }
1558
+ return $post_ids;
1559
+ }
1560
+
1561
+ /**
1562
+ * Returns the posts ids which are assigned to given featured image ids
1563
+ *
1564
+ * @access private
1565
+ * @since 2.0
1566
+ *
1567
+ * @return array the post ids assigned to given featured images
1568
+ */
1569
+ private function get_post_ids_of_featured_image_ids( $image_ids = array() ) {
1570
+ $post_ids = array();
1571
+ global $wpdb;
1572
+ // get a normal array with all IDs of posts assigned with the image ids
1573
+ foreach ( $image_ids as $id ) {
1574
+ $results = $wpdb->get_results( $wpdb->prepare( "SELECT `post_id` FROM $wpdb->postmeta WHERE `meta_key` = '_thumbnail_id' AND `meta_value` = %d", $id ), ARRAY_N );
1575
+ // flatten and sanitize results
1576
+ if ( $results ) {
1577
+ foreach ( $results as $r ) {
1578
+ $post_ids[] = absint( $r[ 0 ] );
1579
+ }
1580
+ }
1581
+ } // foreach()
1582
+ return $post_ids;
1583
+ }
1584
+
1585
+ /**
1586
+ * Returns the thumbnails ids which are assigned with a post
1587
+ *
1588
+ * @access private
1589
+ * @since 1.0.0
1590
+ *
1591
+ * @return array the image ids assigned to posts as featured images
1592
+ */
1593
+ private function get_featured_image_ids() {
1594
+ $image_ids = array();
1595
+ global $wpdb;
1596
+ // get a normal array all names of meta keys except the WP builtins meta keys beginning with an underscore '_'
1597
+ $results = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT `meta_value` FROM $wpdb->postmeta WHERE `meta_key` LIKE '_thumbnail_id' AND `meta_value` != %d", $this->selected_image_id ), ARRAY_N );
1598
+ // flatten and sanitize results
1599
+ if ( $results ) {
1600
+ foreach ( $results as $r ) {
1601
+ $image_ids[] = absint( $r[ 0 ] );
1602
+ }
1603
+ }
1604
+ return $image_ids;
1605
+ }
1606
+
1607
+ /**
1608
+ * Check the step parameter and return safe values
1609
+ *
1610
+ * @access private
1611
+ * @since 1.0.0
1612
+ *
1613
+ * @return string the name of the step the plugin should take
1614
+ */
1615
+ private function get_sanitized_step() {
1616
+ return $this->get_sanitized_value(
1617
+ 'step',
1618
+ array_keys( $this->valid_steps ),
1619
+ 'start'
1620
+ );
1621
+ }
1622
+
1623
+ /**
1624
+ * Check the action parameter and return safe values
1625
+ *
1626
+ * @access private
1627
+ * @since 1.0.0
1628
+ *
1629
+ * @return string the name of the action the plugin should perform, else empty string
1630
+ */
1631
+ private function get_sanitized_action() {
1632
+ return $this->get_sanitized_value(
1633
+ 'action',
1634
+ array_keys( array_merge( $this->valid_actions, $this->valid_actions_without_image, $this->valid_actions_multiple_images ) )
1635
+ );
1636
+ }
1637
+
1638
+ /**
1639
+ * Check the requested filters and return safe values
1640
+ *
1641
+ * @access private
1642
+ * @since 1.0.0
1643
+ *
1644
+ * @return array the names of the filters
1645
+ */
1646
+ private function get_sanitized_filter_names() {
1647
+ return $this->get_sanitized_array(
1648
+ 'filters',
1649
+ array_keys( $this->valid_filters )
1650
+ );
1651
+ }
1652
+
1653
+ /**
1654
+ * Check the requested options and return safe values
1655
+ *
1656
+ * @access private
1657
+ * @since 5.1
1658
+ *
1659
+ * @return array the names of the options
1660
+ */
1661
+ private function get_sanitized_option_names() {
1662
+ return $this->get_sanitized_array(
1663
+ 'options',
1664
+ array_keys( $this->valid_options )
1665
+ );
1666
+ }
1667
+
1668
+ /**
1669
+ * Check the requested post types and return safe values
1670
+ *
1671
+ * @access private
1672
+ * @since 1.0.0
1673
+ *
1674
+ * @return array the names of the selected post types
1675
+ */
1676
+ private function get_sanitized_post_types() {
1677
+ return $this->get_sanitized_array(
1678
+ 'post_types',
1679
+ array_keys( $this->valid_post_types )
1680
+ );
1681
+ }
1682
+
1683
+ /**
1684
+ * Check the parameter defined by key and return safe value
1685
+ * Written to return a single value, e.g. for radio buttons
1686
+ *
1687
+ * @access private
1688
+ * @since 1.0.0
1689
+ *
1690
+ * @return mixed the user selected valid value or the default value
1691
+ */
1692
+ private function get_sanitized_value( $key, $valid_values, $default_value = null ) {
1693
+ $value = isset( $_REQUEST[ $key ] ) ? $_REQUEST[ $key ] : $default_value;
1694
+ if ( in_array( $value, $valid_values ) ) {
1695
+ return $value;
1696
+ } else {
1697
+ return $default_value;
1698
+ }
1699
+ }
1700
+
1701
+ /**
1702
+ * Check the parameter and return safe values
1703
+ * Written to return multiple values, e.g. for checkboxes
1704
+ *
1705
+ * @access private
1706
+ * @since 1.0.0
1707
+ *
1708
+ * @return array the user selected valid values or the default values
1709
+ */
1710
+ private function get_sanitized_array( $key, $valid_array, $default_array = array() ) {
1711
+ if ( isset( $_POST[ $key ] ) and is_array( $_POST[ $key ] ) ) {
1712
+ return $this->get_array_intersect( $_POST[ $key ], $valid_array );
1713
+ } else {
1714
+ return $default_array;
1715
+ }
1716
+ }
1717
+
1718
+ /**
1719
+ * Check the parameters and return safe values
1720
+ * Written to return multiple values associated with key names, e.g. for WP Query
1721
+ * The function filters out empty strings
1722
+ *
1723
+ * @access private
1724
+ * @since 1.0.0
1725
+ *
1726
+ * @return array the user selected valid values or the default values
1727
+ */
1728
+ private function get_sanitized_associated_array( $key, $valid_array, $default_array = array() ) {
1729
+ $queries = array();
1730
+ $arr = isset( $_POST[ $key ] ) ? $_POST[ $key ] : $default_array;
1731
+ if ( ! empty( $arr ) && is_array( $arr ) ) {
1732
+ foreach ( array_keys( $valid_array ) as $key ) {
1733
+ if ( array_key_exists( $key, $arr ) and isset( $arr[ $key ] ) ) {
1734
+ $queries[ $key ] = $arr[ $key ];
1735
+ }
1736
+ }
1737
+ }
1738
+ return $queries;
1739
+ }
1740
+
1741
+ /**
1742
+ * Define parameters and return registered custom post types
1743
+ *
1744
+ * @access private
1745
+ * @since 1.0.0
1746
+ *
1747
+ * @return array the names of the registered and thumbnail supporting custom post types
1748
+ */
1749
+ private function get_registered_custom_post_types() {
1750
+ $args = array(
1751
+ '_builtin' => false # only custom post types
1752
+ );
1753
+ $thumbnail_supporting_custom_post_types = array();
1754
+ // get the registered custom post types as objects
1755
+ $cpts = get_post_types( $args, 'names' );
1756
+ // consider only thumbnail supporting types
1757
+ foreach ( $cpts as $name => $cpt ) {
1758
+ if ( post_type_supports( $name, 'thumbnail' ) ) {
1759
+ $thumbnail_supporting_custom_post_types[] = $name;
1760
+ }
1761
+ }
1762
+ // return the result
1763
+ return $thumbnail_supporting_custom_post_types;
1764
+ }
1765
+
1766
+ /**
1767
+ * Define parameters and return thumbnail supporting custom post types
1768
+ *
1769
+ * @access private
1770
+ * @since 3.1
1771
+ *
1772
+ * @return array the names and labels of the registered and thumbnail supporting custom post types
1773
+ */
1774
+ private function get_custom_post_types_labels() {
1775
+ $args = array(
1776
+ '_builtin' => false # only custom post types
1777
+ );
1778
+ $name_labels = array();
1779
+ // get the registered custom post types as objects
1780
+ $objects = get_post_types( $args, 'objects' );
1781
+ // store their names and labels
1782
+ foreach ( $objects as $name => $object ) {
1783
+ if ( post_type_supports( $name, 'thumbnail' ) ) {
1784
+ $name_labels[ $name ] = $object->label;
1785
+ }
1786
+ }
1787
+ // return the result
1788
+ return $name_labels;
1789
+ }
1790
+
1791
+ /**
1792
+ * Return registered custom taxonomies
1793
+ *
1794
+ * @access private
1795
+ * @since 3.0
1796
+ *
1797
+ * @return array the names of the registered custom taxonomies
1798
+ */
1799
+ private function get_registered_custom_taxonomies() {
1800
+ $args = array(
1801
+ '_builtin' => false # only custon post types
1802
+ );
1803
+ return get_taxonomies( $args, 'names' );
1804
+ }
1805
+
1806
+ /**
1807
+ * Return registered custom taxonomies with their labels
1808
+ *
1809
+ * @access private
1810
+ * @since 3.0
1811
+ *
1812
+ * @return array the names of the registered custom taxonomies
1813
+ */
1814
+ private function get_custom_taxonomies_labels() {
1815
+ $args = array(
1816
+ '_builtin' => false # only custon post types
1817
+ );
1818
+ $name_labels = array();
1819
+ // get the registered custom post types as objects
1820
+ $objects = get_taxonomies( $args, 'objects' );
1821
+ // store their names and labels
1822
+ foreach ( $objects as $name => $object ) {
1823
+ $name_labels[ $name ] = $object->label;
1824
+ }
1825
+ // return the result
1826
+ return $name_labels;
1827
+ }
1828
+
1829
+ /**
1830
+ * Return the intersection of two given arrays
1831
+ * Runs 5 times faster than PHP's array_intersect()
1832
+ *
1833
+ * @access private
1834
+ * @since 1.0.0
1835
+ *
1836
+ * @return array the intersection of two arrays
1837
+ */
1838
+ private function get_array_intersect( $a, $b ) {
1839
+ $m = array();
1840
+ $intersection = array();
1841
+ // copy first array to array
1842
+ $len = sizeof( $a );
1843
+ for( $i = 0; $i < $len; $i++ ) {
1844
+ $m[] = $a[ $i ];
1845
+ }
1846
+ // append second array to array
1847
+ $len = sizeof( $b );
1848
+ for( $i = 0; $i < $len; $i++ ) {
1849
+ $m[] = $b[ $i ];
1850
+ }
1851
+ // make values sorted
1852
+ sort( $m );
1853
+ // compare value with the next one and append to intersection array if equal
1854
+ $len = sizeof( $m ) - 1;
1855
+ for( $i = 0; $i < $len; $i++ ) {
1856
+ if ( $m[ $i ] == $m[ $i + 1 ] ) $intersection[] = $m[ $i ];
1857
+ }
1858
+ // return intersection
1859
+ return $intersection;
1860
+ }
1861
+
1862
+ /**
1863
+ * Check the integer value of a user selected value else default value
1864
+ *
1865
+ * @access private
1866
+ * @since 1.0.0
1867
+ *
1868
+ * @return integer the id or 0
1869
+ */
1870
+ private function get_sanitized_id( $key, $default = 0 ) {
1871
+ $given_id = absint( sanitize_text_field( $_POST[ $key ] ) );
1872
+ if ( ( ! isset( $_POST[ $key ] ) ) or empty( $_POST[ $key ] ) or 0 > $given_id ) {
1873
+ return $default;
1874
+ } else {
1875
+ return $given_id;
1876
+ }
1877
+ }
1878
+
1879
+ /**
1880
+ * Check the id of selected featured image and return safe value
1881
+ *
1882
+ * @access private
1883
+ * @since 1.0.0
1884
+ *
1885
+ * @return integer the id or 0
1886
+ */
1887
+ private function get_sanitized_image_id() {
1888
+ return $this->get_sanitized_id( 'image_id' );
1889
+ }
1890
+
1891
+ /**
1892
+ * Check the ids of selected featured images and return safe value
1893
+ *
1894
+ * @access private
1895
+ * @since 6.0
1896
+ *
1897
+ * @return array the ids or empty
1898
+ */
1899
+ private function get_sanitized_multiple_image_ids() {
1900
+ if ( ! isset( $_POST[ 'multiple_image_ids' ] ) or empty( $_POST[ 'multiple_image_ids' ] ) ) {
1901
+ return array();
1902
+ } else {
1903
+ // read: sanatize string, make array out of string, convert each array value to integer, return result array
1904
+ return array_map( 'intval', explode( ',', sanitize_text_field( $_POST[ 'multiple_image_ids' ] ) ) );
1905
+ }
1906
+ }
1907
+
1908
+ /**
1909
+ * Check the id of selected tag and return safe value
1910
+ *
1911
+ * @access private
1912
+ * @since 1.0.0
1913
+ *
1914
+ * @return integer the id or 0
1915
+ */
1916
+ private function get_sanitized_tag_id() {
1917
+ return $this->get_sanitized_id( 'tag_id' );
1918
+ }
1919
+
1920
+ /**
1921
+ * Check the id of selected category and return safe value
1922
+ *
1923
+ * @access private
1924
+ * @since 1.0.0
1925
+ *
1926
+ * @return integer the id or 0
1927
+ */
1928
+ private function get_sanitized_category_id() {
1929
+ return $this->get_sanitized_id( 'category_id' );
1930
+ }
1931
+
1932
+ /**
1933
+ * If results in array, return them, else say query something like "no results in array"
1934
+ *
1935
+ * @access private
1936
+ * @since 2.0
1937
+ *
1938
+ * @return array Array with content or 0
1939
+ */
1940
+ private function get_id_array_for_query( $arr ) {
1941
+ if ( empty( $arr ) ) {
1942
+ return array( 0 );
1943
+ } else {
1944
+ return $arr;
1945
+ }
1946
+ }
1947
+
1948
+ /**
1949
+ * Returns the url of the plugin's admin part
1950
+ *
1951
+ * @since 1.0.0
1952
+ */
1953
+ public function get_plugin_admin_url() {
1954
+ return plugin_dir_url( __FILE__ );
1955
+ }
1956
+
1957
+ /**
1958
+ * Returns the url of the plugin's images folder without an trailing slash
1959
+ *
1960
+ * @since 1.0.0
1961
+ */
1962
+ public function get_admin_images_url() {
1963
+ return sprintf( '%s/assets/images', $this->get_plugin_admin_url() );
1964
+ }
1965
+
1966
+ /**
1967
+ * Return an instance of this class.
1968
+ *
1969
+ * @since 1.0.0
1970
+ *
1971
+ * @return object A single instance of this class.
1972
+ */
1973
+ public static function get_instance() {
1974
+
1975
+ /*
1976
+ * @TODO :
1977
+ *
1978
+ * - Uncomment following lines if the admin class should only be available for super admins
1979
+ */
1980
+ /* if( ! is_super_admin() ) {
1981
+ return;
1982
+ } */
1983
+
1984
+ // If the single instance hasn't been set, set it now.
1985
+ if ( null == self::$instance ) {
1986
+ self::$instance = new self;
1987
+ }
1988
+
1989
+ return self::$instance;
1990
+ }
1991
+
1992
+ /**
1993
+ * Return the page headline.
1994
+ *
1995
+ * @since 7.0
1996
+ *
1997
+ *@return page headline variable.
1998
+ */
1999
+ public function get_page_headline() {
2000
+ return __( 'Set, replace, remove', $this->plugin_slug );
2001
+ }
2002
+
2003
+ /**
2004
+ * Return the page description.
2005
+ *
2006
+ * @since 8.0
2007
+ *
2008
+ *@return page description variable.
2009
+ */
2010
+ public function get_page_description() {
2011
+ return __( 'Bulk set, replace and remove featured images for existing posts', $this->plugin_slug );
2012
+ }
2013
+
2014
+ /**
2015
+ * Return the page slug.
2016
+ *
2017
+ * @since 7.0
2018
+ *
2019
+ *@return page slug variable.
2020
+ */
2021
+ public function get_page_slug() {
2022
+ return $this->page_slug;
2023
+ }
2024
+
2025
+ /**
2026
+ * Return the required user capability.
2027
+ *
2028
+ * @since 7.0
2029
+ *
2030
+ *@return required user capability variable.
2031
+ */
2032
+ public function get_required_user_cap() {
2033
+ return $this->required_user_cap;
2034
+ }
2035
+
2036
+ /**
2037
+ * Register and enqueue admin-specific style sheet.
2038
+ *
2039
+ * @since 1.0.0
2040
+ *
2041
+ * @return null Return early if no settings page is registered.
2042
+ */
2043
+ public function enqueue_admin_styles() {
2044
+
2045
+ if ( ! isset( $this->plugin_screen_hook_suffix ) ) {
2046
+ return;
2047
+ }
2048
+
2049
+ // request css only if this plugin was called
2050
+ $screen = get_current_screen();
2051
+ if ( $this->plugin_screen_hook_suffix == $screen->id ) {
2052
+ wp_enqueue_style( $this->plugin_slug .'-admin-styles', plugins_url( 'assets/css/admin.css', __FILE__ ), array(), $this->plugin_version );
2053
+ }
2054
+
2055
+ }
2056
+
2057
+ /**
2058
+ * Register and enqueue admin-specific JavaScript.
2059
+ *
2060
+ * @since 1.0.0
2061
+ *
2062
+ * @return null Return early if no settings page is registered.
2063
+ */
2064
+ public function enqueue_admin_scripts() {
2065
+
2066
+ if ( ! isset( $this->plugin_screen_hook_suffix ) ) {
2067
+ return;
2068
+ }
2069
+
2070
+ $screen = get_current_screen();
2071
+ if ( $this->plugin_screen_hook_suffix == $screen->id ) {
2072
+ wp_enqueue_script( $this->plugin_slug . '-admin-script', plugins_url( 'assets/js/admin.js', __FILE__ ), array( 'jquery' ), $this->plugin_version );
2073
+ }
2074
+
2075
+ /*
2076
+ * Enqueue all stuff to use media API
2077
+ *
2078
+ * requires at least WP 3.5
2079
+ */
2080
+ wp_enqueue_media();
2081
+ }
2082
+
2083
+ /**
2084
+ * Register the administration menu for this plugin into the WordPress Dashboard menu.
2085
+ *
2086
+ * @since 1.0.0
2087
+ */
2088
+ public function add_plugin_admin_menu() {
2089
+
2090
+ // get translated string of the menu label and page headline
2091
+ $label = $this->get_page_headline();
2092
+
2093
+ /*
2094
+ * Add the top level menu page of this plugin
2095
+ *
2096
+ */
2097
+ //$this->plugin_screen_hook_suffix = add_object_page(...);
2098
+ $this->plugin_screen_hook_suffix = add_submenu_page(
2099
+ $this->parent_page_slug, // parent_slug
2100
+ sprintf( '%s: %s', $this->plugin_name, $label ), // page_title
2101
+ $label, // menu_title
2102
+ $this->required_user_cap, // capability to use the following function
2103
+ $this->page_slug, // menu_slug
2104
+ array( $this, 'main' ) // function to execute when loading this page
2105
+ );
2106
+ }
2107
+
2108
+ /**
2109
+ * Add a "Bulk set" link to the media row actions
2110
+ *
2111
+ * @since 4.1
2112
+ */
2113
+ function add_media_row_action( $actions, $post ) {
2114
+
2115
+ // if current media is not an image or user has not the right or thumbnails are not supported return without change
2116
+ if ( 'image/' != substr( $post->post_mime_type, 0, 6 ) || ! current_user_can( $this->required_user_cap ) || ! current_theme_supports( 'post-thumbnails' ) )
2117
+ return $actions;
2118
+
2119
+ // else build the link with nonce
2120
+ $url = wp_nonce_url( admin_url( sprintf( 'admin.php?page=%s&step=select&action=assign&image_id=%d', $this->page_slug, $post->ID ) ), 'bulk-assign' );
2121
+
2122
+ // add it
2123
+ $actions['quick-featured-images'] = sprintf( '<a href="%s">%s</a>', esc_url( $url ), __( 'Bulk set as featured image', 'quick-featured-images' ) );
2124
+
2125
+ // return extended action links list
2126
+ return $actions;
2127
+ }
2128
+
2129
+ }
admin/views/filter_category.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h4><?php echo $this->valid_filters[ 'filter_category' ]; ?></h4>
2
+ <p>
3
+ <label for="category_id"><?php _e( 'Select a category', $this->plugin_slug ); ?></label><br />
4
+ <?php
5
+ $text = '&mdash; Select &mdash;';
6
+ $args = array(
7
+ 'name' => 'category_id',
8
+ 'selected' => $this->selected_category_id,
9
+ 'orderby' => 'NAME',
10
+ 'show_option_none' => __( $text ),
11
+ );
12
+ wp_dropdown_categories( $args );
13
+ ?>
14
+ </p>
admin/views/filter_post_types.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h4><?php echo $this->valid_filters[ 'filter_post_types' ]; ?></h4>
2
+ <p><?php _e( 'Select post types', $this->plugin_slug ); ?>. <?php _e( 'You can select posts, pages and available custom posts types.', $this->plugin_slug ); ?></p>
3
+ <p>
4
+ <?php
5
+ $labeled_custom_post_types = $this->get_custom_post_types_labels();
6
+
7
+ foreach ( $this->valid_post_types as $key => $label ) {
8
+ ?>
9
+ <input type="checkbox" id="<?php printf( 'qfi_%s', $key ); ?>" name="post_types[]" value="<?php echo $key; ?>" <?php checked( in_array( $key, $this->selected_post_types ) ); ?> />
10
+ <label for="<?php printf( 'qfi_%s', $key ); ?>"><?php echo $label; ?></label><br />
11
+ <?php
12
+ }
13
+ ?>
14
+ </p>
admin/views/filter_tag.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h4><?php echo $this->valid_filters[ 'filter_tag' ]; ?></h4>
2
+ <p>
3
+ <?php
4
+ $tags = get_tags();
5
+ if ( $tags ) {
6
+ ?>
7
+ <label for="qfi_tags"><?php _e( 'Select a tag', $this->plugin_slug ); ?></label><br />
8
+ <select id="qfi_tags" name="tag_id">
9
+ <?php
10
+ print $this->get_html_empty_option();
11
+ foreach ( $tags as $tag ) {
12
+ ?>
13
+ <option value="<?php echo $tag->term_id; ?>" <?php selected( $this->selected_tag_id == $tag->term_id ); ?>><?php echo $tag->name; ?></option>
14
+ <?php
15
+ }
16
+ ?>
17
+ </select>
18
+ <?php
19
+ } else {
20
+ _e( 'There are no tags in use.', $this->plugin_slug );
21
+ }
22
+ ?>
23
+ </p>
admin/views/form_back_to_selection.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php // print form for going back to the filter selection without loosing input data ?>
2
+ <h3><?php _e( 'Select filters and options again', $this->plugin_slug ); ?></h3>
3
+ <p><?php _e( 'If you want to change your former selection just go back by clicking on this button.', $this->plugin_slug ); ?></p>
4
+ <form method="post" action="<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s&amp;step=select', $this->page_slug ) ) ); ?>">
5
+ <p>
6
+ <input type="hidden" name="image_id" value="<?php echo $this->selected_image_id; ?>" />
7
+ <input type="hidden" name="action" value="<?php echo $this->selected_action; ?>" />
8
+ <?php
9
+ // remember selected filters if there are some
10
+ if ( $this->selected_filters ) {
11
+ foreach ( $this->selected_filters as $filter ) {
12
+ ?>
13
+ <input type="hidden" name="filters[]" value="<?php echo $filter; ?>" />
14
+ <?php
15
+ }
16
+ }
17
+ // remember selected multiple images if there are some
18
+ if ( $this->selected_multiple_image_ids ) {
19
+ $v = implode( ',', $this->selected_multiple_image_ids );
20
+ ?>
21
+ <input type="hidden" name="multiple_image_ids" value="<?php echo $v; ?>" />
22
+ <?php
23
+ }
24
+ // remember selected replacement images if there are some
25
+ if ( $this->selected_old_image_ids ) {
26
+ foreach ( $this->selected_old_image_ids as $v ) {
27
+ ?>
28
+ <input type="hidden" name="replacement_image_ids[]" value="<?php echo $v; ?>" />
29
+ <?php
30
+ }
31
+ }
32
+ // remember selected options if there are some
33
+ if ( $this->selected_options ) {
34
+ foreach ( $this->selected_options as $v ) {
35
+ ?>
36
+ <input type="hidden" name="options[]" value="<?php echo $v; ?>" />
37
+ <?php
38
+ }
39
+ }
40
+ ?>
41
+ <?php wp_nonce_field( 'quickfi_start', $this->plugin_slug . '_nonce' ); ?>
42
+ <input type="submit" class="button" value="<?php _e( 'Modify selection', $this->plugin_slug ); ?>" />
43
+ </p>
44
+ </form>
admin/views/form_confirm.php ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ switch ( $this->selected_action ) {
3
+ case 'assign':
4
+ $question = __( 'Should the selected image be set as featured image to all listed posts?', $this->plugin_slug );
5
+ break;
6
+ case 'assign_randomly':
7
+ $question = __( 'Should the selected images be set randomly as featured images to all listed posts?', $this->plugin_slug );
8
+ break;
9
+ case 'replace':
10
+ $question = __( 'Should the current set featured image be replaced by the selected image at all listed posts?', $this->plugin_slug );
11
+ break;
12
+ case 'remove':
13
+ $question = __( 'Should the selected image be removed from all listed posts?', $this->plugin_slug );
14
+ break;
15
+ case 'assign_first_img':
16
+ $question = __( 'Should the future images be set as featured images at all listed posts?', $this->plugin_slug );
17
+ break;
18
+ case 'remove_any_img':
19
+ $question = __( 'Should the added featured images be removed from all listed posts?', $this->plugin_slug );
20
+ break;
21
+ } // switch()
22
+
23
+ ?>
24
+ <h3><?php _e( 'Preview of your selection', $this->plugin_slug ); ?></h3>
25
+ <h4><?php printf( __( '%d matches found', $this->plugin_slug ), sizeof( $results ) ); ?></h4>
26
+ <?php
27
+ if ( $results ) {
28
+ // translate once for multiple usage and improve performance
29
+ $label_details = __( 'Details', $this->plugin_slug );
30
+ $label_number = __( 'No.', $this->plugin_slug );
31
+ $label_current_fi = __( 'Current Featured Image', $this->plugin_slug );
32
+ $label_future_fi = __( 'Future Featured Image', $this->plugin_slug );
33
+ $label_written_on = __( 'written on', $this->plugin_slug );
34
+ $label_by = __( 'by', $this->plugin_slug );
35
+ // WP core labels
36
+ $text = 'No image set';
37
+ $label_no_image = __( $text );
38
+ $text = 'Status:';
39
+ $label_status = __( $text );
40
+ $text = 'Apply';
41
+ $label_apply = __( $text );
42
+ $text = 'Cancel';
43
+ $label_cancel = __( $text );
44
+ $text = '(no title)';
45
+ $default_title = __( $text );
46
+
47
+ ?>
48
+ <p><?php _e( 'The list is in alphabetical order according to post title. You can edit a post in a new window by clicking on its link in the list.', $this->plugin_slug ); ?></p>
49
+ <table class="widefat">
50
+ <thead>
51
+ <tr>
52
+ <th class="num"><?php echo $label_number; ?></th>
53
+ <th><?php echo $label_details; ?></th>
54
+ <th class="num"><?php echo $label_current_fi; ?></th>
55
+ <th class="num"><?php echo $label_future_fi; ?></th>
56
+ </tr>
57
+ </thead>
58
+ <tbody>
59
+ <?php
60
+ $c = 1;
61
+ foreach ( $results as $result ) {
62
+ // alternating row colors: if $c is divisible by 2 (so the modulo is 0) then set 'alt'-class
63
+ $class_attrib = 0 == $c % 2 ? ' class="alt"' : '';
64
+ // post title, else default title
65
+ $post_title = $result[ 1 ] ? $result[ 1 ] : $default_title;
66
+ // post date
67
+ $post_date = sprintf( '%s %s', $label_written_on, $result[ 2 ] );
68
+ // post author
69
+ $post_author = sprintf( '%s %s', $label_by, $result[ 3 ] );
70
+ // post type label
71
+ $post_type = $result[ 7 ];
72
+ $post_type_obj = get_post_type_object( $post_type );
73
+ if ( $post_type_obj ) {
74
+ $post_type = $post_type_obj->labels->singular_name; // readable name
75
+ }
76
+ // post status
77
+ $post_status = isset( $this->valid_statuses[ $result[ 6 ] ] ) ? $this->valid_statuses[ $result[ 6 ] ] : $result[ 6 ];
78
+ // check if no featured image for the post, else add default
79
+ $current_img = $result[ 4 ] ? $result[ 4 ] : $label_no_image;
80
+ $future_img = $result[ 5 ] ? $result[ 5 ] : $label_no_image;
81
+ // print the table row
82
+ printf( '<tr%s>', $class_attrib );
83
+ printf( '<td class="num">%d</td>', $c );
84
+ printf(
85
+ '<td><a href="%s" target="_blank">%s</a><br>%s<br>%s<br>%s, %s %s</td>',
86
+ $result[ 0 ], // edit post link
87
+ $post_title,
88
+ $post_date,
89
+ $post_author,
90
+ $post_type,
91
+ $label_status,
92
+ $post_status
93
+ );
94
+ printf( '<td class="num">%s</td>', $current_img );
95
+ printf( '<td class="num">%s</td>', $future_img );
96
+ print "</tr>\n";
97
+ // increase counter
98
+ $c++;
99
+ }
100
+ ?>
101
+ </tbody>
102
+ <tfoot>
103
+ <tr>
104
+ <th class="num"><?php echo $label_number; ?></th>
105
+ <th><?php echo $label_details; ?></th>
106
+ <th class="num"><?php echo $label_current_fi; ?></th>
107
+ <th class="num"><?php echo $label_future_fi; ?></th>
108
+ </tr>
109
+ </tfoot>
110
+ </table>
111
+ <h3><?php _e( 'Confirm the change', $this->plugin_slug ); ?></h3>
112
+ <p><?php echo $question; ?> <?php _e( 'You can not undo the operation!', $this->plugin_slug ); ?></p>
113
+ <form method="post" action="<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s&amp;step=perform', $this->page_slug ) ) ); ?>">
114
+ <p>
115
+ <input type="hidden" name="image_id" value="<?php echo $this->selected_image_id; ?>" />
116
+ <input type="hidden" name="action" value="<?php echo $this->selected_action; ?>" />
117
+ <?php
118
+ if ( $this->selected_multiple_image_ids ) {
119
+ $v = implode( ',', $this->selected_multiple_image_ids );
120
+ ?>
121
+ <input type="hidden" name="multiple_image_ids" value="<?php echo $v; ?>" />
122
+ <?php
123
+ }
124
+ if ( $this->selected_filters ) {
125
+ foreach ( $this->selected_filters as $v ) {
126
+ ?>
127
+ <input type="hidden" name="filters[]" value="<?php echo $v; ?>" />
128
+ <?php
129
+ }
130
+ }
131
+ foreach ( $this->selected_statuses as $v ) {
132
+ ?>
133
+ <input type="hidden" name="statuses[]" value="<?php echo $v; ?>" />
134
+ <?php
135
+ }
136
+ foreach ( $this->selected_post_types as $v ) {
137
+ ?>
138
+ <input type="hidden" name="post_types[]" value="<?php echo $v; ?>" />
139
+ <?php
140
+ }
141
+ foreach ( $this->selected_mime_types as $v ) {
142
+ ?>
143
+ <input type="hidden" name="mime_types[]" value="<?php echo $v; ?>" />
144
+ <?php
145
+ }
146
+ if ( $this->selected_custom_post_types ) {
147
+ foreach ( $this->selected_custom_post_types as $v ) {
148
+ ?>
149
+ <input type="hidden" name="custom_post_types[]" value="<?php echo $v; ?>" />
150
+ <?php
151
+ }
152
+ }
153
+ if ( $this->selected_options ) {
154
+ foreach ( $this->selected_options as $v ) {
155
+ ?>
156
+ <input type="hidden" name="options[]" value="<?php echo $v; ?>" />
157
+ <?php
158
+ }
159
+ }
160
+ if ( $this->selected_search_term ) {
161
+ ?>
162
+ <input type="hidden" name="search_term" value="<?php echo $this->selected_search_term; ?>" />
163
+ <?php
164
+ }
165
+ if ( $this->selected_category_id ) {
166
+ ?>
167
+ <input type="hidden" name="category_id" value="<?php echo $this->selected_category_id; ?>" />
168
+ <?php
169
+ }
170
+ if ( $this->selected_parent_page_id ) {
171
+ ?>
172
+ <input type="hidden" name="page_id" value="<?php echo $this->selected_parent_page_id; ?>" />
173
+ <?php
174
+ }
175
+ if ( $this->selected_author_id ) {
176
+ ?>
177
+ <input type="hidden" name="author_id" value="<?php echo $this->selected_author_id; ?>" />
178
+ <?php
179
+ }
180
+ if ( $this->selected_tag_id ) {
181
+ ?>
182
+ <input type="hidden" name="tag_id" value="<?php echo $this->selected_tag_id; ?>" />
183
+ <?php
184
+ }
185
+ /*if ( $this->selected_custom_field ) {
186
+ foreach ( $this->selected_custom_field as $k => $v ) {
187
+ ? >
188
+ <input type="hidden" name="custom_field[<?php echo $k; ?>]" value="<?php echo $v; ?>" />
189
+ < ? php
190
+ }
191
+ }*/
192
+ if ( $this->selected_old_image_ids ) {
193
+ foreach ( $this->selected_old_image_ids as $k => $v ) {
194
+ ?>
195
+ <input type="hidden" name="replacement_image_ids[<?php echo $k; ?>]" value="<?php echo $v; ?>" />
196
+ <?php
197
+ }
198
+ }
199
+ if ( in_array( 'filter_image_size', $this->selected_filters ) ) {
200
+ // $this->selected_image_dimensions is never empty because of default values, so loop without check
201
+ foreach ( $this->selected_image_dimensions as $k => $v ) {
202
+ ?>
203
+ <input type="hidden" name="image_dimensions[<?php echo $k; ?>]" value="<?php echo $v; ?>" />
204
+ <?php
205
+ }
206
+ }
207
+ if ( $this->selected_custom_taxonomies ) {
208
+ foreach ( $this->selected_custom_taxonomies as $k => $v ) {
209
+ ?>
210
+ <input type="hidden" name="custom_taxonomies[<?php echo $k; ?>]" value="<?php echo $v; ?>" />
211
+ <?php
212
+ }
213
+ }
214
+ if ( $this->selected_date_queries ) {
215
+ foreach ( $this->selected_date_queries as $k => $v ) {
216
+ ?>
217
+ <input type="hidden" name="date_queries[<?php echo $k; ?>]" value="<?php echo $v; ?>" />
218
+ <?php
219
+ }
220
+ }
221
+ ?>
222
+ <?php wp_nonce_field( 'quickfi_confirm', $this->plugin_slug . '_nonce' ); ?>
223
+ <input type="submit" class="button-primary" value="<?php echo $label_apply; ?>" /> <a class="button" href='<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s', $this->page_slug ) ) );?>'><?php echo $label_cancel;?></a>
224
+ </p>
225
+ </form>
226
+ <?php
227
+ } else {
228
+ ?>
229
+ <p><a class="button" href='<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s', $this->page_slug ) ) );?>'><?php _e( 'Start again', $this->plugin_slug );?></a> <?php _e( 'or refine your selection with the following form fields.', $this->plugin_slug );?></p>
230
+ <?php
231
+ }
admin/views/form_refine.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h3><?php _e( 'Refine your selection', $this->plugin_slug ); ?></h3>
2
+ <?php
3
+ // display selected filters
4
+ if ( $this->selected_filters ) {
5
+ ?>
6
+ <form method="post" action="<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s&amp;step=confirm', $this->page_slug ) ) ); ?>">
7
+ <fieldset>
8
+ <legend><span><?php _e( 'Refine filters', $this->plugin_slug ); ?></span></legend>
9
+ <p><?php _e( 'Now you can find posts and pages by matching parameters. Refine them here.', $this->plugin_slug ); ?></p>
10
+ <p><?php _e( 'Whatever you do: You can confirm your choice on the next page.', $this->plugin_slug ); ?></p>
11
+ <?php
12
+ foreach ( $this->selected_filters as $filter ) {
13
+ $filename = $filter . '.php';
14
+ if ( file_exists( dirname( __FILE__ ) . '/' . $filename ) ) {
15
+ include_once( $filename );
16
+ } else {
17
+ ?>
18
+ <p><?php printf( __( 'File %s is not available.', $this->plugin_slug ), $filename ); ?></p>
19
+ <?php
20
+ }
21
+ ?>
22
+ <input type="hidden" name="filters[]" value="<?php echo $filter; ?>" />
23
+ <?php
24
+ }
25
+ ?>
26
+ </fieldset>
27
+ <p>
28
+ <?php
29
+ // remember selected options if there are some
30
+ if ( $this->selected_options ) {
31
+ foreach ( $this->selected_options as $v ) {
32
+ ?>
33
+ <input type="hidden" name="options[]" value="<?php echo $v; ?>" />
34
+ <?php
35
+ }
36
+ }
37
+ // remember selected multiple images if there are some
38
+ if ( $this->selected_multiple_image_ids ) {
39
+ $v = implode( ',', $this->selected_multiple_image_ids );
40
+ ?>
41
+ <input type="hidden" name="multiple_image_ids" value="<?php echo $v; ?>" />
42
+ <?php
43
+ }
44
+ ?>
45
+ <input type="hidden" name="image_id" value="<?php echo $this->selected_image_id; ?>" />
46
+ <input type="hidden" name="action" value="<?php echo $this->selected_action; ?>" />
47
+ <?php wp_nonce_field( 'quickfi_refine', $this->plugin_slug . '_nonce' ); ?>
48
+ <input type="submit" class="button" value="<?php _e( 'Preview filtering', $this->plugin_slug ); ?>" />
49
+ </p>
50
+ </form>
51
+ <?php
52
+ } else {
53
+ ?>
54
+ <p><?php _e( 'There are no selected filters. Modify your filter selection or just go on by clicking on the next button.', $this->plugin_slug ); ?></p>
55
+ <?php
56
+ }// if()
57
+ ?>
admin/views/form_select.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // display used featured images if user selected replacement with the selected image
3
+ if ( 'replace' == $this->selected_action ) {
4
+ $thumb_ids_in_use = $this->get_featured_image_ids();
5
+ if ( $thumb_ids_in_use ) {
6
+ ?>
7
+ <form method="post" action="<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s&amp;step=confirm', $this->page_slug ) ) ); ?>">
8
+ <?php
9
+ if ( $this->is_error_no_old_image ) {
10
+ ?>
11
+ <h3><?php _e( 'Notice', $this->plugin_slug ); ?></h3>
12
+ <div class="qfi_content_inside">
13
+ <p class="failure"><?php _e( 'You did not have selected an image from the list below. To go on select at least one image you want to replace by the selected image.', $this->plugin_slug ); ?></p>
14
+ </div>
15
+ <?php
16
+ } // if( is_error_no_old_image )
17
+ ?>
18
+ <h3><?php _e( 'Select the featured images you want to replace by the selected image.', $this->plugin_slug ); ?></h3>
19
+ <p><?php _e( 'You can select multiple images. Select at least one image.', $this->plugin_slug ); ?></p>
20
+ <p id="qfi_replace">
21
+ <?php
22
+ $this->selected_old_image_ids = $this->get_sanitized_array( 'replacement_image_ids', $thumb_ids_in_use ); #array();
23
+
24
+ foreach ( $thumb_ids_in_use as $thumb_id ) {
25
+ ?>
26
+ <label for="<?php printf( 'qfi_%d', $thumb_id ); ?>" style="width: <?php echo $this->used_thumbnail_width; ?>px;">
27
+ <input type="checkbox" id="<?php printf( 'qfi_%d', $thumb_id ); ?>" name="replacement_image_ids[]" value="<?php echo $thumb_id; ?>" <?php checked( in_array( $thumb_id, $this->selected_old_image_ids ) ); ?>>
28
+ <?php
29
+ echo wp_get_attachment_image( $thumb_id, 'thumbnail' );
30
+ ?>
31
+ </label>
32
+ <?php
33
+ } // foreach()
34
+ ?>
35
+ </p>
36
+ <p>
37
+ <input type="hidden" name="image_id" value="<?php echo $this->selected_image_id; ?>" />
38
+ <input type="hidden" name="action" value="<?php echo $this->selected_action; ?>" />
39
+ <?php wp_nonce_field( 'quickfi_refine', $this->plugin_slug . '_nonce' ); ?>
40
+ <input type="submit" class="button" value="<?php _e( 'Preview filtering', $this->plugin_slug ); ?>" />
41
+ </p>
42
+ </form>
43
+ <?php
44
+ } else {
45
+ ?>
46
+ <p><?php _e( 'There are no featured images in use.', $this->plugin_slug ); ?></p>
47
+ <p><a class="button" href="<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s', $this->page_slug ) ) );?>"><?php _e( 'Start again', $this->plugin_slug );?></a></p>
48
+ <?php
49
+ } // if( thumb_ids_in_use )
50
+ ?>
51
+ <?php
52
+ } else {
53
+ // else display filter selection
54
+ ?>
55
+ <h3><?php _e( 'Refine your selections', $this->plugin_slug ); ?></h3>
56
+ <p><?php _e( 'You can control the process with the following options.', $this->plugin_slug ); ?></p>
57
+ <form method="post" action="<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s&amp;step=refine', $this->page_slug ) ) ); ?>">
58
+ <?php
59
+ switch ( $this->selected_action ) {
60
+ case 'assign':
61
+ case 'assign_randomly':
62
+ ?>
63
+ <h4><?php _e( 'Optional: Select options', $this->plugin_slug ); ?></h4>
64
+ <fieldset>
65
+ <legend><span><?php _e( 'Process Options', $this->plugin_slug ); ?></span></legend>
66
+ <p><?php _e( 'You can control the process with the following options.', $this->plugin_slug ); ?></p>
67
+ <?php
68
+ // option for overwriting existing featured images
69
+ $key = 'overwrite';
70
+ $label = $this->valid_options[ $key ];
71
+ $desc = __( 'Overwrite existing featured images with new ones', $this->plugin_slug );
72
+ ?>
73
+ <p>
74
+ <input type="checkbox" id="<?php printf( 'qfi_%s', $key ); ?>" name="options[]" value="<?php echo $key; ?>" <?php checked( in_array( $key, $this->selected_options ) ); ?>>
75
+ <label for="<?php printf( 'qfi_%s', $key ); ?>"><strong><?php echo $label; ?>:</strong> <?php echo $desc; ?></label>
76
+ </p>
77
+ <?php
78
+ // option for posts without featured image
79
+ $key = 'orphans_only';
80
+ $label = $this->valid_options[ $key ];
81
+ $desc = __( 'Posts with featured images will be ignored, even if the Overwrite option is checked ', $this->plugin_slug );
82
+ ?>
83
+ <p>
84
+ <input type="checkbox" id="<?php printf( 'qfi_%s', $key ); ?>" name="options[]" value="<?php echo $key; ?>" <?php checked( in_array( $key, $this->selected_options ) ); ?>>
85
+ <label for="<?php printf( 'qfi_%s', $key ); ?>"><strong><?php echo $label; ?>:</strong> <?php echo $desc; ?></label>
86
+ </p>
87
+ <?php
88
+ if ( 'assign_randomly' == $this->selected_action ) {
89
+ ?>
90
+ <p><?php _e( 'There are two more options in the premium version for random images:', $this->plugin_slug ); ?></p>
91
+ <ol>
92
+ <li><?php _e( 'Use each selected image only once', $this->plugin_slug ); ?></li>
93
+ <li><?php _e( 'Remove excess featured images after all selected images are used', $this->plugin_slug ); ?></li>
94
+ </ol>
95
+ <p class="qfi_ad_for_pro"><?php _e( 'Get the premium version', $this->plugin_slug ); ?> <a href="http://www.quickfeaturedimages.com<?php _e( '/', $this->plugin_slug ); ?>">Quick Featured Images Pro</a>.</p>
96
+ <?php
97
+ } // if(assign_randomly)
98
+ ?>
99
+ </fieldset>
100
+ <?php
101
+ break;
102
+ } // switch( selected_action )
103
+ ?>
104
+ <h4><?php _e( 'Optional: Add a filter', $this->plugin_slug ); ?></h4>
105
+ <fieldset>
106
+ <legend><span><?php _e( 'Select filters', $this->plugin_slug ); ?></span></legend>
107
+ <p><?php _e( 'If you want select one of the following filters to narrow down the set of concerned posts and pages.', $this->plugin_slug ); ?></p>
108
+ <p><?php _e( 'You can select multiple filters. They will return an intersection of their results.', $this->plugin_slug ); ?></p>
109
+ <?php
110
+ foreach ( $this->valid_filters as $key => $label ) {
111
+ switch ( $key ) {
112
+ case 'filter_post_types':
113
+ $desc = __( 'Search by post type. By default all posts, pages and custom post types will be affected.', $this->plugin_slug );
114
+ break;
115
+ case 'filter_category':
116
+ $desc = __( 'Search posts by category', $this->plugin_slug );
117
+ break;
118
+ case 'filter_tag':
119
+ $desc = __( 'Search posts by tag', $this->plugin_slug );
120
+ break;
121
+ default:
122
+ $desc = '';
123
+ }
124
+ ?>
125
+ <p>
126
+ <input type="checkbox" id="<?php printf( 'qfi_%s', $key ); ?>" name="filters[]" value="<?php echo $key; ?>" <?php checked( in_array( $key, $this->selected_filters ) ); ?>>
127
+ <label for="<?php printf( 'qfi_%s', $key ); ?>"><strong><?php echo $label; ?>:</strong> <?php echo $desc; ?></label>
128
+ </p>
129
+ <?php
130
+ } // foreach()
131
+ ?>
132
+ </fieldset>
133
+ <p class="qfi_ad_for_pro"><?php _e( 'Are you looking for more options and more filters?', $this->plugin_slug );?> <?php _e( 'Get the premium version', $this->plugin_slug ); ?> <a href="http://www.quickfeaturedimages.com<?php _e( '/', $this->plugin_slug ); ?>">Quick Featured Images Pro</a>.</p>
134
+ <p><?php _e( 'On the next page you can refine the filters. If you did not select any filter you will go to the preview list directly.', $this->plugin_slug ); ?></p>
135
+ <p>
136
+ <?php
137
+ // remember selected multiple images if there are some
138
+ if ( $this->selected_multiple_image_ids ) {
139
+ $v = implode( ',', $this->selected_multiple_image_ids );
140
+ ?>
141
+ <input type="hidden" name="multiple_image_ids" value="<?php echo $v; ?>" />
142
+ <?php
143
+ }
144
+ $text = 'Next &raquo;';
145
+ ?>
146
+ <input type="hidden" name="image_id" value="<?php echo $this->selected_image_id; ?>" />
147
+ <input type="hidden" name="action" value="<?php echo $this->selected_action; ?>" />
148
+ <?php wp_nonce_field( 'quickfi_select', $this->plugin_slug . '_nonce' ); ?>
149
+ <input type="submit" class="button" value="<?php _e( $text ); ?>" />
150
+ </p>
151
+ </form>
152
+ <h4><?php _e( 'If you encounter a white, blank page, read this', $this->plugin_slug ); ?></h4>
153
+ <p><?php _e( 'Facing a white blank page while trying to treat thousands of posts is the effect of limited memory capacities on the website server. Instead of treating a huge amount of posts in one single go try to treat small amounts of posts multiple times successively. To achieve that do:', $this->plugin_slug ); ?></p>
154
+ <ol>
155
+ <li class="qfi_ad_for_pro"><?php _e( 'Get the premium version', $this->plugin_slug ); ?> <a href="http://www.quickfeaturedimages.com<?php _e( '/', $this->plugin_slug ); ?>">Quick Featured Images Pro</a>.</li>
156
+ <li><?php _e( 'add the time filter,', $this->plugin_slug ); ?></li>
157
+ <li><?php _e( 'set a small time range,', $this->plugin_slug ); ?></li>
158
+ <li><?php _e( 'do the process', $this->plugin_slug ); ?></li>
159
+ <li><?php _e( 'and repeat it with the next time range as often as needed.', $this->plugin_slug ); ?></li>
160
+ </ol>
161
+ <p><?php _e( 'This way is not as fast as one single run, but still much faster than setting the images for each post manually.', $this->plugin_slug ); ?></p>
162
+ <?php
163
+ } // if( 'replace' == action )
admin/views/form_start.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! current_theme_supports( 'post-thumbnails' ) ) {
3
+ ?>
4
+ <h3><?php _e( 'Notice', $this->plugin_slug ); ?></h3>
5
+ <div class="qfi_content_inside">
6
+ <p class="failure"><?php _e( 'The current theme does not support featured images. Anyway you can use this plugin. The effects are stored and will be visible in a theme which supports featured images.', $this->plugin_slug ); ?></p>
7
+ </div>
8
+ <?php
9
+ }
10
+ ?>
11
+ <form method="post" action="<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s&amp;step=select', $this->page_slug ) ) ); ?>">
12
+ <h3><?php _e( 'What do you want to do?', $this->plugin_slug ); ?></h3>
13
+ <p><?php _e( 'Here you can add, replace and delete featured images to your posts. Select one of the following actions and, if necessary, one or more images.', $this->plugin_slug ); ?></p>
14
+ <p><?php _e( 'Whatever you select: You can refine your choice on the next page.', $this->plugin_slug ); ?></p>
15
+ <h4><?php _e( 'Important advice', $this->plugin_slug ); ?></h4>
16
+ <p><strong><?php _e( 'There is no undo function! It is strongly recommended that you make a backup of the WordPress database before you perform mass changes.', $this->plugin_slug ); ?></strong></p>
17
+ <fieldset>
18
+ <legend class="screen-reader-text"><span><?php _e( 'Select action', $this->plugin_slug ); ?></span></legend>
19
+ <h4><?php _e( 'Actions with a single image', $this->plugin_slug ); ?></h4>
20
+ <p><?php _e( 'These actions require to select an image with the following button.', $this->plugin_slug ); ?></p>
21
+ <?php
22
+ foreach ( $this->valid_actions as $name => $label ) {
23
+ ?>
24
+ <p>
25
+ <input type="radio" id="<?php echo $name; ?>" name="action" value="<?php echo $name; ?>" <?php checked( 'assign' == $name ); ?> />
26
+ <label for="<?php echo $name; ?>"><strong><?php echo $label; ?>.</strong></label>
27
+ </p>
28
+ <?php
29
+ } // foeach( valid_actions )
30
+ ?>
31
+ <div class="qfi_wrapper">
32
+ <div class="qfi_w50percent">
33
+ <p><?php _e( 'Select the image you want to add to, replace or delete from posts and pages by clicking on the following button.', $this->plugin_slug ); ?></p>
34
+ <p>
35
+ <?php
36
+ // default values for image element
37
+ $img_url = includes_url() . 'images/blank.gif';
38
+ $img_class = '';
39
+ $img_style = '';
40
+ // if an image id was given
41
+ if ( $this->selected_image_id ) {
42
+ $arr_image = wp_get_attachment_image_src( $this->selected_image_id );
43
+ // and if there is an valid image
44
+ if ( $arr_image ) {
45
+ // show the image and set the id as param value
46
+ $img_url = $arr_image[0];
47
+ $img_class = 'attachment-thumbnail';
48
+ $img_style = sprintf( 'width:%dpx', $this->used_thumbnail_width );
49
+ }
50
+ }
51
+ ?>
52
+ <input type="hidden" id="image_id" name="image_id" value="<?php echo $this->selected_image_id; ?>">
53
+ <img id="selected_image" src="<?php echo $img_url; ?>" alt="<?php $text = 'Featured Image'; _e( $text ); ?>" class="<?php echo $img_class; ?>" style="<?php echo $img_style; ?>" /><br />
54
+ <input type="button" id="upload_image_button" class="button qfi_select_image" value="<?php _e( 'Choose Image', $this->plugin_slug ); ?>" />
55
+ </p>
56
+ </div>
57
+ <div class="qfi_w50percent">
58
+ <p><strong><?php _e( 'If the button does not work, read this:', $this->plugin_slug ); ?></strong></p>
59
+ <p><?php _e( 'Some users reported that this button would not work in some WordPress installations. If this should be the case you can take another way:', $this->plugin_slug ); ?></p>
60
+ <p><?php _e( '1. Go to the media library. 2. Move the mouse over the desired image. Further links are appearing, among them the link &quot;Bulk set as featured image&quot;. 3. After a click on it you can move on in this plugin.', $this->plugin_slug ); ?></p>
61
+ </div>
62
+ </div>
63
+
64
+ <h4><?php _e( 'Actions with multiple images', $this->plugin_slug ); ?></h4>
65
+ <p><?php _e( 'These actions require at least one selected image with the following button.', $this->plugin_slug ); ?></p>
66
+ <?php
67
+ foreach ( $this->valid_actions_multiple_images as $name => $label ) {
68
+ ?>
69
+ <p>
70
+ <input type="radio" id="<?php echo $name; ?>" name="action" value="<?php echo $name; ?>" <?php checked( 'assign' == $name ); ?> />
71
+ <label for="<?php echo $name; ?>"><strong><?php echo $label; ?>.</strong></label>
72
+ </p>
73
+ <?php
74
+ } // foreach( valid_actions_multiple_images )
75
+ $img_ids = is_array( $this->selected_multiple_image_ids ) ? implode( ',', $this->selected_multiple_image_ids ) : '';
76
+ ?>
77
+ <p><?php _e( 'To select multiple images click on the button and use the CTRL key while clicking on the images.', $this->plugin_slug ); ?></p>
78
+ <p><input type="hidden" id="multiple_image_ids" name="multiple_image_ids" value="<?php echo $img_ids; ?>">
79
+ <input type="button" id="select_images_multiple" class="button" value="<?php _e( 'Choose Images', $this->plugin_slug ); ?>" /></p>
80
+ <?php
81
+ if ( $this->selected_multiple_image_ids ) {
82
+ ?>
83
+ <ul class="selected_images">
84
+ <?php
85
+ $size = array( 60, 60 );
86
+ foreach( $this->selected_multiple_image_ids as $attachment_id ) {
87
+ ?> <li><?php echo wp_get_attachment_image( $attachment_id, $size ); ?></li>
88
+ <?php
89
+ } // foreach()
90
+ ?>
91
+ </ul>
92
+ <?php
93
+ } // if ( $this->selected_multiple_image_ids )
94
+ ?>
95
+ <h4><?php _e( 'Actions without any selected image', $this->plugin_slug ); ?></h4>
96
+ <p><?php _e( 'These actions do not require a selected image.', $this->plugin_slug ); ?></p>
97
+ <?php
98
+ foreach ( $this->valid_actions_without_image as $name => $label ) {
99
+ ?>
100
+ <p>
101
+ <input type="radio" id="<?php echo $name; ?>" name="action" value="<?php echo $name; ?>" <?php checked( 'assign' == $name ); ?> />
102
+ <label for="<?php echo $name; ?>"><strong><?php echo $label; ?>.</strong></label>
103
+ </p>
104
+ <?php
105
+ }
106
+ ?>
107
+ <p class="qfi_ad_for_pro"><?php _e( 'Do you want to assign the first image of each post?', $this->plugin_slug ); ?> <?php _e( 'Get the premium version', $this->plugin_slug ); ?> <a href="http://www.quickfeaturedimages.com<?php _e( '/', $this->plugin_slug ); ?>">Quick Featured Images Pro</a>.</p>
108
+ </fieldset>
109
+ <?php
110
+ wp_nonce_field( 'quickfi_start', $this->plugin_slug . '_nonce' );
111
+ $text = 'Next &raquo;';
112
+ submit_button( __( $text ), 'secondary' );
113
+ ?>
114
+ </form>
admin/views/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
admin/views/section_defaults.php ADDED
@@ -0,0 +1,426 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Options Page For Default Images
4
+ *
5
+ * @package Quick_Featured_Images_Defaults
6
+ * @author Martin Stehle <m.stehle@gmx.de>
7
+ * @license GPL-2.0+
8
+ * @link http://wordpress.org/plugins/quick-featured-images/
9
+ * @copyright 2014
10
+ */
11
+ #dambedei( $this->selected_rules );
12
+ // define some variables
13
+ $no_thumb_url = includes_url() . 'images/blank.gif';
14
+
15
+ // store recurring translations only once for more performance
16
+ $matches_label = __( 'matches', $this->plugin_slug );
17
+ $number_label = __( 'No.', $this->plugin_slug );
18
+ $post_type_label = __( 'Post type', $this->plugin_slug );
19
+ $taxonomy_label = __( 'Taxonomy', $this->plugin_slug );
20
+ $choose_image_label = __( 'Choose Image', $this->plugin_slug );
21
+ // WP core strings
22
+ $text = 'Action';
23
+ $action_label = __( $text );
24
+ $text = 'Description';
25
+ $description_label = __( $text );
26
+ $text = 'Image';
27
+ $image_label = __( $text );
28
+ $text = 'Value';
29
+ $value_label = __($text );
30
+ $text = 'Author';
31
+ $user_label = __($text );
32
+ $text = '&mdash; Select &mdash;';
33
+ $first_option_label = __( $text );
34
+ $text = 'Featured Image';
35
+ $feat_img_label = __( $text );
36
+ $text = 'Category';
37
+ $category_label = _x( $text, 'taxonomy singular name' );
38
+ $text = 'Tag';
39
+ $tag_label = _x( $text, 'taxonomy singular name' );
40
+ $text = 'Post';
41
+ $post_label = _x( $text, 'post type singular name' );
42
+ $text = 'Page';
43
+ $page_label = _x( $text, 'post type singular name' );
44
+
45
+ $args = array(
46
+ 'orderby' => 'name',
47
+ 'order' => 'ASC',
48
+ 'hide_empty' => false,
49
+ 'hierarchical' => true,
50
+ );
51
+ $tags = get_tags( $args );
52
+ $categories = get_categories( $args );
53
+ $users = get_users( array( 'orderby' => 'display_name' ) );
54
+ $post_types = $this->get_custom_post_types_labels();
55
+ $custom_taxonomies = $this->get_custom_taxonomies_labels();
56
+ $custom_taxonomies_terms = array();
57
+ if ( $custom_taxonomies ) {
58
+ foreach ( $custom_taxonomies as $key => $label ) {
59
+ $options = array();
60
+ $terms = get_terms( $key, $args );
61
+ if ( is_wp_error( $terms ) ) {
62
+ printf( '<p>%s<p>', $terms->get_error_message() );
63
+ continue;
64
+ }
65
+ if ( 0 < count( $terms ) ) {
66
+ foreach ( $terms as $term ) {
67
+ $custom_taxonomies_terms[ $key ][ $term->term_id ] = $term->name;
68
+ }
69
+ if ( isset( $this->selected_custom_taxonomies[ $key ] ) ) {
70
+ $selected_tax = $this->selected_custom_taxonomies[ $key ];
71
+ } else {
72
+ $selected_tax = '';
73
+ }
74
+ }
75
+ }
76
+ }
77
+ ?>
78
+ <script type="text/javascript">
79
+ jQuery( document ).ready( function( $ ){
80
+
81
+ /*
82
+ * build arrays of options
83
+ */
84
+ var options = new Array();
85
+ <?php
86
+ // build post type options
87
+ $key = 'post_type';
88
+ printf( 'options[ \'%s\' ] = new Array();', $key );
89
+ print "\n";
90
+ printf( 'options[ \'%s\' ].push( \'<option value="">%s</option>\' );', $key, $first_option_label );
91
+ print "\n";
92
+ printf( 'options[ \'%s\' ].push( \'<option value="%s">%s</option>\' );', $key, 'post', $post_label );
93
+ print "\n";
94
+ printf( 'options[ \'%s\' ].push( \'<option value="%s">%s</option>\' );', $key, 'page', $page_label );
95
+ print "\n";
96
+ foreach ( $post_types as $name => $label ) {
97
+ printf( 'options[ \'%s\' ].push( \'<option value="%s">%s</option>\' );', $key, esc_attr( $name ), esc_html( $label ) );
98
+ print "\n";
99
+ }
100
+
101
+ // build tag options
102
+ $key = 'post_tag';
103
+ printf( 'options[ \'%s\' ] = new Array();', $key );
104
+ print "\n";
105
+ printf( 'options[ \'%s\' ].push( \'<option value="">%s</option>\' );', $key, $first_option_label );
106
+ print "\n";
107
+ foreach ( $tags as $tag ) {
108
+ printf( 'options[ \'%s\' ].push( \'<option value="%d">%s</option>\' );', $key, absint( $tag->term_id ), esc_html( $tag->name ) );
109
+ print "\n";
110
+ }
111
+
112
+ // build category options
113
+ $key = 'category';
114
+ printf( 'options[ \'%s\' ] = new Array();', $key );
115
+ print "\n";
116
+ printf( 'options[ \'%s\' ].push( \'<option value="">%s</option>\' );', $key, $first_option_label );
117
+ print "\n";
118
+ foreach ( $categories as $category ) {
119
+ printf( 'options[ \'%s\' ].push( \'<option value="%d">%s</option>\' );', $key, absint( $category->term_id ), esc_html( $category->name ) );
120
+ print "\n";
121
+ }
122
+
123
+ // build custom taxonomy options
124
+ if ( $custom_taxonomies_terms ) {
125
+ foreach ( array_keys( $custom_taxonomies_terms ) as $key ) {
126
+ printf( 'options[ \'%s\' ] = new Array();', $key );
127
+ print "\n";
128
+ printf( 'options[ \'%s\' ].push( \'<option value="">%s</option>\' );', $key, $first_option_label );
129
+ print "\n";
130
+ foreach ( $custom_taxonomies_terms[ $key ] as $term_id => $term_name ) {
131
+ printf( 'options[ \'%s\' ].push( \'<option value="%d">%s</option>\' );', $key, absint( $term_id ), esc_html( $term_name ) );
132
+ print "\n";
133
+ }
134
+ }
135
+ } // if ( custom_taxonomies_terms )
136
+
137
+ // build user options
138
+ $key = 'user';
139
+ printf( 'options[ \'%s\' ] = new Array();', $key );
140
+ print "\n";
141
+ printf( 'options[ \'%s\' ].push( \'<option value="">%s</option>\' );', $key, $first_option_label );
142
+ print "\n";
143
+ foreach ( $users as $user ) {
144
+ printf( 'options[ \'%s\' ].push( \'<option value="%d">%s</option>\' );', $key, absint( $user->ID ), esc_html( $user->display_name ) );
145
+ print "\n";
146
+ }
147
+ ?>
148
+ /*
149
+ * Options changes
150
+ */
151
+ $( '.selection_rules' ).live( 'change', function() {
152
+ // get number of row
153
+ var row_number = this.id.match( /[0-9]+/ );
154
+ // set selector names
155
+ var selector_taxonomy = '#taxonomy_' + row_number;
156
+ var selector_matchterm = '#matchterm_' + row_number;
157
+ // change 'value' selection on change of 'taxonomy' selection
158
+ $( selector_taxonomy + ' option:selected' ).each( function() {
159
+ $( selector_matchterm ).html( options[ $( this ).val() ].join( '' ));
160
+ } );
161
+ } )
162
+ } )
163
+ </script>
164
+ <?php
165
+ if ( ! current_theme_supports( 'post-thumbnails' ) ) {
166
+ ?>
167
+ <h3><?php _e( 'Notice', $this->plugin_slug ); ?></h3>
168
+ <div class="qfi_content_inside">
169
+ <p class="failure"><?php _e( 'The current theme does not support featured images. Anyway you can use this plugin. The effects are stored and will be visible in a theme which supports featured images.', $this->plugin_slug ); ?></p>
170
+ </div>
171
+ <?php
172
+ }
173
+ ?>
174
+ <h3><?php _e( 'Default featured images for future posts', $this->plugin_slug ); ?></h3>
175
+ <p><?php echo $this->get_page_description(); ?>. <?php _e( 'Define the rules to use images as default featured images automatically every time a post is saved.', $this->plugin_slug ); ?></p>
176
+ <p><?php _e( 'To use a rule choose the image and set both the taxonomy and the value. A rule which is defined only partially will be ignored.', $this->plugin_slug ); ?></p>
177
+ <form method="post" action="">
178
+ <input type="hidden" id="placeholder_url" name="placeholder_url" value="<?php echo $no_thumb_url; ?>" />
179
+ <input type="hidden" id="confirmation_question" name="confirmation_question" value="<?php _e( 'Are you sure to remove this rule?', $this->plugin_slug ); ?>" />
180
+ <table class="widefat">
181
+ <thead>
182
+ <tr>
183
+ <th class="num"><?php echo $number_label; ?></th>
184
+ <th><?php echo $image_label; ?></th>
185
+ <th><?php echo $description_label; ?></th>
186
+ <th><?php echo $action_label; ?></th>
187
+ </tr>
188
+ </thead>
189
+ <tbody>
190
+ <tr id="row_1">
191
+ <td class="num">1</td>
192
+ <td>
193
+ <?php printf( '<img src="%s" alt="%s" width="80" height="80" />', plugins_url( 'assets/images/overwrite-image.jpg' , dirname( __FILE__ ) ), __( 'An image overwrites an existing image', $this->plugin_slug ) ); ?><br />
194
+ </td>
195
+ <td>
196
+ <p class="description"><?php _e( 'If activated the rule is used automatically while saving a post to overwrite an existing featured image with the new one based on the following rules. Do not use this if you want to keep manually set featured images.', $this->plugin_slug ); ?></p>
197
+ </td>
198
+ <td>
199
+ <?php
200
+ $key = 'overwrite_automatically';
201
+ $attr_checked = checked( isset( $this->selected_rules[ $key ] ), '1', false );
202
+ printf( '<label for="%s"><input type="checkbox" %s value="1" id="%s" name="%s">%s</label>', $key, $attr_checked, $key, $key, __( 'Activate to automatically overwrite an existing featured image while saving a post', $this->plugin_slug ) );
203
+ ?>
204
+ </td>
205
+ </tr>
206
+ <tr id="row_2" class="alt">
207
+ <td class="num">2</td>
208
+ <td>
209
+ <?php printf( '<img src="%s" alt="%s" width="80" height="80" />', plugins_url( 'assets/images/first-content-image.gif' , dirname( __FILE__ ) ), __( 'Text with images in WordPress editor', $this->plugin_slug ) ); ?><br />
210
+ </td>
211
+ <td>
212
+ <p class="description"><?php _e( 'If activated the rule is used automatically while saving a post to set the first content image - if available in the media library - as the featured image of the post. If the post has no content images the next rules will be applied.', $this->plugin_slug ); ?></p>
213
+ </td>
214
+ <td>
215
+ <?php
216
+ $key = 'use_first_image_as_default';
217
+ $attr_checked = checked( isset( $this->selected_rules[ $key ] ), '1', false );
218
+ printf( '<label for="%s"><input type="checkbox" %s value="1" id="%s" name="%s">%s</label>', $key, $attr_checked, $key, $key, __( 'Activate to automatically use the first content image if available in the media library as featured image while saving a post', $this->plugin_slug ) );
219
+ ?>
220
+ </td>
221
+ </tr>
222
+ <?php
223
+ $c = 3;
224
+ if ( isset( $this->selected_rules[ 'rules' ] ) ) {
225
+ foreach ( $this->selected_rules[ 'rules' ] as $rule ) {
226
+ // only consider valid values
227
+ if ( '0' == $rule[ 'id' ] ) continue;
228
+ if ( '' == $rule[ 'taxonomy' ] ) continue;
229
+ if ( '' == $rule[ 'matchterm' ] ) continue;
230
+ // alternate row color
231
+ if( $c % 2 == 0 ) { // if c is odd
232
+ $class = ' class="alt"';
233
+ } else {
234
+ $class = '';
235
+ }
236
+ $r_id = absint( $rule[ 'id' ] );
237
+ ?>
238
+ <tr id="row_<?php echo $c; ?>"<?php echo $class; ?>>
239
+ <td class="num"><?php echo $c; ?></td>
240
+ <td>
241
+ <input type="hidden" value="<?php echo $r_id; ?>" name="rules[<?php echo $c; ?>][id]" id="image_id_<?php echo $c; ?>">
242
+ <img src="<?php echo wp_get_attachment_thumb_url( $r_id ); ?>" alt="<?php echo $feat_img_label; ?>" id="selected_image_<?php echo $c; ?>" class="attachment-thumbnail" style="width:80px; display: block;">
243
+ </td>
244
+ <td>
245
+ <input type="button" name="upload_image_<?php echo $c; ?>" value="<?php echo $choose_image_label; ?>" class="button imageupload" id="upload_image_<?php echo $c; ?>"><br />
246
+ <label for="taxonomy_<?php echo $c; ?>"><?php echo $taxonomy_label; ?></label><br />
247
+ <select name="rules[<?php echo $c; ?>][taxonomy]" id="taxonomy_<?php echo $c; ?>" class="selection_rules">
248
+ <option value=""><?php echo $first_option_label; ?></option>
249
+ <?php
250
+ $key = $rule[ 'taxonomy' ];
251
+ printf( '<option value="%s"%s>%s</option>', 'post_type', selected( 'post_type' == $key, true, false ), $post_type_label );
252
+ print "\n";
253
+ printf( '<option value="%s"%s>%s</option>', 'category', selected( 'category' == $key, true, false ), $category_label );
254
+ print "\n";
255
+ printf( '<option value="%s"%s>%s</option>', 'post_tag', selected( 'post_tag' == $key, true, false ), $tag_label );
256
+ print "\n";
257
+ printf( '<option value="%s"%s>%s</option>', 'user', selected( 'user' == $key, true, false ), $user_label );
258
+ print "\n";
259
+ if ( $custom_taxonomies_terms ) {
260
+ foreach ( $custom_taxonomies as $key => $label ) {
261
+ if ( $key and $label ) { // ommit empty or false values
262
+ printf( '<option value="%s"%s>%s</option>', esc_attr( $key ), selected( $key == $rule[ 'taxonomy' ], true, false ), esc_html( $label ) );
263
+ print "\n";
264
+ }
265
+ }
266
+ }
267
+ ?>
268
+ </select><br />
269
+ <?php echo $matches_label; ?>:<br />
270
+ <label for="matchterm_<?php echo $c; ?>"><?php echo $value_label; ?></label><br />
271
+ <select name="rules[<?php echo $c; ?>][matchterm]" id="matchterm_<?php echo $c; ?>">
272
+ <option value=""><?php echo $first_option_label; ?></option>
273
+ <?php
274
+ switch( $rule[ 'taxonomy' ] ) {
275
+ case 'post_type':
276
+ printf( '<option value="%s"%s>%s</option>', 'post', selected( 'post' == $rule[ 'matchterm' ], true, false ), $post_label );
277
+ print "\n";
278
+ printf( '<option value="%s"%s>%s</option>', 'page', selected( 'page' == $rule[ 'matchterm' ], true, false ), $page_label );
279
+ print "\n";
280
+ foreach ( $post_types as $key => $label ) {
281
+ printf( '<option value="%s"%s>%s</option>', esc_attr( $key ), selected( $key == $rule[ 'matchterm' ], true, false ), esc_html( $label ) );
282
+ print "\n";
283
+ }
284
+ break;
285
+ case 'post_tag':
286
+ foreach ( $tags as $tag ) {
287
+ printf( '<option value="%d"%s>%s</option>', absint( $tag->term_id ), selected( $tag->term_id == $rule[ 'matchterm' ], true, false ), esc_html( $tag->name ) );
288
+ print "\n";
289
+ }
290
+ break;
291
+ case 'category':
292
+ foreach ( $categories as $category ) {
293
+ printf( '<option value="%d"%s>%s</option>', absint( $category->term_id ), selected( $category->term_id == $rule[ 'matchterm' ], true, false ), esc_html( $category->name ) );
294
+ print "\n";
295
+ }
296
+ break;
297
+ case 'user':
298
+ foreach ( $users as $user ) {
299
+ printf( '<option value="%d"%s>%s</option>', absint( $user->ID ), selected( $user->ID == $rule[ 'matchterm' ], true, false ), esc_html( $user->display_name ) );
300
+ print "\n";
301
+ }
302
+ break;
303
+ default: // custom taxonomy
304
+ if ( $custom_taxonomies_terms ) {
305
+ foreach ( $custom_taxonomies_terms[ $rule[ 'taxonomy' ] ] as $term_id => $term_name ) {
306
+ printf( '<option value="%d"%s>%s</option>', absint( $term_id ), selected( $term_id == $rule[ 'matchterm' ] ), esc_html( $term_name ) );
307
+ print "\n";
308
+ }
309
+ }
310
+ } // switch()
311
+ ?>
312
+ </select>
313
+ </td>
314
+ <td><input type="button" name="remove_rule_<?php echo $c; ?>" value="X" class="button remove_rule" id="remove_rule_<?php echo $c; ?>"></td>
315
+ </tr>
316
+ <?php
317
+ $c = $c + 1;
318
+ } // foreach()
319
+ } else {
320
+ // show default taxonomy rule row
321
+ ?>
322
+ <tr id="row_<?php echo $c; ?>">
323
+ <td class="num"><?php echo $c; ?></td>
324
+ <td>
325
+ <input type="hidden" value="0" name="rules[<?php echo $c; ?>][id]" id="image_id_<?php echo $c; ?>">
326
+ <img src="<?php echo $no_thumb_url; ?>" alt="<?php echo $feat_img_label; ?>" id="selected_image_<?php echo $c; ?>" />
327
+ </td>
328
+ <td>
329
+ <input type="button" name="upload_image_<?php echo $c; ?>" value="<?php echo $choose_image_label; ?>" class="button imageupload" id="upload_image_<?php echo $c; ?>" /><br />
330
+ <label for="taxonomy_<?php echo $c; ?>"><?php echo $taxonomy_label; ?></label><br />
331
+ <select name="rules[<?php echo $c; ?>][taxonomy]" id="taxonomy_<?php echo $c; ?>" class="selection_rules">
332
+ <option value=""><?php echo $first_option_label; ?></option>
333
+ <?php
334
+ $key = esc_attr( $rule[ 'taxonomy' ] );
335
+ printf( '<option value="%s"%s>%s</option>', 'post_type', selected( 'post_type' == $key, true, false ), $post_type_label );
336
+ print "\n";
337
+ printf( '<option value="%s"%s>%s</option>', 'category', selected( 'category' == $key, true, false ), $category_label );
338
+ print "\n";
339
+ printf( '<option value="%s"%s>%s</option>', 'post_tag', selected( 'post_tag' == $key, true, false ), $tag_label );
340
+ print "\n";
341
+ printf( '<option value="%s"%s>%s</option>', 'user', selected( 'user' == $key, true, false ), $user_label );
342
+ print "\n";
343
+ if ( $custom_taxonomies_terms ) {
344
+ foreach ( $custom_taxonomies as $key => $label ) {
345
+ if ( $key and $label ) { // ommit empty or false values
346
+ printf( '<option value="%s"%s>%s</option>', esc_attr( $key ), selected( $key == $rule[ 'taxonomy' ], true, false ), esc_html( $label ) );
347
+ print "\n";
348
+ }
349
+ }
350
+ }
351
+ ?>
352
+ </select><br />
353
+ <?php echo $matches_label; ?>:<br />
354
+ <label for="matchterm_<?php echo $c; ?>"><?php echo $value_label; ?></label><br />
355
+ <select name="rules[<?php echo $c; ?>][matchterm]" id="matchterm_<?php echo $c; ?>">
356
+ <option value=""><?php echo $first_option_label; ?></option>
357
+ </select>
358
+ </td>
359
+ <td><input type="button" name="remove_rule_<?php echo $c; ?>" value="X" class="button remove_rule" id="remove_rule_<?php echo $c; ?>"></td>
360
+ </tr>
361
+ <?php
362
+ } // if( rules )
363
+ ?>
364
+ <tr id="template_row">
365
+ <td class="num">XX</td>
366
+ <td>
367
+ <input type="hidden" value="0" name="rules[XX][id]" id="image_id_XX">
368
+ <img src="<?php echo $no_thumb_url; ?>" alt="<?php echo $feat_img_label; ?>" id="selected_image_XX">
369
+ </td>
370
+ <td>
371
+ <input type="button" name="upload_image_XX" value="<?php echo $choose_image_label; ?>" class="button imageupload" id="upload_image_XX"><br />
372
+ <label for="taxonomy_XX"><?php echo $taxonomy_label; ?></label><br />
373
+ <select name="rules[XX][taxonomy]" id="taxonomy_XX" class="selection_rules">
374
+ <option value=""><?php echo $first_option_label; ?></option>
375
+ <option value="post_type"><?php echo $post_type_label; ?></option>
376
+ <option value="category"><?php echo $category_label; ?></option>
377
+ <option value="post_tag"><?php echo $tag_label; ?></option>
378
+ <option value="user"><?php echo $user_label; ?></option>
379
+ <?php
380
+ if ( $custom_taxonomies_terms ) {
381
+ foreach ( $custom_taxonomies as $key => $label ) {
382
+ if ( $key and $label ) { // ommit empty or false values
383
+ printf( '<option value="%s">%s</option>', esc_attr( $key ), esc_html( $label ) );
384
+ print "\n";
385
+ }
386
+ }
387
+ }
388
+ ?>
389
+ </select><br />
390
+ <?php echo $matches_label; ?>:<br />
391
+ <label for="matchterm_XX"><?php echo $value_label; ?></label><br />
392
+ <select name="rules[XX][matchterm]" id="matchterm_XX">
393
+ <option value=""><?php echo $first_option_label; ?></option>
394
+ </select>
395
+ </td>
396
+ <td><input type="button" name="remove_rule_XX" value="X" class="button remove_rule" id="remove_rule_XX"></td>
397
+ </tr>
398
+ </tbody>
399
+ <tfoot>
400
+ <tr>
401
+ <th class="num"><?php echo $number_label; ?></th>
402
+ <th><?php echo $image_label; ?></th>
403
+ <th><?php echo $description_label; ?></th>
404
+ <th><?php echo $action_label; ?></th>
405
+ </tr>
406
+ </tfoot>
407
+ </table>
408
+ <?php
409
+ submit_button( __( 'Add rule', $this->plugin_slug ), 'secondary', 'add_rule_button' );
410
+ submit_button();
411
+ wp_nonce_field( 'save_default_images', 'knlk235rf' );
412
+ ?>
413
+ </form>
414
+ <h4><?php _e( 'How the rules work', $this->plugin_slug ); ?></h4>
415
+ <p><?php _e( 'Every time you save a post the post get the featured image if one of the following rules match a property of the post. You can also set rules for pages and all other current post types which support featured images.', $this->plugin_slug ); ?></p>
416
+ <p><?php _e( 'Regardless of the order in the list the rules are applied in the following order until a rule and a property of the post fit together:', $this->plugin_slug ); ?></p>
417
+ <ol>
418
+ <li><?php _e( 'found first content image. If not then...', $this->plugin_slug ); ?></li>
419
+ <li><?php _e( 'matched custom taxonomy. If not then...', $this->plugin_slug ); ?></li>
420
+ <li><?php _e( 'matched tag. If not then...', $this->plugin_slug ); ?></li>
421
+ <li><?php _e( 'matched category. If not then...', $this->plugin_slug ); ?></li>
422
+ <li><?php _e( 'matched author. If not then...', $this->plugin_slug ); ?></li>
423
+ <li><?php _e( 'matched post type. If not then...', $this->plugin_slug ); ?></li>
424
+ <li><?php _e( 'no featured image.', $this->plugin_slug ); ?></li>
425
+ </ol>
426
+ <p><?php _e( 'Bear in mind that if two or more rules with the same taxonomy would fit to the post it is unforeseeable which image will become the featured image.', $this->plugin_slug ); ?></p>
admin/views/section_errormsg.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <h3><?php _e( 'Error', $this->page_slug );?></h3>
2
+ <div class="qfi_content_inside">
3
+ <h4><?php _e( 'Reason', $this->plugin_slug );?></h4>
4
+ <p class="failure"><?php print $msg; ?></p>
5
+ <h4><?php _e( 'Solution', $this->plugin_slug );?></h4>
6
+ <p class="success"><?php print $solution; ?></p>
7
+ </div>
8
+ <p><a class="button" href='<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s', $this->page_slug ) ) );?>'><?php _e( 'Start again', $this->plugin_slug );?></a></p>
admin/views/section_footer.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Represents the footer for the admin page
4
+ *
5
+ * @package Quick_Featured_Images
6
+ * @author Martin Stehle <m.stehle@gmx.de>
7
+ * @license GPL-2.0+
8
+ * @link http://stehle-internet.de
9
+ * @copyright 2013 Martin Stehle
10
+ */
11
+ // check if file is called in an object context
12
+ // else use non-object context
13
+ if ( isset($this->plugin_slug ) ) {
14
+ $text_domain = $this->plugin_slug;
15
+ } else {
16
+ $text_domain = self::$plugin_slug;
17
+ }
18
+ // get and set locale code for paypal button
19
+ // source: https://developer.paypal.com/docs/classic/archive/buttons/
20
+ // source: http://wpcentral.io/internationalization/
21
+ $paypal_locale = get_locale();
22
+ if ( ! in_array( $paypal_locale, array( 'en_US', 'en_AU', 'es_ES', 'fr_FR', 'de_DE', 'ja_JP', 'it_IT', 'pt_PT', 'pt_BR', 'pl_PL', 'ru_RU', 'sv_SE', 'tr_TR', 'nl_NL', 'zh_CN', 'zh_HK', 'he_IL' ) ) ) {
23
+ // try to find the nearest match
24
+ if ( 'ja' == $paypal_locale ) { // japanese language
25
+ $paypal_locale = 'ja_JP';
26
+ } else {
27
+ $language_codes = explode( '_', $paypal_locale );
28
+ // test the language
29
+ switch ( $language_codes[ 0 ] ) {
30
+ case 'en':
31
+ $paypal_locale = 'en_US';
32
+ break;
33
+ case 'nl':
34
+ $paypal_locale = 'nl_NL';
35
+ break;
36
+ case 'es':
37
+ $paypal_locale = 'es_ES';
38
+ break;
39
+ case 'de':
40
+ $paypal_locale = 'de_DE';
41
+ break;
42
+ default:
43
+ $paypal_locale = 'en_US';
44
+ } // switch()
45
+ } // if ('ja')
46
+ } // if !in_array()
47
+ ?>
48
+ </div><!-- .qfi_content -->
49
+ </div><!-- #qfi_main -->
50
+ <div id="qfi_footer">
51
+ <div class="qfi_content">
52
+ <h3><?php _e( 'Credits and informations', $text_domain ); ?></h3>
53
+ <dl>
54
+ <dt><?php _e( 'Do you like the plugin?', $text_domain ); ?></dt><dd><a href="http://wordpress.org/support/view/plugin-reviews/quick-featured-images"><?php _e( 'Please rate it at wordpress.org!', $text_domain ); ?></a></dd>
55
+ <dt><?php _e( 'The plugin is for free. But the plugin author would be delighted to your small contribution.', $text_domain ); ?></dt><dd><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2KUW27NECWVWJ"><img src="https://www.paypalobjects.com/<?php echo $paypal_locale; ?>/i/btn/btn_donateCC_LG.gif" alt="(<?php _e( 'Donation Button', $text_domain ); ?>)" id="paypal_button" /><br /><?php _e( 'Donate by PayPal', $text_domain ); ?></a><img alt="" border="0" src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" width="1" height="1" /></dd>
56
+ <dt><?php _e( 'Do you need support or have an idea for the plugin?', $text_domain ); ?></dt><dd><a href="http://wordpress.org/support/plugin/quick-featured-images"><?php _e( 'Post your questions and ideas about Quick Featured Images in the forum at wordpress.org!', $text_domain ); ?></a></dd>
57
+ <dt><?php _e( 'Special thanks for the fine frontend style of the plugin go to', $text_domain ); ?></dt><dd><a href="http://alexandra-mutter.de/?ref=quick-featured-images"><?php echo get_avatar( 'allamoda07@googlemail.com', 44 ); ?>alexandra mutter design</a></dd>
58
+ <dt><?php _e( 'Let the thumbnails appear in the widget of the most recent posts with this fast plugin', $text_domain ); ?></dt><dd><a href="http://wordpress.org/plugins/recent-posts-widget-with-thumbnails/"><?php printf( __( 'Download plugin %s at %s!', $text_domain ), '<strong>Recent Posts Widget With Thumbnails</strong>', 'wordpress.org' ); ?></a></dd>
59
+ <dt><?php _e( 'Get the premium version', $this->plugin_slug ); ?> <a href="http://www.quickfeaturedimages.com<?php _e( '/', $this->plugin_slug ); ?>">Quick Featured Images Pro</a></dd>
60
+ </dl>
61
+ </div><!-- .qfi_content -->
62
+ </div><!-- #qfi_footer -->
63
+ </div><!-- .qfi_wrapper -->
64
+ </div><!-- .wrap -->
admin/views/section_header.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Represents the header for the admin page
4
+ *
5
+ * @package Quick_Featured_Images
6
+ * @author Martin Stehle <m.stehle@gmx.de>
7
+ * @license GPL-2.0+
8
+ * @link http://stehle-internet.de
9
+ * @copyright 2014 Martin Stehle
10
+ */
11
+ ?>
12
+
13
+ <div class="wrap">
14
+ <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
15
+ <?php include_once 'options-head.php'; // print out success or error messages from the Settings API ?>
16
+ <div class="qfi_wrapper">
17
+ <div id="qfi_main">
18
+ <div class="qfi_content">
19
+
admin/views/section_header_progress.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Represents the header for the admin page
4
+ *
5
+ * @package Quick_Featured_Images
6
+ * @author Martin Stehle <m.stehle@gmx.de>
7
+ * @license GPL-2.0+
8
+ * @link http://stehle-internet.de
9
+ * @copyright 2013 Martin Stehle
10
+ */
11
+ ?>
12
+
13
+ <div class="wrap">
14
+ <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
15
+ <h3><?php _e( 'Progress bar', $this->plugin_slug ); ?></h3>
16
+ <p id="progress">
17
+ <em class="screen-reader-text"><?php _e( 'You are here', $this->plugin_slug ); ?>:</em>
18
+ <span id="bar" class="wp-ui-primary">
19
+ <?php
20
+ $count = 1;
21
+ $max = sizeof( $this->valid_steps );
22
+ foreach ( $this->valid_steps as $key => $label ) {
23
+ if ( $this->selected_step == $key ) {
24
+ $elem = 'strong';
25
+ $class = 'wp-ui-highlight';
26
+ } else {
27
+ $elem = 'span';
28
+ $class = 'wp-ui-notification';
29
+ }
30
+ printf( '<%s class="%s">%s</%s>', $elem, $class, $label, $elem );
31
+ if ( $count < $max ) {
32
+ print '<span class="sep"> &gt; </span>';
33
+ }
34
+ $count++;
35
+ }
36
+ ?>
37
+ </span>
38
+ </p>
39
+
40
+ <div class="qfi_wrapper">
41
+ <div id="qfi_main">
42
+ <div class="qfi_content">
admin/views/section_image.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h3><?php _e( 'Your selection', $this->plugin_slug ); ?></h3>
2
+ <?php
3
+ $two_columns = false;
4
+ if ( in_array( $this->selected_action, array_keys( $this->valid_actions ) ) && $this->selected_image_id ) {
5
+ $two_columns = true;
6
+ ?>
7
+ <div class="qfi_wrapper">
8
+ <div class="qfi_w50percent">
9
+ <h4><?php _e( 'Your selected thumbnail', $this->plugin_slug ); ?></h4>
10
+ <p>
11
+ <?php echo wp_get_attachment_image( $this->selected_image_id, 'thumbnail' ); ?><br>
12
+ <strong><?php _e( 'Image title', $this->plugin_slug ); ?>:</strong> <?php echo get_the_title( $this->selected_image_id ); ?>
13
+ </p>
14
+ <p><a class="button" href='<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s', $this->page_slug ) ) );?>'><?php _e( 'If wrong image start again', $this->plugin_slug );?></a></p>
15
+ </div><!-- .qfi_w50percent -->
16
+ <div class="qfi_w50percent">
17
+ <?php
18
+ } elseif ( in_array( $this->selected_action, array_keys( $this->valid_actions_multiple_images ) ) && $this->selected_multiple_image_ids ) {
19
+ $two_columns = true;
20
+ ?>
21
+ <div class="qfi_wrapper">
22
+ <div class="qfi_w50percent">
23
+ <h4><?php _e( 'Your selected thumbnails', $this->plugin_slug ); ?></h4>
24
+ <ul class="selected_images">
25
+ <?php
26
+ $size = array( 60, 60 );
27
+ $attr = array( 'class' => 'attachment-thumbnail' );
28
+ foreach( $this->selected_multiple_image_ids as $attachment_id ) {
29
+ ?> <li><?php echo wp_get_attachment_image( $attachment_id, $size, false, $attr ); ?></li>
30
+ <?php
31
+ } // foreach()
32
+ ?>
33
+ </ul>
34
+ <?php
35
+ ?>
36
+ <p><a class="button" href='<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s', $this->page_slug ) ) );?>'><?php _e( 'If wrong image start again', $this->plugin_slug );?></a></p>
37
+ </div><!-- .qfi_w50percent -->
38
+ <div class="qfi_w50percent">
39
+ <?php
40
+ }
41
+ ?>
42
+ <h4><?php _e( 'Your selected action', $this->plugin_slug ); ?></h4>
43
+ <?php
44
+ if ( isset( $this->valid_actions[ $this->selected_action ] ) ) {
45
+ $selected_action = $this->valid_actions[ $this->selected_action ];
46
+ } elseif ( isset( $this->valid_actions_without_image[ $this->selected_action ] ) ) {
47
+ $selected_action = $this->valid_actions_without_image[ $this->selected_action ];
48
+ } elseif ( isset( $this->valid_actions_multiple_images[ $this->selected_action ] ) ) {
49
+ $selected_action = $this->valid_actions_multiple_images[ $this->selected_action ];
50
+ } else {
51
+ $selected_action = __( 'You have not selected an action.', $this->plugin_slug );
52
+ }
53
+ ?>
54
+ <p><?php echo $selected_action; ?></p>
55
+ <p><a class="button" href='<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s', $this->page_slug ) ) );?>'><?php _e( 'If wrong action start again', $this->plugin_slug );?></a></p>
56
+ <?php
57
+ if ( $two_columns ) {
58
+ ?>
59
+ </div><!-- .qfi_w50percent -->
60
+ </div><!-- .qfi_wrapper -->
61
+ <?php
62
+ }
63
+ // don't show on selection page
64
+ if ( 'select' != $this->selected_step ) {
65
+ ?>
66
+ <div class="qfi_wrapper">
67
+ <div class="qfi_w50percent">
68
+ <h4><?php _e( 'Your selected options', $this->plugin_slug ); ?></h4>
69
+ <?php
70
+ if ( $this->selected_options ) {
71
+ ?>
72
+ <ul>
73
+ <?php
74
+ foreach ( $this->selected_options as $option ) {
75
+ ?>
76
+ <li><?php echo $this->valid_options[ $option ]; ?></li>
77
+ <?php
78
+ }
79
+ ?>
80
+ </ul>
81
+ <?php
82
+ } else {
83
+ ?>
84
+ <p><?php _e( 'No selected options', $this->plugin_slug ); ?></p>
85
+ <?php
86
+ }
87
+ ?>
88
+ </div><!-- .qfi_w50percent -->
89
+ <div class="qfi_w50percent">
90
+ <h4><?php _e( 'Your selected filters', $this->plugin_slug ); ?></h4>
91
+ <?php
92
+ if ( $this->selected_filters ) {
93
+ ?>
94
+ <ul>
95
+ <?php
96
+ foreach ( $this->selected_filters as $filter ) {
97
+ ?>
98
+ <li><?php echo $this->valid_filters[ $filter ]; ?></li>
99
+ <?php
100
+ }
101
+ ?>
102
+ </ul>
103
+ <?php
104
+ } else {
105
+ ?>
106
+ <p><?php _e( 'No selected filters', $this->plugin_slug ); ?></p>
107
+ <?php
108
+ }
109
+ ?>
110
+ </div><!-- .qfi_w50percent -->
111
+ </div><!-- .qfi_wrapper -->
112
+ <?php
113
+ } // if ( 'select' != $this->selected_step )
admin/views/section_overview.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Options Page
4
+ *
5
+ * @package Quick_Featured_Images_Admin
6
+ * @author Martin Stehle <m.stehle@gmx.de>
7
+ * @license GPL-2.0+
8
+ * @link http://wordpress.org/plugins/quick-featured-images/
9
+ * @copyright 2014
10
+ */
11
+
12
+ $qfi_tools_instance = Quick_Featured_Images_Tools::get_instance();
13
+ $qfi_defaults_instance = Quick_Featured_Images_Defaults::get_instance();
14
+ $qfi_settings_instance = Quick_Featured_Images_Settings::get_instance();
15
+ ?>
16
+
17
+ <h3><?php _e( 'Manage featured images in a quick way', $this->plugin_slug ); ?></h3>
18
+ <p><?php echo $this->get_page_description(); ?></p>
19
+ <ul>
20
+ <?php
21
+ /**
22
+ * Bulk Edit Page Item
23
+ *
24
+ */
25
+ ?>
26
+ <li>
27
+ <h4><?php echo $qfi_tools_instance->get_page_headline(); ?></h4>
28
+ <?php
29
+ if ( current_user_can( $qfi_tools_instance->get_required_user_cap() ) ) {
30
+ printf(
31
+ ' <p><a href="%s"><span class="dashicons dashicons-admin-tools"></span><br />%s</a></p>',
32
+ admin_url( sprintf( 'admin.php?page=%s', $qfi_tools_instance->get_page_slug() ) ),
33
+ $qfi_tools_instance->get_page_description()
34
+ );
35
+ } else {
36
+ ?>
37
+ <p><span class="dashicons dashicons-admin-tools"></span><br /><?php echo $qfi_tools_instance->get_page_description(); ?></p>
38
+ <?php
39
+ }
40
+ ?>
41
+ </li>
42
+ <?php
43
+ /**
44
+ * Presets Page Item
45
+ *
46
+ */
47
+ ?>
48
+ <li>
49
+ <h4><?php echo $qfi_defaults_instance->get_page_headline(); ?></h4>
50
+ <?php
51
+ if ( current_user_can( $qfi_defaults_instance->get_required_user_cap() ) ) {
52
+ printf(
53
+ ' <p><a href="%s"><span class="dashicons dashicons-images-alt"></span><br />%s</a></p>',
54
+ admin_url( sprintf( 'admin.php?page=%s', $qfi_defaults_instance->get_page_slug() ) ),
55
+ $qfi_defaults_instance->get_page_description()
56
+ );
57
+ } else {
58
+ ?>
59
+ <p><span class="dashicons dashicons-admin-defaults"></span><br /><?php echo $qfi_defaults_instance->get_page_description(); ?></p>
60
+ <?php
61
+ }
62
+ ?>
63
+ </li>
64
+ <?php
65
+ /**
66
+ * Image Columns Page Item
67
+ *
68
+ */
69
+ ?>
70
+ <li>
71
+ <h4><?php echo $qfi_settings_instance->get_page_headline(); ?></h4>
72
+ <?php
73
+ if ( current_user_can( $qfi_settings_instance->get_required_user_cap() ) ) {
74
+ printf(
75
+ ' <p><a href="%s"><span class="dashicons dashicons-admin-settings"></span><br />%s</a></p>',
76
+ admin_url( sprintf( 'admin.php?page=%s', $qfi_settings_instance->get_page_slug() ) ),
77
+ $qfi_settings_instance->get_page_description()
78
+ );
79
+ } else {
80
+ ?>
81
+ <p><span class="dashicons dashicons-admin-settings"></span><br /><?php echo $qfi_settings_instance->get_page_description(); ?></p>
82
+ <?php
83
+ }
84
+ ?>
85
+ </li>
86
+ <li>
87
+ <h4><?php _e( 'The premium version', $this->plugin_slug ); ?></h4>
88
+ <p><a href="http://www.quickfeaturedimages.com<?php _e( '/', $this->plugin_slug ); ?>"><img alt="Quick Featured Images Pro" src="<?php echo plugin_dir_url( dirname( dirname( __FILE__ ) ) ); ?>admin/assets/images/logo_qfi_pro.gif" style="width:100%;height:auto;"></a></p>
89
+ <p><?php _e( 'Are you looking for more options and more filters?', $this->plugin_slug ); ?> <?php _e( 'Get the premium version', $this->plugin_slug ); ?> <a href="http://www.quickfeaturedimages.com<?php _e( '/', $this->plugin_slug ); ?>">Quick Featured Images Pro</a>.</p>
90
+ </li>
91
+ </ul>
92
+
admin/views/section_results.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h3><?php _e( 'Results of the action', $this->plugin_slug ); ?></h3>
2
+ <?php
3
+ if ( $results ) {
4
+ // translate once for multiple usage and improve performance
5
+ $label_details = __( 'Details', $this->plugin_slug );
6
+ $label_current_fi = __( 'Current Featured Image', $this->plugin_slug );
7
+ $label_number = __( 'No.', $this->plugin_slug );
8
+ $label_changed = __( 'Changed successfully', $this->plugin_slug );
9
+ $label_unchanged = sprintf( '<span class="failure">%s</span>', __( 'Unchanged', $this->plugin_slug ) );
10
+ // WP core labels
11
+ $text = 'No image set';
12
+ $label_no_image = __( $text );
13
+ $text = '(no title)';
14
+ $default_title = __( $text );
15
+ ?>
16
+ <p><?php _e( 'The list is in alphabetical order according to post title. You can edit a post in a new window by clicking on its link in the list.', $this->plugin_slug ); ?></p>
17
+ <table class="widefat">
18
+ <thead>
19
+ <tr>
20
+ <th class="num"><?php echo $label_number; ?></th>
21
+ <th><?php echo $label_details; ?></th>
22
+ <th class="num"><?php echo $label_current_fi; ?></th>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <?php
27
+ $c = 1;
28
+ foreach ( $results as $result ) {
29
+ // post title, else default title
30
+ $post_title = $result[ 1 ] ? $result[ 1 ] : $default_title;
31
+ // check if no featured image for the post, else add default
32
+ $img = $result[ 2 ] ? $result[ 2 ] : $label_no_image;
33
+ // get the result message per post
34
+ $msg = $result[ 3 ] ? $label_changed : $label_unchanged;
35
+ // alternating row colors with error class if error
36
+ $classname = $result[ 3 ] ? '' : 'form-invalid';
37
+ if ( 0 == $c % 2 ) { // if $c is divisible by 2 (so the modulo is 0)
38
+ $classname .= $result[ 3 ] ? 'alt' : ' alt';
39
+ }
40
+ // print the table row
41
+ printf( '<tr%s>', ' class="' . $classname . '"' );
42
+ printf( '<td class="num">%d</td>', $c );
43
+ printf(
44
+ '<td><a href="%s" target="_blank">%s</a><br>%s</td>',
45
+ $result[ 0 ], // edit post link
46
+ $post_title,
47
+ $msg
48
+ );
49
+ printf( '<td class="num">%s</td>', $img );
50
+ print "</tr>\n";
51
+ // increase counter
52
+ $c++;
53
+ }
54
+ ?>
55
+ </tbody>
56
+ <tfoot>
57
+ <tr>
58
+ <th class="num"><?php echo $label_number; ?></th>
59
+ <th><?php echo $label_details; ?></th>
60
+ <th class="num"><?php echo $label_current_fi; ?></th>
61
+ </tr>
62
+ </tfoot>
63
+ </table>
64
+ <?php
65
+ } else {
66
+ ?>
67
+ <p><?php _e( 'No matches found.', $this->plugin_slug ); ?></p>
68
+ <?php
69
+ }
70
+ ?>
71
+ <p><a class="button" href="<?php echo esc_url( admin_url( sprintf( 'admin.php?page=%s', $this->page_slug ) ) );?>"><?php _e( 'Start again', $this->plugin_slug );?></a></p>
72
+ <h3><?php _e( 'Do you like the plugin?', $this->plugin_slug ); ?></h3>
73
+ <p><a href="http://wordpress.org/support/view/plugin-reviews/quick-featured-images"><?php _e( 'Please rate it at wordpress.org!', $this->plugin_slug ); ?></a></p>
admin/views/section_settings.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Options Page
4
+ *
5
+ * @package Quick_Featured_Images_Settings
6
+ * @author Martin Stehle <m.stehle@gmx.de>
7
+ * @license GPL-2.0+
8
+ * @link http://wordpress.org/plugins/quick-featured-images/
9
+ * @copyright 2014
10
+ */
11
+ ?>
12
+
13
+ <form method="post" action="options.php">
14
+ <?php
15
+ settings_fields( $this->settings_fields_slug );
16
+ do_settings_sections( $this->main_options_page_slug );
17
+ submit_button();
18
+ ?>
19
+ </form>
index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
languages/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
languages/quick-featured-images-de_DE.mo ADDED
Binary file
languages/quick-featured-images-de_DE.po ADDED
@@ -0,0 +1,1285 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2014
2
+ # This file is distributed under the same license as the plugin package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Quick Featured Images\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/plugins/quick-featured-images\n"
7
+ "POT-Creation-Date: 2015-03-16 21:29+0100\n"
8
+ "PO-Revision-Date: 2015-03-16 21:29+0100\n"
9
+ "Last-Translator: Martin Stehle <m.stehle@gmx.de>\n"
10
+ "Language-Team: <m.stehle@gmx.de>\n"
11
+ "Language: de_DE\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.7.5\n"
16
+ "X-Poedit-KeywordsList: __;_e;_n;_x;esc_html_e;esc_html__;esc_attr_e;"
17
+ "esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_x:1,2c;_n:1,2\n"
18
+ "X-Poedit-Basepath: ../\n"
19
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+
22
+ #: admin/class-quick-featured-images-admin.php:202
23
+ msgid ""
24
+ "Your time-saving Swiss Army Knife for featured images: Set, replace and "
25
+ "delete them in bulk, set default images, get overview lists."
26
+ msgstr ""
27
+ "Dein Schweizer Taschenmesser für Beitragsbilder: Setze, ersetze und lösche "
28
+ "sie massenhaft, definiere Standard-Bilder, erhalte Übersichtslisten."
29
+
30
+ #: admin/class-quick-featured-images-admin.php:266
31
+ #, php-format
32
+ msgid ""
33
+ "The plugin requires WordPress version %s or higher. Therefore, WordPress did "
34
+ "not activate it. If you want to use this plugin update the Wordpress files "
35
+ "to the latest version."
36
+ msgstr ""
37
+ "Das Plugin erfordert WordPress Version %s oder höher. Daher hat WordPress "
38
+ "es nicht aktiviert. Falls du dieses Plugin nutzen willst, aktualisiere die "
39
+ "WordPress-Dateien auf die neueste Version."
40
+
41
+ #: admin/class-quick-featured-images-admin.php:472
42
+ #, php-format
43
+ msgid "Welcome to %s! You can find the plugin at %s."
44
+ msgstr "Willkommen zu %s! Du kannst das Plugin finden unter %s."
45
+
46
+ #: admin/class-quick-featured-images-defaults.php:191
47
+ msgid "Changes saved."
48
+ msgstr "Änderungen gespeichert."
49
+
50
+ #: admin/class-quick-featured-images-defaults.php:194
51
+ msgid "No changes were saved."
52
+ msgstr "Keine Änderungen gespeichert."
53
+
54
+ #: admin/class-quick-featured-images-defaults.php:231
55
+ msgid "Preset Featured Images"
56
+ msgstr "Voreingestellte Beitragsbilder"
57
+
58
+ #: admin/class-quick-featured-images-defaults.php:242
59
+ msgid "Set default featured images for future posts"
60
+ msgstr "Stelle vorgegebene Beitragsbilder für zukünftige Inhalte ein"
61
+
62
+ #: admin/class-quick-featured-images-settings.php:205
63
+ msgid "Image Columns"
64
+ msgstr "Bil&shy;der&shy;spal&shy;ten"
65
+
66
+ #: admin/class-quick-featured-images-settings.php:216
67
+ msgid "Helpful options for managing featured images"
68
+ msgstr "Hilfreiche Einstellungen zur Verwaltung der Beitragsbilder"
69
+
70
+ #: admin/class-quick-featured-images-settings.php:385
71
+ msgid "Columns for featured images in posts lists"
72
+ msgstr "Spalten für Beitragsbilder in Beitragsübersichten"
73
+
74
+ #: admin/class-quick-featured-images-settings.php:393
75
+ msgid "Show additional column for featured images in lists of"
76
+ msgstr "Zeige eine zusätzliche Spalte für Beitragsbilder in Übersichten"
77
+
78
+ #: admin/class-quick-featured-images-settings.php:398
79
+ msgid "Posts list with image column"
80
+ msgstr "Inhaltsliste mit Bildspalte"
81
+
82
+ #: admin/class-quick-featured-images-settings.php:512
83
+ msgid ""
84
+ "Activate the checkboxes at each post type to show the extra columns in the "
85
+ "post lists."
86
+ msgstr ""
87
+ "Aktiviere die Checkboxen bei jedem Inhaltstyp, um die zusätzliche Spalte in "
88
+ "den Beitragsübersichten anzuzeigen."
89
+
90
+ #: admin/class-quick-featured-images-settings.php:522
91
+ msgid ""
92
+ "The additional columns give you a quick overview about all used featured "
93
+ "images for every post. The Featured Image column is sortable."
94
+ msgstr ""
95
+ "Die zusätzlichen Spalten geben dir einen schnellen Überblick über alle "
96
+ "verwendeten Beitragsbilder eines jeden Beitrags. Die Spalte der "
97
+ "Beitragsbilder ist sortierbar."
98
+
99
+ #: admin/class-quick-featured-images-tools.php:545
100
+ #, php-format
101
+ msgid "Wrong image ID %d"
102
+ msgstr "Falsche Bild-ID %d"
103
+
104
+ #: admin/class-quick-featured-images-tools.php:653
105
+ msgid "Select"
106
+ msgstr "Auswählen"
107
+
108
+ #: admin/class-quick-featured-images-tools.php:654
109
+ msgid "Add filter"
110
+ msgstr "Filter hinzufügen"
111
+
112
+ #: admin/class-quick-featured-images-tools.php:655
113
+ msgid "Refine"
114
+ msgstr "Verfeinern"
115
+
116
+ #: admin/class-quick-featured-images-tools.php:656
117
+ msgid "Confirm"
118
+ msgstr "Bestätigen"
119
+
120
+ #: admin/class-quick-featured-images-tools.php:657
121
+ msgid "Perform"
122
+ msgstr "Umsetzen"
123
+
124
+ #: admin/class-quick-featured-images-tools.php:661
125
+ msgid "Set the selected image as new featured image"
126
+ msgstr "Füge das ausgewählte Bild als neues Beitragsbild hinzu"
127
+
128
+ #: admin/class-quick-featured-images-tools.php:662
129
+ msgid "Replace featured images by the selected image"
130
+ msgstr "Ersetze mindestens ein Beitragsbild durch das ausgewählte Bild"
131
+
132
+ #: admin/class-quick-featured-images-tools.php:663
133
+ msgid "Remove the selected image as featured image"
134
+ msgstr "Entferne das ausgewählte Bild als Beitragsbild"
135
+
136
+ #: admin/class-quick-featured-images-tools.php:666
137
+ msgid "Remove any image as featured image"
138
+ msgstr "Entferne jedes Bild als Beitragsbild"
139
+
140
+ #: admin/class-quick-featured-images-tools.php:669
141
+ msgid "Set multiple images randomly as featured images"
142
+ msgstr ""
143
+ "Füge mehrere Bilder in zufälliger Ordnung als neue Beitragsbilder hinzu"
144
+
145
+ #: admin/class-quick-featured-images-tools.php:673
146
+ msgid "Overwrite featured images"
147
+ msgstr "Überschreibe Beitragsbilder"
148
+
149
+ #: admin/class-quick-featured-images-tools.php:674
150
+ msgid "Consider only posts without any featured image"
151
+ msgstr "Berücksichtige nur Beiträge ohne Beitragsbild"
152
+
153
+ #: admin/class-quick-featured-images-tools.php:678
154
+ msgid "Post Type Filter"
155
+ msgstr "Inhaltstypfilter"
156
+
157
+ #: admin/class-quick-featured-images-tools.php:679
158
+ msgid "Category Filter"
159
+ msgstr "Kategorienfilter"
160
+
161
+ #: admin/class-quick-featured-images-tools.php:680
162
+ msgid "Tag Filter"
163
+ msgstr "Schlagwortfilter"
164
+
165
+ #: admin/class-quick-featured-images-tools.php:692
166
+ msgid "Audio files"
167
+ msgstr "Audio-Dateien"
168
+
169
+ #: admin/class-quick-featured-images-tools.php:693
170
+ msgid "Video files"
171
+ msgstr "Video-Dateien"
172
+
173
+ #: admin/class-quick-featured-images-tools.php:715
174
+ msgid "Start Date"
175
+ msgstr "Startdatum"
176
+
177
+ #: admin/class-quick-featured-images-tools.php:716
178
+ msgid "End Date"
179
+ msgstr "Enddatum"
180
+
181
+ #: admin/class-quick-featured-images-tools.php:717
182
+ msgid "Include the posts of the selected dates"
183
+ msgstr "Schließe die Beiträge der ausgewählten Zeitpunkte mit ein"
184
+
185
+ #: admin/class-quick-featured-images-tools.php:721
186
+ msgid "Custom field name"
187
+ msgstr "Benutzerdefinierter Feldname"
188
+
189
+ #: admin/class-quick-featured-images-tools.php:722
190
+ msgid "Operator to test with the value in the custom field"
191
+ msgstr "Operator, um auf den Wert im benutzerdefiniertem Feld zu testen"
192
+
193
+ #: admin/class-quick-featured-images-tools.php:723
194
+ msgid "Custom field value to compare with"
195
+ msgstr "Benutzerdefinierter Wert, mit dem verglichen werden soll"
196
+
197
+ #: admin/class-quick-featured-images-tools.php:724
198
+ msgid "Custom field type"
199
+ msgstr "Benutzerdefinierter Feld-Typ"
200
+
201
+ #: admin/class-quick-featured-images-tools.php:730
202
+ msgid "Image width in pixels lower than"
203
+ msgstr "Bildbreite in Pixeln kleiner als"
204
+
205
+ #: admin/class-quick-featured-images-tools.php:731
206
+ msgid "Image height in pixels lower than"
207
+ msgstr "Bildhöhe in Pixeln kleiner als"
208
+
209
+ #: admin/class-quick-featured-images-tools.php:819
210
+ #, php-format
211
+ msgid "The input field %s is empty."
212
+ msgstr "Das Eingabefeld %s ist leer."
213
+
214
+ #: admin/class-quick-featured-images-tools.php:820
215
+ msgid "Type in a value into the input field."
216
+ msgstr "Gebe in das Eingabefeld einen Wert ein."
217
+
218
+ #: admin/class-quick-featured-images-tools.php:823
219
+ #, php-format
220
+ msgid "%s is not defined."
221
+ msgstr "%s ist nicht definiert."
222
+
223
+ #: admin/class-quick-featured-images-tools.php:824
224
+ msgid "Check how to define the value."
225
+ msgstr "Prüfe nach, wie der Wert gesetzt wird."
226
+
227
+ #: admin/class-quick-featured-images-tools.php:827
228
+ msgid "There is no selected image."
229
+ msgstr "Es gibt kein ausgewähltes Bild."
230
+
231
+ #: admin/class-quick-featured-images-tools.php:828
232
+ msgid "Select an image from the media library."
233
+ msgstr "Wähle ein Bild aus der Mediathek aus."
234
+
235
+ #: admin/class-quick-featured-images-tools.php:831
236
+ #: admin/views/section_image.php:50
237
+ msgid "You have not selected an action."
238
+ msgstr "Du hast keine Aktion ausgewählt"
239
+
240
+ #: admin/class-quick-featured-images-tools.php:832
241
+ msgid "Start again and select which action you want to apply."
242
+ msgstr "Fange neu an und wähle aus, welche Aktion du anwenden willst."
243
+
244
+ #: admin/class-quick-featured-images-tools.php:835
245
+ #, php-format
246
+ msgid "The input field %s has an invalid value."
247
+ msgstr "Das Eingabefeld %s hat einen ungültigen Wert."
248
+
249
+ #: admin/class-quick-featured-images-tools.php:836
250
+ msgid "Type in valid values in the input field."
251
+ msgstr "Gebe einen gültigen Wert in das Eingabefeld ein."
252
+
253
+ #: admin/class-quick-featured-images-tools.php:840
254
+ msgid "Type in values stored by WordPress."
255
+ msgstr "Gebe von WordPress gespeicherte Werte ein."
256
+
257
+ #: admin/class-quick-featured-images-tools.php:2276
258
+ msgid "Set, replace, remove"
259
+ msgstr "Setzen, tauschen, löschen"
260
+
261
+ #: admin/class-quick-featured-images-tools.php:2287
262
+ msgid "Bulk set, replace and remove featured images for existing posts"
263
+ msgstr ""
264
+ "Massenweises Hinzufügen, Ersetzen und Entfernen von Beitragsbildern für "
265
+ "bestehende Inhalte"
266
+
267
+ #: admin/class-quick-featured-images-tools.php:2403
268
+ msgid "Bulk set as featured image"
269
+ msgstr "Als Beitragsbild setzen"
270
+
271
+ #: admin/views/filter_category.php:3
272
+ msgid "Select a category"
273
+ msgstr "Wähle eine Kategorie aus"
274
+
275
+ #: admin/views/filter_post_types.php:2
276
+ msgid "Select post types"
277
+ msgstr "Wähle die Inhaltstypen (Post Types) aus"
278
+
279
+ #: admin/views/filter_post_types.php:2
280
+ msgid "You can select posts, pages and available custom posts types."
281
+ msgstr ""
282
+ "Du kannst Beiträge, Seiten und vorhandene andere Inhaltstypen (sog. Custom "
283
+ "Post Types) auswählen."
284
+
285
+ #: admin/views/filter_tag.php:7
286
+ msgid "Select a tag"
287
+ msgstr "Wähle ein Schlagwort aus"
288
+
289
+ #: admin/views/filter_tag.php:20
290
+ msgid "There are no tags in use."
291
+ msgstr "Zur Zeit werden keine Schlagwörter genutzt."
292
+
293
+ #: admin/views/form_back_to_selection.php:2
294
+ msgid "Select filters and options again"
295
+ msgstr "Filter und Optionen nochmals auswählen"
296
+
297
+ #: admin/views/form_back_to_selection.php:3
298
+ msgid ""
299
+ "If you want to change your former selection just go back by clicking on this "
300
+ "button."
301
+ msgstr ""
302
+ "Falls Du deine vorige Auswahl ändern willst, gehe zurück per Klick auf diese "
303
+ "Schaltfläche."
304
+
305
+ #: admin/views/form_back_to_selection.php:42
306
+ msgid "Modify selection"
307
+ msgstr "Auswahl ändern"
308
+
309
+ #: admin/views/form_confirm.php:4
310
+ msgid "Should the selected image be set as featured image to all listed posts?"
311
+ msgstr ""
312
+ "Sollte das ausgewählte Bild allen gelisteten Beiträgen als Beitragsbild "
313
+ "hinzugefügt werden?"
314
+
315
+ #: admin/views/form_confirm.php:7
316
+ msgid ""
317
+ "Should the selected images be set randomly as featured images to all listed "
318
+ "posts?"
319
+ msgstr ""
320
+ "Sollten die ausgewählten Bilder bei allen gelisteten Beiträgen zufällig "
321
+ "hinzugefügt werden?"
322
+
323
+ #: admin/views/form_confirm.php:10
324
+ msgid ""
325
+ "Should the current set featured image be replaced by the selected image at "
326
+ "all listed posts?"
327
+ msgstr ""
328
+ "Sollte das aktuell gesetzte Beitragsbild durch das ausgewählte Bild bei "
329
+ "allen gelisteten Beiträgen ausgetauscht werden?"
330
+
331
+ #: admin/views/form_confirm.php:13
332
+ msgid "Should the selected image be removed from all listed posts?"
333
+ msgstr ""
334
+ "Sollte das ausgewählte Bild von allen gelisteten Beiträgen entfernt werden?"
335
+
336
+ #: admin/views/form_confirm.php:16
337
+ msgid "Should the future images be set as featured images at all listed posts?"
338
+ msgstr "Sollten die vorgeschlagene Bilder als Beitragsbilder gesetzt werden?"
339
+
340
+ #: admin/views/form_confirm.php:19
341
+ msgid "Should the added featured images be removed from all listed posts?"
342
+ msgstr ""
343
+ "Sollte das ausgewählte Bild von allen gelisteten Beiträgen entfernt werden?"
344
+
345
+ #: admin/views/form_confirm.php:24
346
+ msgid "Preview of your selection"
347
+ msgstr "Vorschau deiner Auswahl"
348
+
349
+ #: admin/views/form_confirm.php:25
350
+ #, php-format
351
+ msgid "%d matches found"
352
+ msgstr "%d Treffer gefunden"
353
+
354
+ #: admin/views/form_confirm.php:29 admin/views/section_results.php:5
355
+ msgid "Details"
356
+ msgstr "Details"
357
+
358
+ #: admin/views/form_confirm.php:30 admin/views/section_defaults.php:17
359
+ #: admin/views/section_results.php:7
360
+ msgid "No."
361
+ msgstr "Nr."
362
+
363
+ #: admin/views/form_confirm.php:31 admin/views/section_results.php:6
364
+ msgid "Current Featured Image"
365
+ msgstr "Aktuelles Beitragsbild"
366
+
367
+ #: admin/views/form_confirm.php:32
368
+ msgid "Future Featured Image"
369
+ msgstr "Zukünftiges Beitragsbild"
370
+
371
+ #: admin/views/form_confirm.php:33
372
+ msgid "written on"
373
+ msgstr "geschrieben am"
374
+
375
+ #: admin/views/form_confirm.php:34
376
+ msgid "by"
377
+ msgstr "von"
378
+
379
+ #: admin/views/form_confirm.php:48 admin/views/section_results.php:18
380
+ msgid ""
381
+ "The list is in alphabetical order according to post title. You can edit a "
382
+ "post in a new window by clicking on its link in the list."
383
+ msgstr ""
384
+ "Die Liste ist alphabetisch nach Titel sortiert. Du kannst einen Beitrag in "
385
+ "einem neuen Fenster bearbeiten per Klick auf seinen Link in der Liste."
386
+
387
+ #: admin/views/form_confirm.php:111
388
+ msgid "Confirm the change"
389
+ msgstr "Änderung bestätigen"
390
+
391
+ #: admin/views/form_confirm.php:112
392
+ msgid "You can not undo the operation!"
393
+ msgstr "Du kannst die Aktion nicht rückgängig machen!"
394
+
395
+ #: admin/views/form_confirm.php:229 admin/views/form_select.php:47
396
+ #: admin/views/section_errormsg.php:8 admin/views/section_results.php:77
397
+ msgid "Start again"
398
+ msgstr "Beginne neu"
399
+
400
+ #: admin/views/form_confirm.php:229
401
+ msgid "or refine your selection with the following form fields."
402
+ msgstr "oder verfeinere deine Auswahl mit dem folgenden Feldern."
403
+
404
+ #: admin/views/form_refine.php:1
405
+ msgid "Refine your selection"
406
+ msgstr "Verfeinere deine Auswahl"
407
+
408
+ #: admin/views/form_refine.php:8
409
+ msgid "Refine filters"
410
+ msgstr "Filter verfeinern"
411
+
412
+ #: admin/views/form_refine.php:9
413
+ msgid ""
414
+ "Now you can find posts and pages by matching parameters. Refine them here."
415
+ msgstr ""
416
+ "Jetzt kannst du die Beiträge und Seiten auf die passenden Parameter "
417
+ "eingrenzen. Stelle sie hier ein."
418
+
419
+ #: admin/views/form_refine.php:10
420
+ msgid "Whatever you do: You can confirm your choice on the next page."
421
+ msgstr ""
422
+ "Was immer du machst: Du kannst deine Auswahl auf der folgenden Seite "
423
+ "überprüfen."
424
+
425
+ #: admin/views/form_refine.php:18
426
+ #, php-format
427
+ msgid "File %s is not available."
428
+ msgstr "Datei %s ist nicht vorhanden."
429
+
430
+ #: admin/views/form_refine.php:48 admin/views/form_select.php:40
431
+ msgid "Preview filtering"
432
+ msgstr "Auswahl überprüfen"
433
+
434
+ #: admin/views/form_refine.php:54
435
+ msgid ""
436
+ "There are no selected filters. Modify your filter selection or just go on by "
437
+ "clicking on the next button."
438
+ msgstr ""
439
+ "Du hast keinen Filter ausgewählt. Ändere deine Filterauswahl oder gehe "
440
+ "weiter per Klick auf die nächste Schaltfläche."
441
+
442
+ #: admin/views/form_select.php:11 admin/views/form_start.php:4
443
+ #: admin/views/section_defaults.php:167
444
+ msgid "Notice"
445
+ msgstr "Hinweis"
446
+
447
+ #: admin/views/form_select.php:13
448
+ msgid ""
449
+ "You did not have selected an image from the list below. To go on select at "
450
+ "least one image you want to replace by the selected image."
451
+ msgstr ""
452
+ "Du hast kein Bild aus der untenstehenden Liste ausgewählt. Um weiter zu "
453
+ "kommen, wähle mindestens ein Bild aus, das durch das ausgewählte Bild "
454
+ "ausgetauscht werden soll."
455
+
456
+ #: admin/views/form_select.php:18
457
+ msgid "Select the featured images you want to replace by the selected image."
458
+ msgstr ""
459
+ "Wähle die Beitragsbilder aus, das du durch das ausgewählte Bild ersetzen "
460
+ "willst."
461
+
462
+ #: admin/views/form_select.php:19
463
+ msgid "You can select multiple images. Select at least one image."
464
+ msgstr "Du kannst mehrere Bilder auswählen. Wähle mindestens ein Bild aus."
465
+
466
+ #: admin/views/form_select.php:46
467
+ msgid "There are no featured images in use."
468
+ msgstr "Zur Zeit gibt es kein Beitragsbild."
469
+
470
+ #: admin/views/form_select.php:55
471
+ msgid "Refine your selections"
472
+ msgstr "Verfeinere deine Auswahl"
473
+
474
+ #: admin/views/form_select.php:62
475
+ msgid "Optional: Select options"
476
+ msgstr "Optional: Wähle Optionen aus"
477
+
478
+ #: admin/views/form_select.php:64
479
+ msgid "Process Options"
480
+ msgstr "Einstellmöglichkeiten"
481
+
482
+ #: admin/views/form_select.php:65
483
+ msgid "You can control the process with the following options."
484
+ msgstr "Du kannst den Vorgang mit den folgenden Einstellungen steuern."
485
+
486
+ #: admin/views/form_select.php:69
487
+ msgid "Overwrite existing featured images with new ones"
488
+ msgstr "Überschreibe bestehende Beitragsbilder mit dem/den neuen"
489
+
490
+ #: admin/views/form_select.php:78
491
+ msgid ""
492
+ "Posts with featured images will be ignored, even if the Overwrite option is "
493
+ "checked "
494
+ msgstr ""
495
+ "Beiträge mit Beitragsbildern werden ignoriert, auch wenn die Überschreiben-"
496
+ "Option aktiviiert ist"
497
+
498
+ #: admin/views/form_select.php:89
499
+ msgid "Optional: Add a filter"
500
+ msgstr "Optional: Füge einen Filter hinzu"
501
+
502
+ #: admin/views/form_select.php:91
503
+ msgid "Select filters"
504
+ msgstr "Filter auswählen"
505
+
506
+ #: admin/views/form_select.php:92
507
+ msgid ""
508
+ "If you want select one of the following filters to narrow down the set of "
509
+ "concerned posts and pages."
510
+ msgstr ""
511
+ "Falls gewünscht, wähle eines der folgenden Filter, um die Auswahl der "
512
+ "betreffenden Beiträge und Seiten einzugrenzen."
513
+
514
+ #: admin/views/form_select.php:93
515
+ msgid ""
516
+ "You can select multiple filters. They will return an intersection of their "
517
+ "results."
518
+ msgstr ""
519
+ "Du kannst mehrere Filter auswählen. Sie geben eine Schnittmenge ihrer "
520
+ "Ergebnisse zurück."
521
+
522
+ #: admin/views/form_select.php:98
523
+ msgid ""
524
+ "Search by post type. By default all posts, pages and custom post types will "
525
+ "be affected."
526
+ msgstr ""
527
+ "Suchen nach Inhaltstyp. Standardmäßig werden alle Beiträge, Seiten und "
528
+ "eigene Inhaltstyp (Custom Post Types) berücksichtigt."
529
+
530
+ #: admin/views/form_select.php:101
531
+ msgid "Search posts by category"
532
+ msgstr "Suchen nach Kategorie"
533
+
534
+ #: admin/views/form_select.php:104
535
+ msgid "Search posts by tag"
536
+ msgstr "Suchen nach Schlagwort"
537
+
538
+ #: admin/views/form_select.php:118 admin/views/section_overview.php:74
539
+ msgid "Are you looking for more options and more filters?"
540
+ msgstr "Suchst du nach mehr Optionen und mehr Filtern?"
541
+
542
+ #: admin/views/form_select.php:118 admin/views/form_select.php:140
543
+ #: admin/views/form_start.php:107 admin/views/section_footer.php:59
544
+ #: admin/views/section_overview.php:74
545
+ msgid "Get the premium version"
546
+ msgstr "Hole dir die Premium-Version"
547
+
548
+ # Path to language site
549
+ #: admin/views/form_select.php:118 admin/views/form_select.php:140
550
+ #: admin/views/form_start.php:107 admin/views/section_footer.php:59
551
+ #: admin/views/section_overview.php:73 admin/views/section_overview.php:74
552
+ msgid "/"
553
+ msgstr "/de"
554
+
555
+ #: admin/views/form_select.php:119
556
+ msgid ""
557
+ "On the next page you can refine the filters. If you did not select any "
558
+ "filter you will go to the preview list directly."
559
+ msgstr ""
560
+ "Auf der nächsten Seite kannst du die Filter verfeinern. Falls du keine "
561
+ "Filter ausgewählt hast, kommst du direkt zur Vorschau."
562
+
563
+ #: admin/views/form_select.php:137
564
+ msgid "If you encounter a white, blank page, read this"
565
+ msgstr "Sollte dir die weiße, leere Seite begegnen, lese das"
566
+
567
+ #: admin/views/form_select.php:138
568
+ msgid ""
569
+ "Facing a white blank page while trying to treat thousands of posts is the "
570
+ "effect of limited memory capacities on the website server. Instead of "
571
+ "treating a huge amount of posts in one single go try to treat small amounts "
572
+ "of posts multiple times successively. To achieve that do:"
573
+ msgstr ""
574
+ "Einer weißen, leeren Seite zu begegnen, während man bei tausenden von "
575
+ "Beiträgen ein Beitragsbild zu setzen versucht, ergibt sich aufgrund "
576
+ "begrenzter Speicherkapazitäten auf dem Server der Website. Statt eine große "
577
+ "Zahl von Beiträgen in einem einzigen Durchgang zu bearbeiten, versuche, eine "
578
+ "kleine Zahl von Beiträgen in mehreren Durchgängen nacheinander anzugehen. Um "
579
+ "das umzusetzen, mache folgendes:"
580
+
581
+ #: admin/views/form_select.php:141
582
+ msgid "add the time filter,"
583
+ msgstr "füge den Zeitfilter hinzu,"
584
+
585
+ #: admin/views/form_select.php:142
586
+ msgid "set a small time range,"
587
+ msgstr "stelle einen kurzen Zeitraum ein,"
588
+
589
+ #: admin/views/form_select.php:143
590
+ msgid "do the process"
591
+ msgstr "führe den Prozess durch"
592
+
593
+ #: admin/views/form_select.php:144
594
+ msgid "and repeat it with the next time range as often as needed."
595
+ msgstr "und wiederhole ihn mit dem nächsten Zeitraum so oft wie nötig."
596
+
597
+ #: admin/views/form_select.php:146
598
+ msgid ""
599
+ "This way is not as fast as one single run, but still much faster than "
600
+ "setting the images for each post manually."
601
+ msgstr ""
602
+ "Diese Vorgehensweise ist nicht so schnell wie ein einzelner Durchlauf, aber "
603
+ "immer noch um einiges schneller, als jedem Beitrag das Bild per Hand "
604
+ "zuzuweisen."
605
+
606
+ #: admin/views/form_start.php:6 admin/views/section_defaults.php:169
607
+ msgid ""
608
+ "The current theme does not support featured images. Anyway you can use this "
609
+ "plugin. The effects are stored and will be visible in a theme which supports "
610
+ "featured images."
611
+ msgstr ""
612
+ "Das aktuelle Theme unterstützt keine Beitragsbilder. Jedoch kannst du das "
613
+ "Plugin nutzen. Die Auswirkungen werden gespeichert und werden in einem "
614
+ "Theme, das Beitragsbilder unterstützt, sichtbar."
615
+
616
+ #: admin/views/form_start.php:12
617
+ msgid "What do you want to do?"
618
+ msgstr "Was willst du umsetzen?"
619
+
620
+ #: admin/views/form_start.php:13
621
+ msgid ""
622
+ "Here you can add, replace and delete featured images to your posts. Select "
623
+ "one of the following actions and, if necessary, one or more images."
624
+ msgstr ""
625
+ "Hier kannst du zu deinen Inhalten Beitragsbilder hinzufügen, ersetzen und "
626
+ "löschen. Wähle eine der folgenden Aktionen aus und, wo notwendig, eines oder "
627
+ "mehrere Bilder."
628
+
629
+ #: admin/views/form_start.php:14
630
+ msgid "Whatever you select: You can refine your choice on the next page."
631
+ msgstr ""
632
+ "Was du auch auswählst: Du kannst deine Auswahl auf der folgenden Seite "
633
+ "verfeinern."
634
+
635
+ #: admin/views/form_start.php:15
636
+ msgid "Important advice"
637
+ msgstr "Wichtiger Hinweis"
638
+
639
+ #: admin/views/form_start.php:16
640
+ msgid ""
641
+ "There is no undo function! It is strongly recommended that you make a backup "
642
+ "of the WordPress database before you perform mass changes."
643
+ msgstr ""
644
+ "Es gibt keine Rücksetzfunktion! Es ist dringend empfohlen, dass du eine "
645
+ "Sicherung der WordPress-Datenbank erstellst, bevor du massenweise Änderungen "
646
+ "durchführst."
647
+
648
+ #: admin/views/form_start.php:18
649
+ msgid "Select action"
650
+ msgstr "Aktion auswählen"
651
+
652
+ #: admin/views/form_start.php:19
653
+ msgid "Actions with a single image"
654
+ msgstr "Aktionen mit einem einzelnen Bild"
655
+
656
+ #: admin/views/form_start.php:20
657
+ msgid "These actions require to select an image with the following button."
658
+ msgstr ""
659
+ "Diese Aktionen erfordern ein mit der folgenden Schaltfläche ausgewähltes "
660
+ "Bild."
661
+
662
+ #: admin/views/form_start.php:33
663
+ msgid ""
664
+ "Select the image you want to add to, replace or delete from posts and pages "
665
+ "by clicking on the following button."
666
+ msgstr ""
667
+ "Wähle das Bild aus, das du als Beitragsbild hinzufügen, austauschen oder von "
668
+ "Beiträgen und Seiten entfernen willst durch Klick auf die folgende "
669
+ "Schaltfläche."
670
+
671
+ #: admin/views/form_start.php:54 admin/views/section_defaults.php:20
672
+ msgid "Choose Image"
673
+ msgstr "Bild auswählen"
674
+
675
+ #: admin/views/form_start.php:58
676
+ msgid "If the button does not work, read this:"
677
+ msgstr "Sollte die Schaltfläche nicht funktionieren, hier ein Tipp:"
678
+
679
+ #: admin/views/form_start.php:59
680
+ msgid ""
681
+ "Some users reported that this button would not work in some WordPress "
682
+ "installations. If this should be the case you can take another way:"
683
+ msgstr ""
684
+ "Einige Anwender berichteten, dass diese Schaltfläche nicht in jeder "
685
+ "WordPress-Installation funktionieren würde. Sollte das hier der Fall sein, "
686
+ "kannst du einen anderen Weg gehen:"
687
+
688
+ #: admin/views/form_start.php:60
689
+ msgid ""
690
+ "1. Go to the media library. 2. Move the mouse over the desired image. "
691
+ "Further links are appearing, among them the link &quot;Bulk set as featured "
692
+ "image&quot;. 3. After a click on it you can move on in this plugin."
693
+ msgstr ""
694
+ "1. Gehe in die Mediathek. 2. Fahre mit der Maus über das gewünschte Bild. Es "
695
+ "erscheinen weitere Links, darunter der Link &quot;Als Beitragsbild "
696
+ "setzen&quot;. 3. Nach Klick darauf kannst du im Plugin fortfahren."
697
+
698
+ #: admin/views/form_start.php:64
699
+ msgid "Actions with multiple images"
700
+ msgstr "Aktionen mit mehreren Bildern"
701
+
702
+ #: admin/views/form_start.php:65
703
+ msgid ""
704
+ "These actions require at least one selected image with the following button."
705
+ msgstr ""
706
+ "Diese Aktionen erfordern mindestens ein mit der folgenden Schaltfläche "
707
+ "ausgewähltes Bild."
708
+
709
+ #: admin/views/form_start.php:77
710
+ msgid ""
711
+ "To select multiple images click on the button and use the CTRL key while "
712
+ "clicking on the images."
713
+ msgstr ""
714
+ "Um mehrere Bilder auszuwählen, klicke auf die Schaltfläche und halte die "
715
+ "STRG-Taste beim Klicken auf die Bilder gedrückt."
716
+
717
+ #: admin/views/form_start.php:79
718
+ msgid "Choose Images"
719
+ msgstr "Bilder auswählen"
720
+
721
+ #: admin/views/form_start.php:95
722
+ msgid "Actions without any image"
723
+ msgstr "Aktionen ohne Bild"
724
+
725
+ #: admin/views/form_start.php:96
726
+ msgid "These actions do not require a selected image."
727
+ msgstr "Diese Aktionen erfordern kein ausgewähltes Bild."
728
+
729
+ #: admin/views/form_start.php:107
730
+ msgid "Do you want to assign the first image of each post?"
731
+ msgstr "Willst du das erste Bild jeden Beitrags als Beitragsbild setzen?"
732
+
733
+ #: admin/views/section_defaults.php:16
734
+ msgid "matches"
735
+ msgstr "ist"
736
+
737
+ #: admin/views/section_defaults.php:18
738
+ msgid "Post type"
739
+ msgstr "Inhaltstyp"
740
+
741
+ #: admin/views/section_defaults.php:19
742
+ msgid "Taxonomy"
743
+ msgstr "Taxonomie"
744
+
745
+ #: admin/views/section_defaults.php:174
746
+ msgid "Default featured images for future posts"
747
+ msgstr "Standard-Beitragsbilder für zukünftige Inhalte"
748
+
749
+ #: admin/views/section_defaults.php:175
750
+ msgid ""
751
+ "Define the rules to use images as default featured images automatically "
752
+ "every time a post is saved."
753
+ msgstr ""
754
+ "Stelle die Regeln ein, um bei jedem Speichern eines Beitrags Bilder als "
755
+ "voreingestellte Beitragsbilder automatisch zu setzen."
756
+
757
+ #: admin/views/section_defaults.php:176
758
+ msgid ""
759
+ "To use a rule choose the image and set both the taxonomy and the value. A "
760
+ "rule which is defined only partially will be ignored."
761
+ msgstr ""
762
+ "Definiere eine Regel, indem du sowohl ein Bild auswählst als auch eine "
763
+ "Taxonomie und einen Wert. Eine unvollständig angegebene Regel wird ignoriert."
764
+
765
+ #: admin/views/section_defaults.php:179
766
+ msgid "Are you sure to remove this rule?"
767
+ msgstr "Willst du diese Regel wirklich löschen?"
768
+
769
+ #: admin/views/section_defaults.php:193
770
+ msgid "An image overwrites an existing image"
771
+ msgstr "Ein Bild überschreibt ein bestehendes Bild"
772
+
773
+ #: admin/views/section_defaults.php:196
774
+ msgid ""
775
+ "If activated the rule is used automatically while saving a post to overwrite "
776
+ "an existing featured image with the new one based on the following rules. Do "
777
+ "not use this if you want to keep manually set featured images."
778
+ msgstr ""
779
+ "Falls aktiviert, wird die Regel automatisch beim Speichern eines Beitrags "
780
+ "angewandt, um ein bestehendes Beitragsbild mit einem neuen auf Grundlage der "
781
+ "folgenden Regeln zu überschreiben. Verwende diese Option nicht, wenn du "
782
+ "manuell gesetzte Beitragsbilder beibehalten willst."
783
+
784
+ #: admin/views/section_defaults.php:202
785
+ msgid ""
786
+ "Activate to automatically overwrite an existing featured image while saving "
787
+ "a post"
788
+ msgstr ""
789
+ "Überschreibe ein bestehendes Beitragsbild automatisch beim Speichern eines "
790
+ "Beitrags"
791
+
792
+ #: admin/views/section_defaults.php:209
793
+ msgid "Text with images in WordPress editor"
794
+ msgstr "Text mit Bildern im WordPress-Editor"
795
+
796
+ #: admin/views/section_defaults.php:212
797
+ msgid ""
798
+ "If activated the rule is used automatically while saving a post to set the "
799
+ "first content image as the featured image of the post. If the post has no "
800
+ "content images the next rules will be applied."
801
+ msgstr ""
802
+ "Falls aktiviert, wird die Regel beim Speichern eines Beitrags automatisch "
803
+ "angewandt, um das erste Bild im Inhalt als Beitragsbild des Beitrags zu "
804
+ "setzen. Sollte der Inhalt kein Bild enthalten, werden die nächsten Regeln "
805
+ "angewandt."
806
+
807
+ #: admin/views/section_defaults.php:218
808
+ msgid ""
809
+ "Activate to automatically use the first content image as featured image "
810
+ "while saving a post"
811
+ msgstr ""
812
+ "Verwende erstes Inhaltsbild als Beitragsbild automatisch beim Speichern "
813
+ "eines Beitrags"
814
+
815
+ #: admin/views/section_defaults.php:409
816
+ msgid "Add rule"
817
+ msgstr "Regel hinzufügen"
818
+
819
+ #: admin/views/section_defaults.php:414
820
+ msgid "How the rules work"
821
+ msgstr "Wie die Regeln funktionieren"
822
+
823
+ #: admin/views/section_defaults.php:415
824
+ msgid ""
825
+ "Every time you save a post the post get the featured image if one of the "
826
+ "following rules match a property of the post. You can also set rules for "
827
+ "pages and all other current post types which support featured images."
828
+ msgstr ""
829
+ "Jedesmal, wenn du einen Beitrag speicherst, erhält der Beitrag das "
830
+ "Beitragsbild, falls eine der folgenden Regeln auf eine seiner Eigenschaften "
831
+ "zutrifft. Du kannst die Regeln auch für Seiten und alle anderen "
832
+ "Inhaltstypen, die Beitragsbilder unterstützen, setzen."
833
+
834
+ #: admin/views/section_defaults.php:416
835
+ msgid ""
836
+ "Regardless of the order in the list the rules are applied in the following "
837
+ "order until a rule and a property of the post fit together:"
838
+ msgstr ""
839
+ "Unabhängig von der Reihenfolge in der Liste werden die Regeln nach folgender "
840
+ "Reihenfolge angewandt, bis eine Regel und eine Eigenschaft des Beitrags "
841
+ "übereinstimmen:"
842
+
843
+ #: admin/views/section_defaults.php:418
844
+ msgid "found first content image. If not then..."
845
+ msgstr "erstes gefundenes Bild im Beitrag. Wenn nicht, dann..."
846
+
847
+ #: admin/views/section_defaults.php:419
848
+ msgid "matched custom taxonomy. If not then..."
849
+ msgstr "passende eigene Taxonomie. Wenn nicht, dann..."
850
+
851
+ #: admin/views/section_defaults.php:420
852
+ msgid "matched tag. If not then..."
853
+ msgstr "passendes Schlagwort. Wenn nicht, dann..."
854
+
855
+ #: admin/views/section_defaults.php:421
856
+ msgid "matched category. If not then..."
857
+ msgstr "passende Kategorie. Wenn nicht, dann..."
858
+
859
+ #: admin/views/section_defaults.php:422
860
+ msgid "matched author. If not then..."
861
+ msgstr "passender Autor. Wenn nicht, dann..."
862
+
863
+ #: admin/views/section_defaults.php:423
864
+ msgid "matched post type. If not then..."
865
+ msgstr "passender Inhaltstyp. Wenn nicht, dann..."
866
+
867
+ #: admin/views/section_defaults.php:424
868
+ msgid "no featured image."
869
+ msgstr "kein Beitragsbild."
870
+
871
+ #: admin/views/section_defaults.php:426
872
+ msgid ""
873
+ "Bear in mind that if two or more rules with the same taxonomy would fit to "
874
+ "the post it is unforeseeable which image will become the featured image."
875
+ msgstr ""
876
+ "Behalte im Hinterkopf, dass falls zwei oder mehr Regeln derselben Taxonomie "
877
+ "zu einen Beitrag passen sollten, es nicht voraussagbar ist, welches Bild zum "
878
+ "Beitragsbild wird."
879
+
880
+ #: admin/views/section_errormsg.php:1
881
+ msgid "Error"
882
+ msgstr "Fehler"
883
+
884
+ #: admin/views/section_errormsg.php:3
885
+ msgid "Reason"
886
+ msgstr "Grund"
887
+
888
+ #: admin/views/section_errormsg.php:5
889
+ msgid "Solution"
890
+ msgstr "Lösung"
891
+
892
+ #: admin/views/section_footer.php:52
893
+ msgid "Credits and informations"
894
+ msgstr "Danksagungen und Hinweise"
895
+
896
+ #: admin/views/section_footer.php:54 admin/views/section_results.php:78
897
+ msgid "Do you like the plugin?"
898
+ msgstr "Gefällt dir das Plugin?"
899
+
900
+ #: admin/views/section_footer.php:54 admin/views/section_results.php:79
901
+ msgid "Please rate it at wordpress.org!"
902
+ msgstr "Bewerte es auf wordpress.org!"
903
+
904
+ #: admin/views/section_footer.php:55
905
+ msgid ""
906
+ "The plugin is for free. But the plugin author would be delighted to your "
907
+ "small contribution."
908
+ msgstr ""
909
+ "Das Plugin ist kostenlos. Doch der Plugin-Autor würde sich über einen Obolus "
910
+ "freuen."
911
+
912
+ #: admin/views/section_footer.php:55
913
+ msgid "Donation Button"
914
+ msgstr "Spendenschaltfläche"
915
+
916
+ #: admin/views/section_footer.php:55
917
+ msgid "Donate by PayPal"
918
+ msgstr "Mittels PayPal spenden"
919
+
920
+ #: admin/views/section_footer.php:56
921
+ msgid "Do you need support or have an idea for the plugin?"
922
+ msgstr "Brauchst du Unterstützung oder hast du eine Idee zum Plugin?"
923
+
924
+ #: admin/views/section_footer.php:56
925
+ msgid ""
926
+ "Post your questions and ideas about Quick Featured Images in the forum at "
927
+ "wordpress.org!"
928
+ msgstr ""
929
+ "Füge deine Fragen und Ideen zum Quick Featured Images im Forum auf wordpress."
930
+ "org hinzu."
931
+
932
+ #: admin/views/section_footer.php:57
933
+ msgid "Special thanks for the fine frontend style of the plugin go to"
934
+ msgstr "Besonderen Dank für das schöne Design des Plugins geht an"
935
+
936
+ #: admin/views/section_footer.php:58
937
+ msgid ""
938
+ "Let the thumbnails appear in the widget of the most recent posts with this "
939
+ "fast plugin"
940
+ msgstr ""
941
+ "Zeige die Vorschaubilder im Widget Letzte Beiträge an mit diesem schnellen "
942
+ "Plugin"
943
+
944
+ #: admin/views/section_footer.php:58
945
+ #, php-format
946
+ msgid "Download plugin %s at %s!"
947
+ msgstr "Lade Plugin %s von %s herunter!"
948
+
949
+ #: admin/views/section_header_progress.php:15
950
+ msgid "Progress bar"
951
+ msgstr "Fortschrittsanzeige"
952
+
953
+ #: admin/views/section_header_progress.php:17
954
+ msgid "You are here"
955
+ msgstr "Du bist hier"
956
+
957
+ #: admin/views/section_image.php:1
958
+ msgid "Your selection"
959
+ msgstr "Deine Auswahl"
960
+
961
+ #: admin/views/section_image.php:9
962
+ msgid "Your selected thumbnail"
963
+ msgstr "Dein ausgewähltes Vorschaubild"
964
+
965
+ #: admin/views/section_image.php:12
966
+ msgid "Image title"
967
+ msgstr "Bildtitel"
968
+
969
+ #: admin/views/section_image.php:14 admin/views/section_image.php:36
970
+ msgid "If wrong image start again"
971
+ msgstr "Falsches Bild? Beginne neu"
972
+
973
+ #: admin/views/section_image.php:23
974
+ msgid "Your selected thumbnails"
975
+ msgstr "Deine ausgewählten Vorschaubilder"
976
+
977
+ #: admin/views/section_image.php:41
978
+ msgid "Your selected action"
979
+ msgstr "Deine ausgewählte Aktion"
980
+
981
+ #: admin/views/section_image.php:54
982
+ msgid "If wrong action start again"
983
+ msgstr "Falsche Aktion? Beginne neu"
984
+
985
+ #: admin/views/section_image.php:67
986
+ msgid "Your selected options"
987
+ msgstr "Deine ausgewählten Optionen"
988
+
989
+ #: admin/views/section_image.php:83
990
+ msgid "No selected options"
991
+ msgstr "Keine ausgewählten Optionen"
992
+
993
+ #: admin/views/section_image.php:89
994
+ msgid "Your selected filters"
995
+ msgstr "Deine ausgewählten Filter"
996
+
997
+ #: admin/views/section_image.php:105
998
+ msgid "No selected filters"
999
+ msgstr "Keine ausgewählten Filter"
1000
+
1001
+ #: admin/views/section_overview.php:17
1002
+ msgid "Manage featured images in a quick way"
1003
+ msgstr "Verwalte Beitragsbilder auf schnelle Art"
1004
+
1005
+ #: admin/views/section_overview.php:31
1006
+ msgid "Bulk set, replace and remove featured images"
1007
+ msgstr ""
1008
+ "Massenweises Hinzufügen, Ersetzen und Entfernen von Beitragsbildern für "
1009
+ "bestehende Inhalte"
1010
+
1011
+ #: admin/views/section_overview.php:32
1012
+ msgid ""
1013
+ "You have not the privileges to edit others posts. If you want to use this "
1014
+ "page ask your WordPress administrator."
1015
+ msgstr ""
1016
+ "Du hast nicht die Rechte, Beiträge anderer zu bearbeiten. Wenn du diese "
1017
+ "Seite nutzen willst, wende dich an deinen WordPress-Administrator."
1018
+
1019
+ #: admin/views/section_overview.php:48
1020
+ msgid "Set default featured images"
1021
+ msgstr "Setze Standard-Beitragsbilder"
1022
+
1023
+ #: admin/views/section_overview.php:49 admin/views/section_overview.php:66
1024
+ msgid ""
1025
+ "You have not the privileges to manage options. If you want to use this page "
1026
+ "ask your WordPress administrator."
1027
+ msgstr ""
1028
+ "Du hast nicht die Rechte, Einstellungen zu ändern. Wenn du auf diese Seite "
1029
+ "zugreifen willst, wende dich an deinen WordPress-Administrator."
1030
+
1031
+ #: admin/views/section_overview.php:65
1032
+ msgid "Set the visibility of columns of featured images in posts lists"
1033
+ msgstr ""
1034
+ "Stelle die Sichtbarkeit der Spalten für Beitragsbilder in "
1035
+ "Beitragsübersichten ein"
1036
+
1037
+ #: admin/views/section_overview.php:72
1038
+ msgid "The premium version"
1039
+ msgstr "Die Premium-Version"
1040
+
1041
+ #: admin/views/section_results.php:1
1042
+ msgid "Results of the action"
1043
+ msgstr "Ergebnisse der Aktion"
1044
+
1045
+ #: admin/views/section_results.php:8
1046
+ msgid "Changed successfully"
1047
+ msgstr "Erfolgreich geändert"
1048
+
1049
+ #: admin/views/section_results.php:9
1050
+ msgid "Unchanged"
1051
+ msgstr "Nicht geändert"
1052
+
1053
+ #: admin/views/section_results.php:10
1054
+ msgid "Image removed successfully from post"
1055
+ msgstr "Bild wurde erfolgreich aus dem Inhalt entfernt"
1056
+
1057
+ #: admin/views/section_results.php:11
1058
+ msgid "Image not removed from post"
1059
+ msgstr "Bild im Inhalt wurde nicht entfernt"
1060
+
1061
+ #: admin/views/section_results.php:73
1062
+ msgid "No matches found."
1063
+ msgstr "Keine Treffer gefunden."
1064
+
1065
+ #~ msgid "Remove first image from post content"
1066
+ #~ msgstr "Entferne das erstes Bild im Inhalt"
1067
+
1068
+ #~ msgid "Take first gallery image if no content image found"
1069
+ #~ msgstr ""
1070
+ #~ "Nehme das erste Bild in einer Galerie, wenn kein Bild gefunden wurde"
1071
+
1072
+ #~ msgid ""
1073
+ #~ "If no content image could be found in a post try to catch the first image "
1074
+ #~ "in a gallery"
1075
+ #~ msgstr ""
1076
+ #~ "Wenn kein Bild im Inhalt gefunden werden konnte, versuche, das erste Bild "
1077
+ #~ "in einer Galerie zu finden"
1078
+
1079
+ #~ msgid "Do you miss more filters?"
1080
+ #~ msgstr "Vermiss du mehr Filter?"
1081
+
1082
+ #~ msgid "Set the first post image as featured image"
1083
+ #~ msgstr "Füge das zuerst gefundene Bild im Beitrag als Beitragsbild hinzu"
1084
+
1085
+ #~ msgid "Multimedia File Filter"
1086
+ #~ msgstr "Multimedia-Dateienfilter"
1087
+
1088
+ #~ msgid "Status Filter"
1089
+ #~ msgstr "Statusfilter"
1090
+
1091
+ #~ msgid "Search Filter"
1092
+ #~ msgstr "Suchfilter"
1093
+
1094
+ #~ msgid "Time Filter"
1095
+ #~ msgstr "Zeitfilter"
1096
+
1097
+ #~ msgid "Author Filter"
1098
+ #~ msgstr "Autorenfilter"
1099
+
1100
+ #~ msgid "Custom Taxonomy Filter"
1101
+ #~ msgstr "Taxonomienfilter"
1102
+
1103
+ #~ msgid "Featured Image Size Filter"
1104
+ #~ msgstr "Beitragsbildgrößenfilter"
1105
+
1106
+ #~ msgid "Parent Page Filter"
1107
+ #~ msgstr "Elternseitenfilter"
1108
+
1109
+ #~ msgid "Select an author"
1110
+ #~ msgstr "Wähle einen Autor aus"
1111
+
1112
+ #~ msgid "is equal"
1113
+ #~ msgstr "ist gleich"
1114
+
1115
+ #~ msgid "is not equal"
1116
+ #~ msgstr "ist nicht gleich"
1117
+
1118
+ #~ msgid "is greater than"
1119
+ #~ msgstr "ist größer als"
1120
+
1121
+ #~ msgid "is lower than"
1122
+ #~ msgstr "ist kleiner als"
1123
+
1124
+ #~ msgid "contains"
1125
+ #~ msgstr "enthält"
1126
+
1127
+ #~ msgid "Select the custom field to find the associated posts/pages."
1128
+ #~ msgstr ""
1129
+ #~ "Wähle das benutzerdefinierte Feld aus, um die entsprechenden Beiträge/"
1130
+ #~ "Seiten zu finden"
1131
+
1132
+ #~ msgid ""
1133
+ #~ "Optional: Type in the value which will be compared with the value of the "
1134
+ #~ "selected custom field."
1135
+ #~ msgstr ""
1136
+ #~ "Optional: Gebe den Wert ein, der mit dem im ausgewählten "
1137
+ #~ "benutzerdefiniertem Feld verglichen wird"
1138
+
1139
+ #~ msgid ""
1140
+ #~ "Leave it empty if you just want to test the existence of the custom field "
1141
+ #~ "per post/page."
1142
+ #~ msgstr ""
1143
+ #~ "Lasse das Feld leer, wenn du nur auf die Existenz des benutzerdefinierten "
1144
+ #~ "Felds testen willst"
1145
+
1146
+ #~ msgid ""
1147
+ #~ "Optional: Change the operator of the comparison. The default is to "
1148
+ #~ "compare equality with the value you type in the 'value' field."
1149
+ #~ msgstr ""
1150
+ #~ "Optional: Verändere den Operator des Vergleichs. Der Standardwert ist die "
1151
+ #~ "Überprüfung auf Gleicheit mit dem Wert, den du im Feld \"Wert\" "
1152
+ #~ "eingegeben hast."
1153
+
1154
+ #~ msgid "There are no custom fields in use."
1155
+ #~ msgstr "Zur Zeit werden keine benutzerdefinierte Felder genutzt."
1156
+
1157
+ #~ msgid "Registered terms of the taxonomy <strong>%s</strong>"
1158
+ #~ msgstr "Gespeicherte Begriffe der Taxonomie <strong>%s</strong>"
1159
+
1160
+ #~ msgid "There are no terms of the taxonomy <strong>%s</strong>."
1161
+ #~ msgstr "Es gibt keine Begriffe für die Taxonomie <strong>\"%s\"</strong>."
1162
+
1163
+ #~ msgid "Strange search result with custom taxonomies?"
1164
+ #~ msgstr "Überraschendes Suchergebnis mit Taxonomien?"
1165
+
1166
+ #~ msgid ""
1167
+ #~ "The search for custom taxonomy terms could lead to surprising results. "
1168
+ #~ "The reason is custom taxonomies can be used in many different ways. It is "
1169
+ #~ "not possible to catch them all in one single code expression. If you "
1170
+ #~ "should be unsatisfied with the result try other filters to get the result "
1171
+ #~ "you want."
1172
+ #~ msgstr ""
1173
+ #~ "Die Suche nach Taxonomien kann zu merkwürdigen Ergebnissen führen. Der "
1174
+ #~ "Grund liegt in den vielen Möglichkeiten, Taxonomien zu nutzen. Sie alle "
1175
+ #~ "mit einer einzigen Code-Zeile zu erfassen ist nicht möglich. Solltest du "
1176
+ #~ "mit dem Suchergebnis nicht zufrieden sein, versuche mit den anderen "
1177
+ #~ "Filtern das gewünschte Ergebnis zu erhalten."
1178
+
1179
+ #~ msgid "There are no custom taxonomies."
1180
+ #~ msgstr "Es gibt keine benutzerdefinierten Taxonomien."
1181
+
1182
+ #~ msgid ""
1183
+ #~ "The search will find posts with an already added featured image which its "
1184
+ #~ "original image file is smaller than one of the given dimensions."
1185
+ #~ msgstr ""
1186
+ #~ "Die Suche findet Beiträge mit einem bereits hinzugefügten Beitragsbild, "
1187
+ #~ "dessen originale Bilddatei kleiner als eine der angegebenen Abmessungen "
1188
+ #~ "ist."
1189
+
1190
+ #~ msgid "For example you can search for posts with too small featured images."
1191
+ #~ msgstr "Suche z.B. nach Beiträgen mit zu kleinen Beitragsbildern."
1192
+
1193
+ #~ msgid ""
1194
+ #~ "Only positive integers from %d to %d are allowed. By default the "
1195
+ #~ "thumbnail dimensions as defined in %s are used."
1196
+ #~ msgstr ""
1197
+ #~ "Nur positive ganze Zahlen von %d bis %d sind erlaubt. Standardmäßig "
1198
+ #~ "stehen die unter %s angegebenen Werte für Miniaturbilder."
1199
+
1200
+ #~ msgid "Select multimedia file types"
1201
+ #~ msgstr "Wähle die Multimedia-Dateiart aus"
1202
+
1203
+ #~ msgid ""
1204
+ #~ "You can select two multimedia files types: audios and videos. If you "
1205
+ #~ "check at least one of both all other post types (posts, pages, etc.) will "
1206
+ #~ "be ignored."
1207
+ #~ msgstr ""
1208
+ #~ "Du kannst zwei Multimedia-Dateitypen auswählen: Audios und Videos. Wenn "
1209
+ #~ "du mindestens einen von beiden auswählst, werden alle anderen "
1210
+ #~ "Inhaltstypen (Beiträge, Seiten etc.) ignoriert."
1211
+
1212
+ #~ msgid "Select a parent page"
1213
+ #~ msgstr "Wähle eine übergeordnete Seite aus"
1214
+
1215
+ #~ msgid "There are no pages with child pages."
1216
+ #~ msgstr "Zur Zeit gibt es keine Seite mit Unterseiten."
1217
+
1218
+ #~ msgid "There are no custom post types."
1219
+ #~ msgstr ""
1220
+ #~ "Zur Zeit werden keine eigenen Inhaltstypen (Custom Post Types) genutzt."
1221
+
1222
+ #~ msgid "Type in a search term"
1223
+ #~ msgstr "Gebe einen Suchbegriff ein"
1224
+
1225
+ #~ msgid "Select the statuses of the posts/pages:"
1226
+ #~ msgstr "Wähle die Statusse der Beiträge/Seiten aus"
1227
+
1228
+ #~ msgid "Date range"
1229
+ #~ msgstr "Zeitraum"
1230
+
1231
+ #~ msgid ""
1232
+ #~ "To define a time segment select both the start date and the end date."
1233
+ #~ msgstr ""
1234
+ #~ "Wähle für einen Zeitabschnitt sowohl das Anfangs- als auch das Enddatum "
1235
+ #~ "aus."
1236
+
1237
+ #~ msgid ""
1238
+ #~ "You can also define a time period by selecting only one date as the "
1239
+ #~ "limiting value of the period."
1240
+ #~ msgstr ""
1241
+ #~ "Du kannst auch einen Zeitraum durch die Auswahl nur eines einzigen Datums "
1242
+ #~ "als Grenzwert des Zeitraums setzen."
1243
+
1244
+ #~ msgid "The listed dates are the date of the publication of stored posts."
1245
+ #~ msgstr ""
1246
+ #~ "Die aufgelisteten Zeitpunkte sind die Veröffentlichungstermine der "
1247
+ #~ "gespeicherten Beiträge."
1248
+
1249
+ #~ msgid ""
1250
+ #~ "Search for audios and videos. This filter will ignore all other post "
1251
+ #~ "types automatically."
1252
+ #~ msgstr ""
1253
+ #~ "Suche nach Audios und Videos. Dieser Filter wird automatisch alle anderen "
1254
+ #~ "Inhaltsarten (post types) ignorieren."
1255
+
1256
+ #~ msgid ""
1257
+ #~ "Search by several statuses (published, draft, private etc.). By default "
1258
+ #~ "all statuses will be affected."
1259
+ #~ msgstr ""
1260
+ #~ "Suchen nach Status (veröffentlicht, Entwurf, privat usw.). Standardmäßig "
1261
+ #~ "werden alle Statusse berücksichtigt."
1262
+
1263
+ #~ msgid "Search by search term"
1264
+ #~ msgstr "Suchen mit einem Suchbegriff"
1265
+
1266
+ #~ msgid "Search by time specifications"
1267
+ #~ msgstr "Suchen mit Zeitangaben"
1268
+
1269
+ #~ msgid "Search by author"
1270
+ #~ msgstr "Suchen nach Autor"
1271
+
1272
+ #~ msgid "Search by other taxonomies like plugin categories etc."
1273
+ #~ msgstr ""
1274
+ #~ "Suchen nach weiteren Klassifikationen suchen, z.B. Kategorien eines "
1275
+ #~ "Plugins"
1276
+
1277
+ #~ msgid "Search by original dimensions of added featured image"
1278
+ #~ msgstr "Suchen nach Abmessungen des hinzugefügten Beitragsbildes"
1279
+
1280
+ #~ msgid "Search child pages by parent page"
1281
+ #~ msgstr "Suchen nach untergeordneten Seiten einer übergeordneten Seite"
1282
+
1283
+ #~ msgid "Slim down your navigation menus and make them faster to load"
1284
+ #~ msgstr ""
1285
+ #~ "Verschlanke deine Navigationsmenüs und erhöhe ihre Ladegeschwindigkeit"
languages/quick-featured-images.pot ADDED
@@ -0,0 +1,1074 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2014
2
+ # This file is distributed under the same license as the plugin package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Quick Featured Images\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/plugins/quick-featured-images\n"
7
+ "POT-Creation-Date: 2015-03-16 21:29+0100\n"
8
+ "PO-Revision-Date: 2015-03-16 21:29+0100\n"
9
+ "Language-Team: <m.stehle@gmx.de>\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 1.7.5\n"
14
+ "X-Poedit-KeywordsList: __;_e;_n;_x;esc_html_e;esc_html__;esc_attr_e;"
15
+ "esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_x:1,2c;_n:1,2\n"
16
+ "X-Poedit-Basepath: ../\n"
17
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+
20
+ #: admin/class-quick-featured-images-admin.php:202
21
+ msgid "Your time-saving Swiss Army Knife for featured images: Set, replace and delete them in bulk, set default images, get overview lists."
22
+ msgstr ""
23
+
24
+ #: admin/class-quick-featured-images-admin.php:266
25
+ #, php-format
26
+ msgid "The plugin requires WordPress version %s or higher. Therefore, WordPress did not activate it. If you want to use this plugin update the Wordpress files to the latest version."
27
+ msgstr ""
28
+
29
+ #: admin/class-quick-featured-images-admin.php:472
30
+ #, php-format
31
+ msgid "Welcome to %s! You can find the plugin at %s."
32
+ msgstr ""
33
+
34
+ #: admin/class-quick-featured-images-defaults.php:191
35
+ msgid "Changes saved."
36
+ msgstr ""
37
+
38
+ #: admin/class-quick-featured-images-defaults.php:194
39
+ msgid "No changes were saved."
40
+ msgstr ""
41
+
42
+ #: admin/class-quick-featured-images-defaults.php:231
43
+ msgid "Preset Featured Images"
44
+ msgstr ""
45
+
46
+ #: admin/class-quick-featured-images-defaults.php:242
47
+ msgid "Set default featured images for future posts"
48
+ msgstr ""
49
+
50
+ #: admin/class-quick-featured-images-settings.php:205
51
+ msgid "Image Columns"
52
+ msgstr ""
53
+
54
+ #: admin/class-quick-featured-images-settings.php:216
55
+ msgid "Helpful options for managing featured images"
56
+ msgstr ""
57
+
58
+ #: admin/class-quick-featured-images-settings.php:385
59
+ msgid "Columns for featured images in posts lists"
60
+ msgstr ""
61
+
62
+ #: admin/class-quick-featured-images-settings.php:393
63
+ msgid "Show additional column for featured images in lists of"
64
+ msgstr ""
65
+
66
+ #: admin/class-quick-featured-images-settings.php:398
67
+ msgid "Posts list with image column"
68
+ msgstr ""
69
+
70
+ #: admin/class-quick-featured-images-settings.php:512
71
+ msgid "Activate the checkboxes at each post type to show the extra columns in the post lists."
72
+ msgstr ""
73
+
74
+ #: admin/class-quick-featured-images-settings.php:522
75
+ msgid "The additional columns give you a quick overview about all used featured images for every post. The Featured Image column is sortable."
76
+ msgstr ""
77
+
78
+ #: admin/class-quick-featured-images-tools.php:545
79
+ #, php-format
80
+ msgid "Wrong image ID %d"
81
+ msgstr ""
82
+
83
+ #: admin/class-quick-featured-images-tools.php:653
84
+ msgid "Select"
85
+ msgstr ""
86
+
87
+ #: admin/class-quick-featured-images-tools.php:654
88
+ msgid "Add filter"
89
+ msgstr ""
90
+
91
+ #: admin/class-quick-featured-images-tools.php:655
92
+ msgid "Refine"
93
+ msgstr ""
94
+
95
+ #: admin/class-quick-featured-images-tools.php:656
96
+ msgid "Confirm"
97
+ msgstr ""
98
+
99
+ #: admin/class-quick-featured-images-tools.php:657
100
+ msgid "Perform"
101
+ msgstr ""
102
+
103
+ #: admin/class-quick-featured-images-tools.php:661
104
+ msgid "Set the selected image as new featured image"
105
+ msgstr ""
106
+
107
+ #: admin/class-quick-featured-images-tools.php:662
108
+ msgid "Replace featured images by the selected image"
109
+ msgstr ""
110
+
111
+ #: admin/class-quick-featured-images-tools.php:663
112
+ msgid "Remove the selected image as featured image"
113
+ msgstr ""
114
+
115
+ #: admin/class-quick-featured-images-tools.php:666
116
+ msgid "Remove any image as featured image"
117
+ msgstr ""
118
+
119
+ #: admin/class-quick-featured-images-tools.php:669
120
+ msgid "Set multiple images randomly as featured images"
121
+ msgstr ""
122
+
123
+ #: admin/class-quick-featured-images-tools.php:673
124
+ msgid "Overwrite featured images"
125
+ msgstr ""
126
+
127
+ #: admin/class-quick-featured-images-tools.php:674
128
+ msgid "Consider only posts without any featured image"
129
+ msgstr ""
130
+
131
+ #: admin/class-quick-featured-images-tools.php:678
132
+ msgid "Post Type Filter"
133
+ msgstr ""
134
+
135
+ #: admin/class-quick-featured-images-tools.php:679
136
+ msgid "Category Filter"
137
+ msgstr ""
138
+
139
+ #: admin/class-quick-featured-images-tools.php:680
140
+ msgid "Tag Filter"
141
+ msgstr ""
142
+
143
+ #: admin/class-quick-featured-images-tools.php:692
144
+ msgid "Audio files"
145
+ msgstr ""
146
+
147
+ #: admin/class-quick-featured-images-tools.php:693
148
+ msgid "Video files"
149
+ msgstr ""
150
+
151
+ #: admin/class-quick-featured-images-tools.php:715
152
+ msgid "Start Date"
153
+ msgstr ""
154
+
155
+ #: admin/class-quick-featured-images-tools.php:716
156
+ msgid "End Date"
157
+ msgstr ""
158
+
159
+ #: admin/class-quick-featured-images-tools.php:717
160
+ msgid "Include the posts of the selected dates"
161
+ msgstr ""
162
+
163
+ #: admin/class-quick-featured-images-tools.php:721
164
+ msgid "Custom field name"
165
+ msgstr ""
166
+
167
+ #: admin/class-quick-featured-images-tools.php:722
168
+ msgid "Operator to test with the value in the custom field"
169
+ msgstr ""
170
+
171
+ #: admin/class-quick-featured-images-tools.php:723
172
+ msgid "Custom field value to compare with"
173
+ msgstr ""
174
+
175
+ #: admin/class-quick-featured-images-tools.php:724
176
+ msgid "Custom field type"
177
+ msgstr ""
178
+
179
+ #: admin/class-quick-featured-images-tools.php:730
180
+ msgid "Image width in pixels lower than"
181
+ msgstr ""
182
+
183
+ #: admin/class-quick-featured-images-tools.php:731
184
+ msgid "Image height in pixels lower than"
185
+ msgstr ""
186
+
187
+ #: admin/class-quick-featured-images-tools.php:819
188
+ #, php-format
189
+ msgid "The input field %s is empty."
190
+ msgstr ""
191
+
192
+ #: admin/class-quick-featured-images-tools.php:820
193
+ msgid "Type in a value into the input field."
194
+ msgstr ""
195
+
196
+ #: admin/class-quick-featured-images-tools.php:823
197
+ #, php-format
198
+ msgid "%s is not defined."
199
+ msgstr ""
200
+
201
+ #: admin/class-quick-featured-images-tools.php:824
202
+ msgid "Check how to define the value."
203
+ msgstr ""
204
+
205
+ #: admin/class-quick-featured-images-tools.php:827
206
+ msgid "There is no selected image."
207
+ msgstr ""
208
+
209
+ #: admin/class-quick-featured-images-tools.php:828
210
+ msgid "Select an image from the media library."
211
+ msgstr ""
212
+
213
+ #: admin/class-quick-featured-images-tools.php:831
214
+ #: admin/views/section_image.php:50
215
+ msgid "You have not selected an action."
216
+ msgstr ""
217
+
218
+ #: admin/class-quick-featured-images-tools.php:832
219
+ msgid "Start again and select which action you want to apply."
220
+ msgstr ""
221
+
222
+ #: admin/class-quick-featured-images-tools.php:835
223
+ #, php-format
224
+ msgid "The input field %s has an invalid value."
225
+ msgstr ""
226
+
227
+ #: admin/class-quick-featured-images-tools.php:836
228
+ msgid "Type in valid values in the input field."
229
+ msgstr ""
230
+
231
+ #: admin/class-quick-featured-images-tools.php:840
232
+ msgid "Type in values stored by WordPress."
233
+ msgstr ""
234
+
235
+ #: admin/class-quick-featured-images-tools.php:2276
236
+ msgid "Set, replace, remove"
237
+ msgstr ""
238
+
239
+ #: admin/class-quick-featured-images-tools.php:2287
240
+ msgid "Bulk set, replace and remove featured images for existing posts"
241
+ msgstr ""
242
+
243
+ #: admin/class-quick-featured-images-tools.php:2403
244
+ msgid "Bulk set as featured image"
245
+ msgstr ""
246
+
247
+ #: admin/views/filter_category.php:3
248
+ msgid "Select a category"
249
+ msgstr ""
250
+
251
+ #: admin/views/filter_post_types.php:2
252
+ msgid "Select post types"
253
+ msgstr ""
254
+
255
+ #: admin/views/filter_post_types.php:2
256
+ msgid "You can select posts, pages and available custom posts types."
257
+ msgstr ""
258
+
259
+ #: admin/views/filter_tag.php:7
260
+ msgid "Select a tag"
261
+ msgstr ""
262
+
263
+ #: admin/views/filter_tag.php:20
264
+ msgid "There are no tags in use."
265
+ msgstr ""
266
+
267
+ #: admin/views/form_back_to_selection.php:2
268
+ msgid "Select filters and options again"
269
+ msgstr ""
270
+
271
+ #: admin/views/form_back_to_selection.php:3
272
+ msgid "If you want to change your former selection just go back by clicking on this button."
273
+ msgstr ""
274
+
275
+ #: admin/views/form_back_to_selection.php:42
276
+ msgid "Modify selection"
277
+ msgstr ""
278
+
279
+ #: admin/views/form_confirm.php:4
280
+ msgid "Should the selected image be set as featured image to all listed posts?"
281
+ msgstr ""
282
+
283
+ #: admin/views/form_confirm.php:7
284
+ msgid "Should the selected images be set randomly as featured images to all listed posts?"
285
+ msgstr ""
286
+
287
+ #: admin/views/form_confirm.php:10
288
+ msgid "Should the current set featured image be replaced by the selected image at all listed posts?"
289
+ msgstr ""
290
+
291
+ #: admin/views/form_confirm.php:13
292
+ msgid "Should the selected image be removed from all listed posts?"
293
+ msgstr ""
294
+
295
+ #: admin/views/form_confirm.php:16
296
+ msgid "Should the future images be set as featured images at all listed posts?"
297
+ msgstr ""
298
+
299
+ #: admin/views/form_confirm.php:19
300
+ msgid "Should the added featured images be removed from all listed posts?"
301
+ msgstr ""
302
+
303
+ #: admin/views/form_confirm.php:24
304
+ msgid "Preview of your selection"
305
+ msgstr ""
306
+
307
+ #: admin/views/form_confirm.php:25
308
+ #, php-format
309
+ msgid "%d matches found"
310
+ msgstr ""
311
+
312
+ #: admin/views/form_confirm.php:29 admin/views/section_results.php:5
313
+ msgid "Details"
314
+ msgstr ""
315
+
316
+ #: admin/views/form_confirm.php:30 admin/views/section_defaults.php:17
317
+ #: admin/views/section_results.php:7
318
+ msgid "No."
319
+ msgstr ""
320
+
321
+ #: admin/views/form_confirm.php:31 admin/views/section_results.php:6
322
+ msgid "Current Featured Image"
323
+ msgstr ""
324
+
325
+ #: admin/views/form_confirm.php:32
326
+ msgid "Future Featured Image"
327
+ msgstr ""
328
+
329
+ #: admin/views/form_confirm.php:33
330
+ msgid "written on"
331
+ msgstr ""
332
+
333
+ #: admin/views/form_confirm.php:34
334
+ msgid "by"
335
+ msgstr ""
336
+
337
+ #: admin/views/form_confirm.php:48 admin/views/section_results.php:18
338
+ msgid "The list is in alphabetical order according to post title. You can edit a post in a new window by clicking on its link in the list."
339
+ msgstr ""
340
+
341
+ #: admin/views/form_confirm.php:111
342
+ msgid "Confirm the change"
343
+ msgstr ""
344
+
345
+ #: admin/views/form_confirm.php:112
346
+ msgid "You can not undo the operation!"
347
+ msgstr ""
348
+
349
+ #: admin/views/form_confirm.php:229 admin/views/form_select.php:47
350
+ #: admin/views/section_errormsg.php:8 admin/views/section_results.php:77
351
+ msgid "Start again"
352
+ msgstr ""
353
+
354
+ #: admin/views/form_confirm.php:229
355
+ msgid "or refine your selection with the following form fields."
356
+ msgstr ""
357
+
358
+ #: admin/views/form_refine.php:1
359
+ msgid "Refine your selection"
360
+ msgstr ""
361
+
362
+ #: admin/views/form_refine.php:8
363
+ msgid "Refine filters"
364
+ msgstr ""
365
+
366
+ #: admin/views/form_refine.php:9
367
+ msgid "Now you can find posts and pages by matching parameters. Refine them here."
368
+ msgstr ""
369
+
370
+ #: admin/views/form_refine.php:10
371
+ msgid "Whatever you do: You can confirm your choice on the next page."
372
+ msgstr ""
373
+
374
+ #: admin/views/form_refine.php:18
375
+ #, php-format
376
+ msgid "File %s is not available."
377
+ msgstr ""
378
+
379
+ #: admin/views/form_refine.php:48 admin/views/form_select.php:40
380
+ msgid "Preview filtering"
381
+ msgstr ""
382
+
383
+ #: admin/views/form_refine.php:54
384
+ msgid "There are no selected filters. Modify your filter selection or just go on by clicking on the next button."
385
+ msgstr ""
386
+
387
+ #: admin/views/form_select.php:11 admin/views/form_start.php:4
388
+ #: admin/views/section_defaults.php:167
389
+ msgid "Notice"
390
+ msgstr ""
391
+
392
+ #: admin/views/form_select.php:13
393
+ msgid "You did not have selected an image from the list below. To go on select at least one image you want to replace by the selected image."
394
+ msgstr ""
395
+
396
+ #: admin/views/form_select.php:18
397
+ msgid "Select the featured images you want to replace by the selected image."
398
+ msgstr ""
399
+
400
+ #: admin/views/form_select.php:19
401
+ msgid "You can select multiple images. Select at least one image."
402
+ msgstr ""
403
+
404
+ #: admin/views/form_select.php:46
405
+ msgid "There are no featured images in use."
406
+ msgstr ""
407
+
408
+ #: admin/views/form_select.php:55
409
+ msgid "Refine your selections"
410
+ msgstr ""
411
+
412
+ #: admin/views/form_select.php:62
413
+ msgid "Optional: Select options"
414
+ msgstr ""
415
+
416
+ #: admin/views/form_select.php:64
417
+ msgid "Process Options"
418
+ msgstr ""
419
+
420
+ #: admin/views/form_select.php:65
421
+ msgid "You can control the process with the following options."
422
+ msgstr ""
423
+
424
+ #: admin/views/form_select.php:69
425
+ msgid "Overwrite existing featured images with new ones"
426
+ msgstr ""
427
+
428
+ #: admin/views/form_select.php:78
429
+ msgid "Posts with featured images will be ignored, even if the Overwrite option is checked "
430
+ msgstr ""
431
+
432
+ #: admin/views/form_select.php:89
433
+ msgid "Optional: Add a filter"
434
+ msgstr ""
435
+
436
+ #: admin/views/form_select.php:91
437
+ msgid "Select filters"
438
+ msgstr ""
439
+
440
+ #: admin/views/form_select.php:92
441
+ msgid "If you want select one of the following filters to narrow down the set of concerned posts and pages."
442
+ msgstr ""
443
+
444
+ #: admin/views/form_select.php:93
445
+ msgid "You can select multiple filters. They will return an intersection of their results."
446
+ msgstr ""
447
+
448
+ #: admin/views/form_select.php:98
449
+ msgid "Search by post type. By default all posts, pages and custom post types will be affected."
450
+ msgstr ""
451
+
452
+ #: admin/views/form_select.php:101
453
+ msgid "Search posts by category"
454
+ msgstr ""
455
+
456
+ #: admin/views/form_select.php:104
457
+ msgid "Search posts by tag"
458
+ msgstr ""
459
+
460
+ #: admin/views/form_select.php:118 admin/views/section_overview.php:74
461
+ msgid "Are you looking for more options and more filters?"
462
+ msgstr ""
463
+
464
+ #: admin/views/form_select.php:118 admin/views/form_select.php:140
465
+ #: admin/views/form_start.php:107 admin/views/section_footer.php:59
466
+ #: admin/views/section_overview.php:74
467
+ msgid "Get the premium version"
468
+ msgstr ""
469
+
470
+ # Path to language site
471
+ #: admin/views/form_select.php:118 admin/views/form_select.php:140
472
+ #: admin/views/form_start.php:107 admin/views/section_footer.php:59
473
+ #: admin/views/section_overview.php:73 admin/views/section_overview.php:74
474
+ msgid "/"
475
+ msgstr ""
476
+
477
+ #: admin/views/form_select.php:119
478
+ msgid "On the next page you can refine the filters. If you did not select any filter you will go to the preview list directly."
479
+ msgstr ""
480
+
481
+ #: admin/views/form_select.php:137
482
+ msgid "If you encounter a white, blank page, read this"
483
+ msgstr ""
484
+
485
+ #: admin/views/form_select.php:138
486
+ msgid "Facing a white blank page while trying to treat thousands of posts is the effect of limited memory capacities on the website server. Instead of treating a huge amount of posts in one single go try to treat small amounts of posts multiple times successively. To achieve that do:"
487
+ msgstr ""
488
+
489
+ #: admin/views/form_select.php:141
490
+ msgid "add the time filter,"
491
+ msgstr ""
492
+
493
+ #: admin/views/form_select.php:142
494
+ msgid "set a small time range,"
495
+ msgstr ""
496
+
497
+ #: admin/views/form_select.php:143
498
+ msgid "do the process"
499
+ msgstr ""
500
+
501
+ #: admin/views/form_select.php:144
502
+ msgid "and repeat it with the next time range as often as needed."
503
+ msgstr ""
504
+
505
+ #: admin/views/form_select.php:146
506
+ msgid "This way is not as fast as one single run, but still much faster than setting the images for each post manually."
507
+ msgstr ""
508
+
509
+ #: admin/views/form_start.php:6 admin/views/section_defaults.php:169
510
+ msgid "The current theme does not support featured images. Anyway you can use this plugin. The effects are stored and will be visible in a theme which supports featured images."
511
+ msgstr ""
512
+
513
+ #: admin/views/form_start.php:12
514
+ msgid "What do you want to do?"
515
+ msgstr ""
516
+
517
+ #: admin/views/form_start.php:13
518
+ msgid "Here you can add, replace and delete featured images to your posts. Select one of the following actions and, if necessary, one or more images."
519
+ msgstr ""
520
+
521
+ #: admin/views/form_start.php:14
522
+ msgid "Whatever you select: You can refine your choice on the next page."
523
+ msgstr ""
524
+
525
+ #: admin/views/form_start.php:15
526
+ msgid "Important advice"
527
+ msgstr ""
528
+
529
+ #: admin/views/form_start.php:16
530
+ msgid "There is no undo function! It is strongly recommended that you make a backup of the WordPress database before you perform mass changes."
531
+ msgstr ""
532
+
533
+ #: admin/views/form_start.php:18
534
+ msgid "Select action"
535
+ msgstr ""
536
+
537
+ #: admin/views/form_start.php:19
538
+ msgid "Actions with a single image"
539
+ msgstr ""
540
+
541
+ #: admin/views/form_start.php:20
542
+ msgid "These actions require to select an image with the following button."
543
+ msgstr ""
544
+
545
+ #: admin/views/form_start.php:33
546
+ msgid "Select the image you want to add to, replace or delete from posts and pages by clicking on the following button."
547
+ msgstr ""
548
+
549
+ #: admin/views/form_start.php:54 admin/views/section_defaults.php:20
550
+ msgid "Choose Image"
551
+ msgstr ""
552
+
553
+ #: admin/views/form_start.php:58
554
+ msgid "If the button does not work, read this:"
555
+ msgstr ""
556
+
557
+ #: admin/views/form_start.php:59
558
+ msgid "Some users reported that this button would not work in some WordPress installations. If this should be the case you can take another way:"
559
+ msgstr ""
560
+
561
+ #: admin/views/form_start.php:60
562
+ msgid "1. Go to the media library. 2. Move the mouse over the desired image. Further links are appearing, among them the link &quot;Bulk set as featured image&quot;. 3. After a click on it you can move on in this plugin."
563
+ msgstr ""
564
+
565
+ #: admin/views/form_start.php:64
566
+ msgid "Actions with multiple images"
567
+ msgstr ""
568
+
569
+ #: admin/views/form_start.php:65
570
+ msgid "These actions require at least one selected image with the following button."
571
+ msgstr ""
572
+
573
+ #: admin/views/form_start.php:77
574
+ msgid "To select multiple images click on the button and use the CTRL key while clicking on the images."
575
+ msgstr ""
576
+
577
+ #: admin/views/form_start.php:79
578
+ msgid "Choose Images"
579
+ msgstr ""
580
+
581
+ #: admin/views/form_start.php:95
582
+ msgid "Actions without any image"
583
+ msgstr ""
584
+
585
+ #: admin/views/form_start.php:96
586
+ msgid "These actions do not require a selected image."
587
+ msgstr ""
588
+
589
+ #: admin/views/form_start.php:107
590
+ msgid "Do you want to assign the first image of each post?"
591
+ msgstr ""
592
+
593
+ #: admin/views/section_defaults.php:16
594
+ msgid "matches"
595
+ msgstr ""
596
+
597
+ #: admin/views/section_defaults.php:18
598
+ msgid "Post type"
599
+ msgstr ""
600
+
601
+ #: admin/views/section_defaults.php:19
602
+ msgid "Taxonomy"
603
+ msgstr ""
604
+
605
+ #: admin/views/section_defaults.php:174
606
+ msgid "Default featured images for future posts"
607
+ msgstr ""
608
+
609
+ #: admin/views/section_defaults.php:175
610
+ msgid "Define the rules to use images as default featured images automatically every time a post is saved."
611
+ msgstr ""
612
+
613
+ #: admin/views/section_defaults.php:176
614
+ msgid "To use a rule choose the image and set both the taxonomy and the value. A rule which is defined only partially will be ignored."
615
+ msgstr ""
616
+
617
+ #: admin/views/section_defaults.php:179
618
+ msgid "Are you sure to remove this rule?"
619
+ msgstr ""
620
+
621
+ #: admin/views/section_defaults.php:193
622
+ msgid "An image overwrites an existing image"
623
+ msgstr ""
624
+
625
+ #: admin/views/section_defaults.php:196
626
+ msgid "If activated the rule is used automatically while saving a post to overwrite an existing featured image with the new one based on the following rules. Do not use this if you want to keep manually set featured images."
627
+ msgstr ""
628
+
629
+ #: admin/views/section_defaults.php:202
630
+ msgid "Activate to automatically overwrite an existing featured image while saving a post"
631
+ msgstr ""
632
+
633
+ #: admin/views/section_defaults.php:209
634
+ msgid "Text with images in WordPress editor"
635
+ msgstr ""
636
+
637
+ #: admin/views/section_defaults.php:212
638
+ msgid "If activated the rule is used automatically while saving a post to set the first content image as the featured image of the post. If the post has no content images the next rules will be applied."
639
+ msgstr ""
640
+
641
+ #: admin/views/section_defaults.php:218
642
+ msgid "Activate to automatically use the first content image as featured image while saving a post"
643
+ msgstr ""
644
+
645
+ #: admin/views/section_defaults.php:409
646
+ msgid "Add rule"
647
+ msgstr ""
648
+
649
+ #: admin/views/section_defaults.php:414
650
+ msgid "How the rules work"
651
+ msgstr ""
652
+
653
+ #: admin/views/section_defaults.php:415
654
+ msgid "Every time you save a post the post get the featured image if one of the following rules match a property of the post. You can also set rules for pages and all other current post types which support featured images."
655
+ msgstr ""
656
+
657
+ #: admin/views/section_defaults.php:416
658
+ msgid "Regardless of the order in the list the rules are applied in the following order until a rule and a property of the post fit together:"
659
+ msgstr ""
660
+
661
+ #: admin/views/section_defaults.php:418
662
+ msgid "found first content image. If not then..."
663
+ msgstr ""
664
+
665
+ #: admin/views/section_defaults.php:419
666
+ msgid "matched custom taxonomy. If not then..."
667
+ msgstr ""
668
+
669
+ #: admin/views/section_defaults.php:420
670
+ msgid "matched tag. If not then..."
671
+ msgstr ""
672
+
673
+ #: admin/views/section_defaults.php:421
674
+ msgid "matched category. If not then..."
675
+ msgstr ""
676
+
677
+ #: admin/views/section_defaults.php:422
678
+ msgid "matched author. If not then..."
679
+ msgstr ""
680
+
681
+ #: admin/views/section_defaults.php:423
682
+ msgid "matched post type. If not then..."
683
+ msgstr ""
684
+
685
+ #: admin/views/section_defaults.php:424
686
+ msgid "no featured image."
687
+ msgstr ""
688
+
689
+ #: admin/views/section_defaults.php:426
690
+ msgid "Bear in mind that if two or more rules with the same taxonomy would fit to the post it is unforeseeable which image will become the featured image."
691
+ msgstr ""
692
+
693
+ #: admin/views/section_errormsg.php:1
694
+ msgid "Error"
695
+ msgstr ""
696
+
697
+ #: admin/views/section_errormsg.php:3
698
+ msgid "Reason"
699
+ msgstr ""
700
+
701
+ #: admin/views/section_errormsg.php:5
702
+ msgid "Solution"
703
+ msgstr ""
704
+
705
+ #: admin/views/section_footer.php:52
706
+ msgid "Credits and informations"
707
+ msgstr ""
708
+
709
+ #: admin/views/section_footer.php:54 admin/views/section_results.php:78
710
+ msgid "Do you like the plugin?"
711
+ msgstr ""
712
+
713
+ #: admin/views/section_footer.php:54 admin/views/section_results.php:79
714
+ msgid "Please rate it at wordpress.org!"
715
+ msgstr ""
716
+
717
+ #: admin/views/section_footer.php:55
718
+ msgid "The plugin is for free. But the plugin author would be delighted to your small contribution."
719
+ msgstr ""
720
+
721
+ #: admin/views/section_footer.php:55
722
+ msgid "Donation Button"
723
+ msgstr ""
724
+
725
+ #: admin/views/section_footer.php:55
726
+ msgid "Donate by PayPal"
727
+ msgstr ""
728
+
729
+ #: admin/views/section_footer.php:56
730
+ msgid "Do you need support or have an idea for the plugin?"
731
+ msgstr ""
732
+
733
+ #: admin/views/section_footer.php:56
734
+ msgid "Post your questions and ideas about Quick Featured Images in the forum at wordpress.org!"
735
+ msgstr ""
736
+
737
+ #: admin/views/section_footer.php:57
738
+ msgid "Special thanks for the fine frontend style of the plugin go to"
739
+ msgstr ""
740
+
741
+ #: admin/views/section_footer.php:58
742
+ msgid "Let the thumbnails appear in the widget of the most recent posts with this fast plugin"
743
+ msgstr ""
744
+
745
+ #: admin/views/section_footer.php:58
746
+ #, php-format
747
+ msgid "Download plugin %s at %s!"
748
+ msgstr ""
749
+
750
+ #: admin/views/section_header_progress.php:15
751
+ msgid "Progress bar"
752
+ msgstr ""
753
+
754
+ #: admin/views/section_header_progress.php:17
755
+ msgid "You are here"
756
+ msgstr ""
757
+
758
+ #: admin/views/section_image.php:1
759
+ msgid "Your selection"
760
+ msgstr ""
761
+
762
+ #: admin/views/section_image.php:9
763
+ msgid "Your selected thumbnail"
764
+ msgstr ""
765
+
766
+ #: admin/views/section_image.php:12
767
+ msgid "Image title"
768
+ msgstr ""
769
+
770
+ #: admin/views/section_image.php:14 admin/views/section_image.php:36
771
+ msgid "If wrong image start again"
772
+ msgstr ""
773
+
774
+ #: admin/views/section_image.php:23
775
+ msgid "Your selected thumbnails"
776
+ msgstr ""
777
+
778
+ #: admin/views/section_image.php:41
779
+ msgid "Your selected action"
780
+ msgstr ""
781
+
782
+ #: admin/views/section_image.php:54
783
+ msgid "If wrong action start again"
784
+ msgstr ""
785
+
786
+ #: admin/views/section_image.php:67
787
+ msgid "Your selected options"
788
+ msgstr ""
789
+
790
+ #: admin/views/section_image.php:83
791
+ msgid "No selected options"
792
+ msgstr ""
793
+
794
+ #: admin/views/section_image.php:89
795
+ msgid "Your selected filters"
796
+ msgstr ""
797
+
798
+ #: admin/views/section_image.php:105
799
+ msgid "No selected filters"
800
+ msgstr ""
801
+
802
+ #: admin/views/section_overview.php:17
803
+ msgid "Manage featured images in a quick way"
804
+ msgstr ""
805
+
806
+ #: admin/views/section_overview.php:31
807
+ msgid "Bulk set, replace and remove featured images"
808
+ msgstr ""
809
+
810
+ #: admin/views/section_overview.php:32
811
+ msgid "You have not the privileges to edit others posts. If you want to use this page ask your WordPress administrator."
812
+ msgstr ""
813
+
814
+ #: admin/views/section_overview.php:48
815
+ msgid "Set default featured images"
816
+ msgstr ""
817
+
818
+ #: admin/views/section_overview.php:49 admin/views/section_overview.php:66
819
+ msgid "You have not the privileges to manage options. If you want to use this page ask your WordPress administrator."
820
+ msgstr ""
821
+
822
+ #: admin/views/section_overview.php:65
823
+ msgid "Set the visibility of columns of featured images in posts lists"
824
+ msgstr ""
825
+
826
+ #: admin/views/section_overview.php:72
827
+ msgid "The premium version"
828
+ msgstr ""
829
+
830
+ #: admin/views/section_results.php:1
831
+ msgid "Results of the action"
832
+ msgstr ""
833
+
834
+ #: admin/views/section_results.php:8
835
+ msgid "Changed successfully"
836
+ msgstr ""
837
+
838
+ #: admin/views/section_results.php:9
839
+ msgid "Unchanged"
840
+ msgstr ""
841
+
842
+ #: admin/views/section_results.php:10
843
+ msgid "Image removed successfully from post"
844
+ msgstr ""
845
+
846
+ #: admin/views/section_results.php:11
847
+ msgid "Image not removed from post"
848
+ msgstr ""
849
+
850
+ #: admin/views/section_results.php:73
851
+ msgid "No matches found."
852
+ msgstr ""
853
+
854
+ #~ msgid "Remove first image from post content"
855
+ #~ msgstr ""
856
+
857
+ #~ msgid "Take first gallery image if no content image found"
858
+ #~ msgstr ""
859
+ #~ "Nehme das erste Bild in einer Galerie, wenn kein Bild gefunden wurde"
860
+
861
+ #~ msgid ""
862
+ #~ "If no content image could be found in a post try to catch the first image "
863
+ #~ "in a gallery"
864
+ #~ msgstr ""
865
+ #~ "Wenn kein Bild im Inhalt gefunden werden konnte, versuche, das erste Bild "
866
+ #~ "in einer Galerie zu finden"
867
+
868
+ #~ msgid "Do you miss more filters?"
869
+ #~ msgstr ""
870
+
871
+ #~ msgid "Set the first post image as featured image"
872
+ #~ msgstr ""
873
+
874
+ #~ msgid "Multimedia File Filter"
875
+ #~ msgstr ""
876
+
877
+ #~ msgid "Status Filter"
878
+ #~ msgstr ""
879
+
880
+ #~ msgid "Search Filter"
881
+ #~ msgstr ""
882
+
883
+ #~ msgid "Time Filter"
884
+ #~ msgstr ""
885
+
886
+ #~ msgid "Author Filter"
887
+ #~ msgstr ""
888
+
889
+ #~ msgid "Custom Taxonomy Filter"
890
+ #~ msgstr ""
891
+
892
+ #~ msgid "Featured Image Size Filter"
893
+ #~ msgstr ""
894
+
895
+ #~ msgid "Parent Page Filter"
896
+ #~ msgstr ""
897
+
898
+ #~ msgid "Select an author"
899
+ #~ msgstr ""
900
+
901
+ #~ msgid "is equal"
902
+ #~ msgstr ""
903
+
904
+ #~ msgid "is not equal"
905
+ #~ msgstr ""
906
+
907
+ #~ msgid "is greater than"
908
+ #~ msgstr ""
909
+
910
+ #~ msgid "is lower than"
911
+ #~ msgstr ""
912
+
913
+ #~ msgid "contains"
914
+ #~ msgstr ""
915
+
916
+ #~ msgid "Select the custom field to find the associated posts/pages."
917
+ #~ msgstr ""
918
+ #~ "Wähle das benutzerdefinierte Feld aus, um die entsprechenden Beiträge/"
919
+ #~ "Seiten zu finden"
920
+
921
+ #~ msgid ""
922
+ #~ "Optional: Type in the value which will be compared with the value of the "
923
+ #~ "selected custom field."
924
+ #~ msgstr ""
925
+ #~ "Optional: Gebe den Wert ein, der mit dem im ausgewählten "
926
+ #~ "benutzerdefiniertem Feld verglichen wird"
927
+
928
+ #~ msgid ""
929
+ #~ "Leave it empty if you just want to test the existence of the custom field "
930
+ #~ "per post/page."
931
+ #~ msgstr ""
932
+ #~ "Lasse das Feld leer, wenn du nur auf die Existenz des benutzerdefinierten "
933
+ #~ "Felds testen willst"
934
+
935
+ #~ msgid ""
936
+ #~ "Optional: Change the operator of the comparison. The default is to "
937
+ #~ "compare equality with the value you type in the 'value' field."
938
+ #~ msgstr ""
939
+ #~ "Optional: Verändere den Operator des Vergleichs. Der Standardwert ist die "
940
+ #~ "Überprüfung auf Gleicheit mit dem Wert, den du im Feld \"Wert\" "
941
+ #~ "eingegeben hast."
942
+
943
+ #~ msgid "There are no custom fields in use."
944
+ #~ msgstr ""
945
+
946
+ #~ msgid "Registered terms of the taxonomy <strong>%s</strong>"
947
+ #~ msgstr ""
948
+
949
+ #~ msgid "There are no terms of the taxonomy <strong>%s</strong>."
950
+ #~ msgstr ""
951
+
952
+ #~ msgid "Strange search result with custom taxonomies?"
953
+ #~ msgstr ""
954
+
955
+ #~ msgid ""
956
+ #~ "The search for custom taxonomy terms could lead to surprising results. "
957
+ #~ "The reason is custom taxonomies can be used in many different ways. It is "
958
+ #~ "not possible to catch them all in one single code expression. If you "
959
+ #~ "should be unsatisfied with the result try other filters to get the result "
960
+ #~ "you want."
961
+ #~ msgstr ""
962
+ #~ "Die Suche nach Taxonomien kann zu merkwürdigen Ergebnissen führen. Der "
963
+ #~ "Grund liegt in den vielen Möglichkeiten, Taxonomien zu nutzen. Sie alle "
964
+ #~ "mit einer einzigen Code-Zeile zu erfassen ist nicht möglich. Solltest du "
965
+ #~ "mit dem Suchergebnis nicht zufrieden sein, versuche mit den anderen "
966
+ #~ "Filtern das gewünschte Ergebnis zu erhalten."
967
+
968
+ #~ msgid "There are no custom taxonomies."
969
+ #~ msgstr ""
970
+
971
+ #~ msgid ""
972
+ #~ "The search will find posts with an already added featured image which its "
973
+ #~ "original image file is smaller than one of the given dimensions."
974
+ #~ msgstr ""
975
+ #~ "Die Suche findet Beiträge mit einem bereits hinzugefügten Beitragsbild, "
976
+ #~ "dessen originale Bilddatei kleiner als eine der angegebenen Abmessungen "
977
+ #~ "ist."
978
+
979
+ #~ msgid "For example you can search for posts with too small featured images."
980
+ #~ msgstr ""
981
+
982
+ #~ msgid ""
983
+ #~ "Only positive integers from %d to %d are allowed. By default the "
984
+ #~ "thumbnail dimensions as defined in %s are used."
985
+ #~ msgstr ""
986
+ #~ "Nur positive ganze Zahlen von %d bis %d sind erlaubt. Standardmäßig "
987
+ #~ "stehen die unter %s angegebenen Werte für Miniaturbilder."
988
+
989
+ #~ msgid "Select multimedia file types"
990
+ #~ msgstr ""
991
+
992
+ #~ msgid ""
993
+ #~ "You can select two multimedia files types: audios and videos. If you "
994
+ #~ "check at least one of both all other post types (posts, pages, etc.) will "
995
+ #~ "be ignored."
996
+ #~ msgstr ""
997
+ #~ "Du kannst zwei Multimedia-Dateitypen auswählen: Audios und Videos. Wenn "
998
+ #~ "du mindestens einen von beiden auswählst, werden alle anderen "
999
+ #~ "Inhaltstypen (Beiträge, Seiten etc.) ignoriert."
1000
+
1001
+ #~ msgid "Select a parent page"
1002
+ #~ msgstr ""
1003
+
1004
+ #~ msgid "There are no pages with child pages."
1005
+ #~ msgstr ""
1006
+
1007
+ #~ msgid "There are no custom post types."
1008
+ #~ msgstr ""
1009
+ #~ "Zur Zeit werden keine eigenen Inhaltstypen (Custom Post Types) genutzt."
1010
+
1011
+ #~ msgid "Type in a search term"
1012
+ #~ msgstr ""
1013
+
1014
+ #~ msgid "Select the statuses of the posts/pages:"
1015
+ #~ msgstr ""
1016
+
1017
+ #~ msgid "Date range"
1018
+ #~ msgstr ""
1019
+
1020
+ #~ msgid ""
1021
+ #~ "To define a time segment select both the start date and the end date."
1022
+ #~ msgstr ""
1023
+ #~ "Wähle für einen Zeitabschnitt sowohl das Anfangs- als auch das Enddatum "
1024
+ #~ "aus."
1025
+
1026
+ #~ msgid ""
1027
+ #~ "You can also define a time period by selecting only one date as the "
1028
+ #~ "limiting value of the period."
1029
+ #~ msgstr ""
1030
+ #~ "Du kannst auch einen Zeitraum durch die Auswahl nur eines einzigen Datums "
1031
+ #~ "als Grenzwert des Zeitraums setzen."
1032
+
1033
+ #~ msgid "The listed dates are the date of the publication of stored posts."
1034
+ #~ msgstr ""
1035
+ #~ "Die aufgelisteten Zeitpunkte sind die Veröffentlichungstermine der "
1036
+ #~ "gespeicherten Beiträge."
1037
+
1038
+ #~ msgid ""
1039
+ #~ "Search for audios and videos. This filter will ignore all other post "
1040
+ #~ "types automatically."
1041
+ #~ msgstr ""
1042
+ #~ "Suche nach Audios und Videos. Dieser Filter wird automatisch alle anderen "
1043
+ #~ "Inhaltsarten (post types) ignorieren."
1044
+
1045
+ #~ msgid ""
1046
+ #~ "Search by several statuses (published, draft, private etc.). By default "
1047
+ #~ "all statuses will be affected."
1048
+ #~ msgstr ""
1049
+ #~ "Suchen nach Status (veröffentlicht, Entwurf, privat usw.). Standardmäßig "
1050
+ #~ "werden alle Statusse berücksichtigt."
1051
+
1052
+ #~ msgid "Search by search term"
1053
+ #~ msgstr ""
1054
+
1055
+ #~ msgid "Search by time specifications"
1056
+ #~ msgstr ""
1057
+
1058
+ #~ msgid "Search by author"
1059
+ #~ msgstr ""
1060
+
1061
+ #~ msgid "Search by other taxonomies like plugin categories etc."
1062
+ #~ msgstr ""
1063
+ #~ "Suchen nach weiteren Klassifikationen suchen, z.B. Kategorien eines "
1064
+ #~ "Plugins"
1065
+
1066
+ #~ msgid "Search by original dimensions of added featured image"
1067
+ #~ msgstr ""
1068
+
1069
+ #~ msgid "Search child pages by parent page"
1070
+ #~ msgstr ""
1071
+
1072
+ #~ msgid "Slim down your navigation menus and make them faster to load"
1073
+ #~ msgstr ""
1074
+ #~ "Verschlanke deine Navigationsmenüs und erhöhe ihre Ladegeschwindigkeit"
quick-featured-images.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Quick_Featured_Images_Admin
4
+ * @author Martin Stehle <m.stehle@gmx.de>
5
+ * @license GPL-2.0+
6
+ * @link http://stehle-internet.de/
7
+ * @copyright 2014 Martin Stehle
8
+ *
9
+ * @wordpress-plugin
10
+ * Plugin Name: Quick Featured Images
11
+ * Plugin URI: http://wordpress.org/plugins/quick-featured-images
12
+ * Description: Your time-saving Swiss Army Knife for featured images: Set, replace and delete them in bulk, set default images, get overview lists.
13
+ * Version: 11.0
14
+ * Author: Martin Stehle
15
+ * Author URI: http://stehle-internet.de
16
+ * Text Domain: quick-featured-images
17
+ * Domain Path: /languages
18
+ * License: GPL-2.0+
19
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
20
+ */
21
+
22
+ // If this file is called directly, abort.
23
+ if ( ! defined( 'WPINC' ) ) {
24
+ die;
25
+ }
26
+
27
+ /*
28
+ * There is no frontend use of this plugin
29
+ * so call it only in the backend
30
+ *
31
+ */
32
+ if ( is_admin() ) {
33
+
34
+ $root = plugin_dir_path( __FILE__ );
35
+
36
+ require_once( $root . 'admin/class-quick-featured-images-admin.php' );
37
+
38
+ /*
39
+ * Register hooks that are fired when the plugin is activated or deactivated.
40
+ * When the plugin is deleted, the uninstall.php file is loaded.
41
+ *
42
+ */
43
+ register_activation_hook( __FILE__, array( 'Quick_Featured_Images_Admin', 'activate' ) );
44
+ register_deactivation_hook( __FILE__, array( 'Quick_Featured_Images_Admin', 'deactivate' ) );
45
+
46
+ /*
47
+ * Make object instance of admin class
48
+ *
49
+ */
50
+ add_action( 'plugins_loaded', array( 'Quick_Featured_Images_Admin', 'get_instance' ) );
51
+
52
+ /*
53
+ * Make object instance of bulk tools class
54
+ *
55
+ */
56
+ require_once( $root . 'admin/class-quick-featured-images-tools.php' );
57
+ add_action( 'plugins_loaded', array( 'Quick_Featured_Images_Tools', 'get_instance' ) );
58
+
59
+ /*
60
+ * since 8.0: Make object instance of default images functions class
61
+ *
62
+ */
63
+ require_once( $root . 'admin/class-quick-featured-images-defaults.php' );
64
+ add_action( 'plugins_loaded', array( 'Quick_Featured_Images_Defaults', 'get_instance' ) );
65
+
66
+ /*
67
+ * since 7.0: Make object instance of options page class
68
+ *
69
+ */
70
+ require_once( $root . 'admin/class-quick-featured-images-settings.php' );
71
+ add_action( 'plugins_loaded', array( 'Quick_Featured_Images_Settings', 'get_instance' ) );
72
+
73
+ /*
74
+ * since 7.0: Make object instance of column functions class
75
+ *
76
+ */
77
+ require_once( $root . 'admin/class-quick-featured-images-columns.php' );
78
+ add_action( 'plugins_loaded', array( 'Quick_Featured_Images_Columns', 'get_instance' ) );
79
+
80
+ }
uninstall.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fired when the plugin is uninstalled.
4
+ *
5
+ * @package Quick_Featured_Images
6
+ * @author Martin Stehle <m.stehle@gmx.de>
7
+ * @license GPL-2.0+
8
+ * @link http://stehle-internet.de
9
+ * @copyright 2014 Martin Stehle
10
+ */
11
+
12
+ // If uninstall not called from WordPress, then exit
13
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
14
+ exit;
15
+ }
16
+
17
+ if ( is_multisite() ) {
18
+
19
+ $sites = wp_get_sites();
20
+
21
+ if ( empty ( $sites ) ) return;
22
+
23
+ foreach ( $sites as $site ) {
24
+ // switch to next blog
25
+ switch_to_blog( $site[ 'blog_id' ] );
26
+ // remove settings
27
+ delete_option( 'quick-featured-images-settings' );
28
+ delete_option( 'quick-featured-images-defaults' );
29
+ }
30
+ // restore the current blog, after calling switch_to_blog()
31
+ restore_current_blog();
32
+ } else {
33
+ // remove settings
34
+ delete_option( 'quick-featured-images-settings' );
35
+ delete_option( 'quick-featured-images-defaults' );
36
+ }