Version Description
- ADDED: Optional Plugin deactivation Feedback
- FIXED: Delete button was not showing for WP < 5.3
- IMPROVEMENTS: Support for WP 5.7
Download this release
Release Info
Developer | xylus |
Plugin | WP Bulk Delete |
Version | 1.2.2 |
Comparing to | |
See all releases |
Code changes from version 1.2.1 to 1.2.2
- LICENSE.txt +338 -338
- README.txt +203 -198
- assets/css/chosen.min.css +2 -2
- assets/css/jquery-ui-timepicker-addon.min.css +4 -4
- assets/css/jquery-ui.css +1312 -1312
- assets/css/wp-bulk-delete-admin.css +147 -147
- assets/js/chosen.jquery.min.js +1 -1
- assets/js/jquery-ui-timepicker-addon.min.js +4 -4
- assets/js/wp-bulk-delete-admin.js +302 -302
- includes/admin/admin-pages.php +39 -39
- includes/admin/admin-sidebar.php +50 -50
- includes/admin/cleanup/cleanup-form.php +99 -99
- includes/admin/cleanup/cleanup-page.php +50 -50
- includes/admin/comments/display-delete-comments.php +73 -73
- includes/admin/meta/display-delete-meta.php +72 -72
- includes/admin/meta/wp-bulk-delete-meta.php +52 -52
- includes/admin/posts/display-delete-posts.php +85 -85
- includes/admin/posts/wp-bulk-delete-posts.php +62 -62
- includes/admin/support-page.php +127 -127
- includes/admin/terms/display-delete-terms.php +68 -68
- includes/admin/users/display-delete-users.php +68 -68
- includes/ajax-functions.php +422 -422
- includes/class-delete-api.php +1215 -1215
- includes/class-wpbd-plugin-deactivation.php +283 -0
- includes/common-functions.php +186 -186
- includes/delele-comments-form-functions.php +244 -244
- includes/delele-meta-form-functions.php +382 -382
- includes/delele-posts-form-functions.php +624 -604
- includes/delele-terms-form-functions.php +95 -95
- includes/delele-users-form-functions.php +229 -229
- includes/scripts.php +57 -57
- languages/wp-bulk-delete.pot +173 -115
- uninstall.php +24 -24
- wp-bulk-delete.php +203 -202
LICENSE.txt
CHANGED
@@ -1,339 +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.
|
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
CHANGED
@@ -1,198 +1,203 @@
|
|
1 |
-
=== WP Bulk Delete ===
|
2 |
-
Contributors: xylus,dharm1025
|
3 |
-
Donate link: http://xylusthemes.com
|
4 |
-
Tags: delete, bulk, clean, bulk delete, bulk clean, posts delete, delete all, mass delete, posts delete, delete posts, delete comments, delete users, delete meta, delete taxonomy, delete revision, wp clean, clean trash, bulk user delete, delete all, delete all users, delete all comments, delete all posts, trash, clean spam, delete with condition, delete with filter, remove
|
5 |
-
Requires at least:
|
6 |
-
Requires PHP: 5.3
|
7 |
-
Tested up to:
|
8 |
-
Stable tag: 1.2.
|
9 |
-
License: GPLv2 or later
|
10 |
-
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
-
|
12 |
-
Delete posts, pages, comments, users, taxonomy terms and meta fields in bulk with different powerful filters and conditions.
|
13 |
-
|
14 |
-
== Description ==
|
15 |
-
|
16 |
-
WP Bulk Delete is a WordPress Plugin that allows you to delete posts, pages, comments, users, taxonomy terms and meta fields in bulk based with different powerful filters and conditions. WP bulk delete helps in finding and mass deleting unnecessary data clean up. It also helps in imporving Speed and reducing database load.
|
17 |
-
|
18 |
-
|
19 |
-
###Powerfull Features
|
20 |
-
WP bulk Delete support below powerfull conditions and filters.
|
21 |
-
|
22 |
-
#### Deleting posts
|
23 |
-
|
24 |
-
* Delete Posts.
|
25 |
-
* Delete posts by category
|
26 |
-
* Delete posts by tag
|
27 |
-
* Delete Posts by custom post type
|
28 |
-
* Delete Posts by post status
|
29 |
-
* Delete Posts by date interval
|
30 |
-
* Delete Posts by custom Taxonomy
|
31 |
-
* Delete Posts by authors
|
32 |
-
* Delete Post by meta fields
|
33 |
-
* Delete Posts by title or content. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
34 |
-
* Delete Posts by custom fields. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
35 |
-
* Delete Posts by any filters. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
36 |
-
* Delete Posts by any conditions. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
37 |
-
* Scheduled Delete [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
38 |
-
|
39 |
-
#### Delete post by conditions & filters
|
40 |
-
|
41 |
-
* Post date greater than X days
|
42 |
-
* Post date less than X days
|
43 |
-
* Post in date range
|
44 |
-
* Only public posts
|
45 |
-
* Only private posts
|
46 |
-
* Restrict to first N posts
|
47 |
-
* Delete permanently or just move to trash
|
48 |
-
* Schedule deletion of posts automatically
|
49 |
-
* Post by Category
|
50 |
-
* Post by Author
|
51 |
-
* Post by status published,pending etc
|
52 |
-
* Delete Duplicate Post (comming soon)
|
53 |
-
|
54 |
-
#### Delete Comments
|
55 |
-
|
56 |
-
* Delete Comments
|
57 |
-
* Delete Comments by status
|
58 |
-
* Delete Comments by date interval
|
59 |
-
* Delete Comments by comment author. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
60 |
-
* Delete Comments by comment post. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
61 |
-
* Delete Comments by conditions & filters [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
62 |
-
* Scheduled Delete [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
63 |
-
|
64 |
-
#### Delete users
|
65 |
-
|
66 |
-
* Delete Users
|
67 |
-
* Delete Users by user roles
|
68 |
-
* Delete Users by date interval
|
69 |
-
* Delete users based on their registered date
|
70 |
-
* Delete Users by user meta fields
|
71 |
-
* Assign deleted user data to another user. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
72 |
-
* Scheduled Delete [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
73 |
-
|
74 |
-
|
75 |
-
#### Delete Meta fields
|
76 |
-
|
77 |
-
* Delete Post Meta fields
|
78 |
-
* Delete User meta fields
|
79 |
-
* Delete Comment meta fields
|
80 |
-
* Delete Taxonomy terms
|
81 |
-
|
82 |
-
|
83 |
-
#### Database Cleanup
|
84 |
-
|
85 |
-
* Delete Auto Drafts
|
86 |
-
* Delete Trash post
|
87 |
-
* Delete Revisions
|
88 |
-
* Delete Orphaned Meta
|
89 |
-
* Delete Duplicate Meta
|
90 |
-
* Bulk Delete Post
|
91 |
-
* Mass Delete Post
|
92 |
-
|
93 |
-
|
94 |
-
#### Deleting pages
|
95 |
-
|
96 |
-
* Delete all published pages
|
97 |
-
* Delete all draft pages
|
98 |
-
* Delete all pending pages
|
99 |
-
* Delete all private pages
|
100 |
-
* Delete all scheduled pages
|
101 |
-
* Delete all pages from trash
|
102 |
-
* Delete all revisions pages
|
103 |
-
* Delete all trash pages
|
104 |
-
|
105 |
-
#### Deleting post revisions
|
106 |
-
|
107 |
-
* Delete all post revisions
|
108 |
-
* Delete all page revisions
|
109 |
-
* Delete all Custom Post Type Revisions
|
110 |
-
|
111 |
-
#### WP Bulk Delete [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
112 |
-
|
113 |
-
|
114 |
-
We are working on providing more options :)
|
115 |
-
|
116 |
-
#### Support
|
117 |
-
|
118 |
-
* If you have found a bug/issue or have a feature request, then post them in [Support ticket][1]
|
119 |
-
* If you have a question about plugin or need help to troubleshoot plugin, then post about it in our [WP Bulk delete Support][1]
|
120 |
-
* If you like the Plugin, then kindly leave a review/feedback at [WordPress repo page][2]. This will help more people to discover the plugin.
|
121 |
-
* Checkout other [WordPress Plugins][3] that we have written
|
122 |
-
|
123 |
-
|
124 |
-
[1]: https://xylusthemes.com/support/
|
125 |
-
[2]: https://wordpress.org/support/plugin/wp-bulk-delete/reviews/
|
126 |
-
[3]: https://xylusthemes.com/plugins/
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
== Installation ==
|
131 |
-
|
132 |
-
**This plugin can be installed directly from your site.**
|
133 |
-
|
134 |
-
1. Log in and navigate to Plugins & Add New.
|
135 |
-
2. Type "WP Bulk Delete" into the Search input and click the "Search" button.
|
136 |
-
3. Locate the "WP Bulk Delete" in the list of search results and click "Install Now".
|
137 |
-
4. Click the "Activate Plugin" link at the bottom of the install screen.
|
138 |
-
|
139 |
-
**It can also be installed manually.**
|
140 |
-
|
141 |
-
1. Download the "WP Bulk Delete" plugin from WordPress.org.
|
142 |
-
2. Unzip the package and move to your plugins directory.
|
143 |
-
3. Log into WordPress and navigate to the "Plugins" screen.
|
144 |
-
4. Locate "WP Bulk Delete" in the list and click the "Activate" link.
|
145 |
-
|
146 |
-
== Screenshots ==
|
147 |
-
|
148 |
-
|
149 |
-
1. Delete posts by post types.
|
150 |
-
2. Delete posts by taxonomy.
|
151 |
-
3. Delete posts by authors.
|
152 |
-
4. Delete posts by title and content.
|
153 |
-
5. Delete posts by custom fields.
|
154 |
-
6. Delete posts by all (general).
|
155 |
-
7. Delete Comments
|
156 |
-
8. Delete Users
|
157 |
-
9. Delete Postmeta
|
158 |
-
10. Delete Usermeta
|
159 |
-
11. Delete Commentmeta
|
160 |
-
12. Delete Taxonomy Terms
|
161 |
-
13. Cleanup
|
162 |
-
14. Scheduled Delete
|
163 |
-
15. Scheduled Delete History
|
164 |
-
|
165 |
-
== Changelog ==
|
166 |
-
|
167 |
-
= 1.2.
|
168 |
-
*
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
*
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
*
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
* Added
|
192 |
-
|
193 |
-
|
194 |
-
* Added Delete
|
195 |
-
* Added
|
196 |
-
|
197 |
-
|
198 |
-
*
|
|
|
|
|
|
|
|
|
|
1 |
+
=== WP Bulk Delete ===
|
2 |
+
Contributors: xylus,dharm1025
|
3 |
+
Donate link: http://xylusthemes.com
|
4 |
+
Tags: delete, bulk, clean, bulk delete, bulk clean, posts delete, delete all, mass delete, posts delete, delete posts, delete comments, delete users, delete meta, delete taxonomy, delete revision, wp clean, clean trash, bulk user delete, delete all, delete all users, delete all comments, delete all posts, trash, clean spam, delete with condition, delete with filter, remove
|
5 |
+
Requires at least: 4.9
|
6 |
+
Requires PHP: 5.3
|
7 |
+
Tested up to: 6.1
|
8 |
+
Stable tag: 1.2.2
|
9 |
+
License: GPLv2 or later
|
10 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
+
|
12 |
+
Delete posts, pages, comments, users, taxonomy terms and meta fields in bulk with different powerful filters and conditions.
|
13 |
+
|
14 |
+
== Description ==
|
15 |
+
|
16 |
+
WP Bulk Delete is a WordPress Plugin that allows you to delete posts, pages, comments, users, taxonomy terms and meta fields in bulk based with different powerful filters and conditions. WP bulk delete helps in finding and mass deleting unnecessary data clean up. It also helps in imporving Speed and reducing database load.
|
17 |
+
|
18 |
+
|
19 |
+
###Powerfull Features
|
20 |
+
WP bulk Delete support below powerfull conditions and filters.
|
21 |
+
|
22 |
+
#### Deleting posts
|
23 |
+
|
24 |
+
* Delete Posts.
|
25 |
+
* Delete posts by category
|
26 |
+
* Delete posts by tag
|
27 |
+
* Delete Posts by custom post type
|
28 |
+
* Delete Posts by post status
|
29 |
+
* Delete Posts by date interval
|
30 |
+
* Delete Posts by custom Taxonomy
|
31 |
+
* Delete Posts by authors
|
32 |
+
* Delete Post by meta fields
|
33 |
+
* Delete Posts by title or content. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
34 |
+
* Delete Posts by custom fields. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
35 |
+
* Delete Posts by any filters. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
36 |
+
* Delete Posts by any conditions. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
37 |
+
* Scheduled Delete [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
38 |
+
|
39 |
+
#### Delete post by conditions & filters
|
40 |
+
|
41 |
+
* Post date greater than X days
|
42 |
+
* Post date less than X days
|
43 |
+
* Post in date range
|
44 |
+
* Only public posts
|
45 |
+
* Only private posts
|
46 |
+
* Restrict to first N posts
|
47 |
+
* Delete permanently or just move to trash
|
48 |
+
* Schedule deletion of posts automatically
|
49 |
+
* Post by Category
|
50 |
+
* Post by Author
|
51 |
+
* Post by status published,pending etc
|
52 |
+
* Delete Duplicate Post (comming soon)
|
53 |
+
|
54 |
+
#### Delete Comments
|
55 |
+
|
56 |
+
* Delete Comments
|
57 |
+
* Delete Comments by status
|
58 |
+
* Delete Comments by date interval
|
59 |
+
* Delete Comments by comment author. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
60 |
+
* Delete Comments by comment post. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
61 |
+
* Delete Comments by conditions & filters [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
62 |
+
* Scheduled Delete [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
63 |
+
|
64 |
+
#### Delete users
|
65 |
+
|
66 |
+
* Delete Users
|
67 |
+
* Delete Users by user roles
|
68 |
+
* Delete Users by date interval
|
69 |
+
* Delete users based on their registered date
|
70 |
+
* Delete Users by user meta fields
|
71 |
+
* Assign deleted user data to another user. [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
72 |
+
* Scheduled Delete [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
73 |
+
|
74 |
+
|
75 |
+
#### Delete Meta fields
|
76 |
+
|
77 |
+
* Delete Post Meta fields
|
78 |
+
* Delete User meta fields
|
79 |
+
* Delete Comment meta fields
|
80 |
+
* Delete Taxonomy terms
|
81 |
+
|
82 |
+
|
83 |
+
#### Database Cleanup
|
84 |
+
|
85 |
+
* Delete Auto Drafts
|
86 |
+
* Delete Trash post
|
87 |
+
* Delete Revisions
|
88 |
+
* Delete Orphaned Meta
|
89 |
+
* Delete Duplicate Meta
|
90 |
+
* Bulk Delete Post
|
91 |
+
* Mass Delete Post
|
92 |
+
|
93 |
+
|
94 |
+
#### Deleting pages
|
95 |
+
|
96 |
+
* Delete all published pages
|
97 |
+
* Delete all draft pages
|
98 |
+
* Delete all pending pages
|
99 |
+
* Delete all private pages
|
100 |
+
* Delete all scheduled pages
|
101 |
+
* Delete all pages from trash
|
102 |
+
* Delete all revisions pages
|
103 |
+
* Delete all trash pages
|
104 |
+
|
105 |
+
#### Deleting post revisions
|
106 |
+
|
107 |
+
* Delete all post revisions
|
108 |
+
* Delete all page revisions
|
109 |
+
* Delete all Custom Post Type Revisions
|
110 |
+
|
111 |
+
#### WP Bulk Delete [PRO Version](https://xylusthemes.com/plugins/wp-bulk-delete/)
|
112 |
+
|
113 |
+
|
114 |
+
We are working on providing more options :)
|
115 |
+
|
116 |
+
#### Support
|
117 |
+
|
118 |
+
* If you have found a bug/issue or have a feature request, then post them in [Support ticket][1]
|
119 |
+
* If you have a question about plugin or need help to troubleshoot plugin, then post about it in our [WP Bulk delete Support][1]
|
120 |
+
* If you like the Plugin, then kindly leave a review/feedback at [WordPress repo page][2]. This will help more people to discover the plugin.
|
121 |
+
* Checkout other [WordPress Plugins][3] that we have written
|
122 |
+
|
123 |
+
|
124 |
+
[1]: https://xylusthemes.com/support/
|
125 |
+
[2]: https://wordpress.org/support/plugin/wp-bulk-delete/reviews/
|
126 |
+
[3]: https://xylusthemes.com/plugins/
|
127 |
+
|
128 |
+
|
129 |
+
|
130 |
+
== Installation ==
|
131 |
+
|
132 |
+
**This plugin can be installed directly from your site.**
|
133 |
+
|
134 |
+
1. Log in and navigate to Plugins & Add New.
|
135 |
+
2. Type "WP Bulk Delete" into the Search input and click the "Search" button.
|
136 |
+
3. Locate the "WP Bulk Delete" in the list of search results and click "Install Now".
|
137 |
+
4. Click the "Activate Plugin" link at the bottom of the install screen.
|
138 |
+
|
139 |
+
**It can also be installed manually.**
|
140 |
+
|
141 |
+
1. Download the "WP Bulk Delete" plugin from WordPress.org.
|
142 |
+
2. Unzip the package and move to your plugins directory.
|
143 |
+
3. Log into WordPress and navigate to the "Plugins" screen.
|
144 |
+
4. Locate "WP Bulk Delete" in the list and click the "Activate" link.
|
145 |
+
|
146 |
+
== Screenshots ==
|
147 |
+
|
148 |
+
|
149 |
+
1. Delete posts by post types.
|
150 |
+
2. Delete posts by taxonomy.
|
151 |
+
3. Delete posts by authors.
|
152 |
+
4. Delete posts by title and content.
|
153 |
+
5. Delete posts by custom fields.
|
154 |
+
6. Delete posts by all (general).
|
155 |
+
7. Delete Comments
|
156 |
+
8. Delete Users
|
157 |
+
9. Delete Postmeta
|
158 |
+
10. Delete Usermeta
|
159 |
+
11. Delete Commentmeta
|
160 |
+
12. Delete Taxonomy Terms
|
161 |
+
13. Cleanup
|
162 |
+
14. Scheduled Delete
|
163 |
+
15. Scheduled Delete History
|
164 |
+
|
165 |
+
== Changelog ==
|
166 |
+
|
167 |
+
= 1.2.2 =
|
168 |
+
* ADDED: Optional Plugin deactivation Feedback
|
169 |
+
* FIXED: Delete button was not showing for WP < 5.3
|
170 |
+
* IMPROVEMENTS: Support for WP 5.7
|
171 |
+
|
172 |
+
= 1.2.1 =
|
173 |
+
* FIXED: jQuery DateTimePicker Error
|
174 |
+
|
175 |
+
= 1.2.0 =
|
176 |
+
* ADDED: Scheduled Delete
|
177 |
+
* ADDED: Multiple options in date range
|
178 |
+
* ADDED: PRO as addon
|
179 |
+
* IMPROVEMENTS: Some code improvements
|
180 |
+
|
181 |
+
= 1.1.4 =
|
182 |
+
* FIXED: jQuery Error
|
183 |
+
|
184 |
+
= 1.1.3 =
|
185 |
+
* FIXED: Some bug fixes
|
186 |
+
|
187 |
+
= 1.1.2 =
|
188 |
+
* FIXED: Some bug fixes in delete users
|
189 |
+
|
190 |
+
= 1.1.1 =
|
191 |
+
* Added: post count after posttypes
|
192 |
+
|
193 |
+
= 1.1.0 =
|
194 |
+
* Added Delete Comments
|
195 |
+
* Added Delete Users
|
196 |
+
* Added Delete Postmeta fields
|
197 |
+
* Added Delete Usermeta fields
|
198 |
+
* Added Delete Commentmeta fields
|
199 |
+
* Added Delete Taxonomy Terms
|
200 |
+
* Added Cleanup
|
201 |
+
|
202 |
+
= 1.0.0 =
|
203 |
+
* Initial Version.
|
assets/css/chosen.min.css
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/* Chosen v1.6.2 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
|
2 |
-
|
3 |
.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chosen-container *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container .search-choice .group-name,.chosen-container .chosen-single .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .search-choice .group-name:after,.chosen-container .chosen-single .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),color-stop(100%,#f4f4f4));background:-webkit-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-moz-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-o-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(../images/chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(../images/chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url(../images/chosen-sprite.png) no-repeat 100% -20px;background:url(../images/chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:-webkit-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-moz-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-o-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background-image:-webkit-linear-gradient(#eee 1%,#fff 15%);background-image:-moz-linear-gradient(#eee 1%,#fff 15%);background-image:-o-linear-gradient(#eee 1%,#fff 15%);background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;height:25px;outline:0;border:0!important;background:transparent!important;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 5px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(../images/chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#eee),color-stop(80%,#fff));background-image:-webkit-linear-gradient(#eee 20%,#fff 80%);background-image:-moz-linear-gradient(#eee 20%,#fff 80%);background-image:-o-linear-gradient(#eee 20%,#fff 80%);background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:0;background:transparent}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single-nosearch .chosen-search,.chosen-rtl .chosen-drop{left:9999px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:0}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:#fff url(../images/chosen-sprite.png) no-repeat -30px -20px;background:url(../images/chosen-sprite.png) no-repeat -30px -20px;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:144dpi),only screen and (min-resolution:1.5dppx){.chosen-rtl .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-container-single .chosen-search input[type=text],.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span{background-image:url(../images/chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}}
|
1 |
+
/* Chosen v1.6.2 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
|
2 |
+
|
3 |
.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chosen-container *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container .search-choice .group-name,.chosen-container .chosen-single .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .search-choice .group-name:after,.chosen-container .chosen-single .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),color-stop(100%,#f4f4f4));background:-webkit-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-moz-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-o-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(../images/chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(../images/chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url(../images/chosen-sprite.png) no-repeat 100% -20px;background:url(../images/chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:-webkit-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-moz-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-o-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background-image:-webkit-linear-gradient(#eee 1%,#fff 15%);background-image:-moz-linear-gradient(#eee 1%,#fff 15%);background-image:-o-linear-gradient(#eee 1%,#fff 15%);background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;height:25px;outline:0;border:0!important;background:transparent!important;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 5px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(../images/chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#eee),color-stop(80%,#fff));background-image:-webkit-linear-gradient(#eee 20%,#fff 80%);background-image:-moz-linear-gradient(#eee 20%,#fff 80%);background-image:-o-linear-gradient(#eee 20%,#fff 80%);background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:0;background:transparent}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single-nosearch .chosen-search,.chosen-rtl .chosen-drop{left:9999px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:0}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:#fff url(../images/chosen-sprite.png) no-repeat -30px -20px;background:url(../images/chosen-sprite.png) no-repeat -30px -20px;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:144dpi),only screen and (min-resolution:1.5dppx){.chosen-rtl .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-container-single .chosen-search input[type=text],.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span{background-image:url(../images/chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}}
|
assets/css/jquery-ui-timepicker-addon.min.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
|
2 |
-
* http://trentrichardson.com/examples/timepicker
|
3 |
-
* Copyright (c) 2016 Trent Richardson; Licensed MIT */
|
4 |
-
|
5 |
.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:0;margin:0;padding:0}.ui-timepicker-div .ui_tpicker_unit_hide{display:none}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input{background:0 0;color:inherit;border:0;outline:0;border-bottom:solid 1px #555;width:95%}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input:focus{border-bottom-color:#aaa}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}.ui-timepicker-div.ui-timepicker-oneLine{padding-right:2px}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,.ui-timepicker-div.ui-timepicker-oneLine dt{display:none}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label{display:block;padding-top:2px}.ui-timepicker-div.ui-timepicker-oneLine dl{text-align:right}.ui-timepicker-div.ui-timepicker-oneLine dl dd,.ui-timepicker-div.ui-timepicker-oneLine dl dd>div{display:inline-block;margin:0}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before{content:':';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before{content:'.';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{display:none}
|
1 |
+
/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
|
2 |
+
* http://trentrichardson.com/examples/timepicker
|
3 |
+
* Copyright (c) 2016 Trent Richardson; Licensed MIT */
|
4 |
+
|
5 |
.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:0;margin:0;padding:0}.ui-timepicker-div .ui_tpicker_unit_hide{display:none}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input{background:0 0;color:inherit;border:0;outline:0;border-bottom:solid 1px #555;width:95%}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input:focus{border-bottom-color:#aaa}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}.ui-timepicker-div.ui-timepicker-oneLine{padding-right:2px}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,.ui-timepicker-div.ui-timepicker-oneLine dt{display:none}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label{display:block;padding-top:2px}.ui-timepicker-div.ui-timepicker-oneLine dl{text-align:right}.ui-timepicker-div.ui-timepicker-oneLine dl dd,.ui-timepicker-div.ui-timepicker-oneLine dl dd>div{display:inline-block;margin:0}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before{content:':';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before{content:'.';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{display:none}
|
assets/css/jquery-ui.css
CHANGED
@@ -1,1312 +1,1312 @@
|
|
1 |
-
/*! jQuery UI - v1.12.0 - 2016-07-08
|
2 |
-
* http://jqueryui.com
|
3 |
-
* Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
|
4 |
-
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&fwDefault=normal&cornerRadius=3px&bgColorHeader=e9e9e9&bgTextureHeader=flat&borderColorHeader=dddddd&fcHeader=333333&iconColorHeader=444444&bgColorContent=ffffff&bgTextureContent=flat&borderColorContent=dddddd&fcContent=333333&iconColorContent=444444&bgColorDefault=f6f6f6&bgTextureDefault=flat&borderColorDefault=c5c5c5&fcDefault=454545&iconColorDefault=777777&bgColorHover=ededed&bgTextureHover=flat&borderColorHover=cccccc&fcHover=2b2b2b&iconColorHover=555555&bgColorActive=007fff&bgTextureActive=flat&borderColorActive=003eff&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=fffa90&bgTextureHighlight=flat&borderColorHighlight=dad55e&fcHighlight=777620&iconColorHighlight=777620&bgColorError=fddfdf&bgTextureError=flat&borderColorError=f1a899&fcError=5f3f3f&iconColorError=cc0000&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=666666&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=5px&offsetTopShadow=0px&offsetLeftShadow=0px&cornerRadiusShadow=8px
|
5 |
-
* Copyright jQuery Foundation and other contributors; Licensed MIT */
|
6 |
-
|
7 |
-
/* Layout helpers
|
8 |
-
----------------------------------*/
|
9 |
-
.ui-helper-hidden {
|
10 |
-
display: none;
|
11 |
-
}
|
12 |
-
.ui-helper-hidden-accessible {
|
13 |
-
border: 0;
|
14 |
-
clip: rect(0 0 0 0);
|
15 |
-
height: 1px;
|
16 |
-
margin: -1px;
|
17 |
-
overflow: hidden;
|
18 |
-
padding: 0;
|
19 |
-
position: absolute;
|
20 |
-
width: 1px;
|
21 |
-
}
|
22 |
-
.ui-helper-reset {
|
23 |
-
margin: 0;
|
24 |
-
padding: 0;
|
25 |
-
border: 0;
|
26 |
-
outline: 0;
|
27 |
-
line-height: 1.3;
|
28 |
-
text-decoration: none;
|
29 |
-
font-size: 100%;
|
30 |
-
list-style: none;
|
31 |
-
}
|
32 |
-
.ui-helper-clearfix:before,
|
33 |
-
.ui-helper-clearfix:after {
|
34 |
-
content: "";
|
35 |
-
display: table;
|
36 |
-
border-collapse: collapse;
|
37 |
-
}
|
38 |
-
.ui-helper-clearfix:after {
|
39 |
-
clear: both;
|
40 |
-
}
|
41 |
-
.ui-helper-zfix {
|
42 |
-
width: 100%;
|
43 |
-
height: 100%;
|
44 |
-
top: 0;
|
45 |
-
left: 0;
|
46 |
-
position: absolute;
|
47 |
-
opacity: 0;
|
48 |
-
filter:Alpha(Opacity=0); /* support: IE8 */
|
49 |
-
}
|
50 |
-
|
51 |
-
.ui-front {
|
52 |
-
z-index: 100;
|
53 |
-
}
|
54 |
-
|
55 |
-
|
56 |
-
/* Interaction Cues
|
57 |
-
----------------------------------*/
|
58 |
-
.ui-state-disabled {
|
59 |
-
cursor: default !important;
|
60 |
-
pointer-events: none;
|
61 |
-
}
|
62 |
-
|
63 |
-
|
64 |
-
/* Icons
|
65 |
-
----------------------------------*/
|
66 |
-
.ui-icon {
|
67 |
-
display: inline-block;
|
68 |
-
vertical-align: middle;
|
69 |
-
margin-top: -.25em;
|
70 |
-
position: relative;
|
71 |
-
text-indent: -99999px;
|
72 |
-
overflow: hidden;
|
73 |
-
background-repeat: no-repeat;
|
74 |
-
}
|
75 |
-
|
76 |
-
.ui-widget-icon-block {
|
77 |
-
left: 50%;
|
78 |
-
margin-left: -8px;
|
79 |
-
display: block;
|
80 |
-
}
|
81 |
-
|
82 |
-
/* Misc visuals
|
83 |
-
----------------------------------*/
|
84 |
-
|
85 |
-
/* Overlays */
|
86 |
-
.ui-widget-overlay {
|
87 |
-
position: fixed;
|
88 |
-
top: 0;
|
89 |
-
left: 0;
|
90 |
-
width: 100%;
|
91 |
-
height: 100%;
|
92 |
-
}
|
93 |
-
.ui-accordion .ui-accordion-header {
|
94 |
-
display: block;
|
95 |
-
cursor: pointer;
|
96 |
-
position: relative;
|
97 |
-
margin: 2px 0 0 0;
|
98 |
-
padding: .5em .5em .5em .7em;
|
99 |
-
font-size: 100%;
|
100 |
-
}
|
101 |
-
.ui-accordion .ui-accordion-content {
|
102 |
-
padding: 1em 2.2em;
|
103 |
-
border-top: 0;
|
104 |
-
overflow: auto;
|
105 |
-
}
|
106 |
-
.ui-autocomplete {
|
107 |
-
position: absolute;
|
108 |
-
top: 0;
|
109 |
-
left: 0;
|
110 |
-
cursor: default;
|
111 |
-
}
|
112 |
-
.ui-menu {
|
113 |
-
list-style: none;
|
114 |
-
padding: 0;
|
115 |
-
margin: 0;
|
116 |
-
display: block;
|
117 |
-
outline: 0;
|
118 |
-
}
|
119 |
-
.ui-menu .ui-menu {
|
120 |
-
position: absolute;
|
121 |
-
}
|
122 |
-
.ui-menu .ui-menu-item {
|
123 |
-
margin: 0;
|
124 |
-
cursor: pointer;
|
125 |
-
/* support: IE10, see #8844 */
|
126 |
-
list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
|
127 |
-
}
|
128 |
-
.ui-menu .ui-menu-item-wrapper {
|
129 |
-
position: relative;
|
130 |
-
padding: 3px 1em 3px .4em;
|
131 |
-
}
|
132 |
-
.ui-menu .ui-menu-divider {
|
133 |
-
margin: 5px 0;
|
134 |
-
height: 0;
|
135 |
-
font-size: 0;
|
136 |
-
line-height: 0;
|
137 |
-
border-width: 1px 0 0 0;
|
138 |
-
}
|
139 |
-
.ui-menu .ui-state-focus,
|
140 |
-
.ui-menu .ui-state-active {
|
141 |
-
margin: -1px;
|
142 |
-
}
|
143 |
-
|
144 |
-
/* icon support */
|
145 |
-
.ui-menu-icons {
|
146 |
-
position: relative;
|
147 |
-
}
|
148 |
-
.ui-menu-icons .ui-menu-item-wrapper {
|
149 |
-
padding-left: 2em;
|
150 |
-
}
|
151 |
-
|
152 |
-
/* left-aligned */
|
153 |
-
.ui-menu .ui-icon {
|
154 |
-
position: absolute;
|
155 |
-
top: 0;
|
156 |
-
bottom: 0;
|
157 |
-
left: .2em;
|
158 |
-
margin: auto 0;
|
159 |
-
}
|
160 |
-
|
161 |
-
/* right-aligned */
|
162 |
-
.ui-menu .ui-menu-icon {
|
163 |
-
left: auto;
|
164 |
-
right: 0;
|
165 |
-
}
|
166 |
-
.ui-button {
|
167 |
-
padding: .4em 1em;
|
168 |
-
display: inline-block;
|
169 |
-
position: relative;
|
170 |
-
line-height: normal;
|
171 |
-
margin-right: .1em;
|
172 |
-
cursor: pointer;
|
173 |
-
vertical-align: middle;
|
174 |
-
text-align: center;
|
175 |
-
-webkit-user-select: none;
|
176 |
-
-moz-user-select: none;
|
177 |
-
-ms-user-select: none;
|
178 |
-
user-select: none;
|
179 |
-
|
180 |
-
/* Support: IE <= 11 */
|
181 |
-
overflow: visible;
|
182 |
-
}
|
183 |
-
|
184 |
-
.ui-button,
|
185 |
-
.ui-button:link,
|
186 |
-
.ui-button:visited,
|
187 |
-
.ui-button:hover,
|
188 |
-
.ui-button:active {
|
189 |
-
text-decoration: none;
|
190 |
-
}
|
191 |
-
|
192 |
-
/* to make room for the icon, a width needs to be set here */
|
193 |
-
.ui-button-icon-only {
|
194 |
-
width: 2em;
|
195 |
-
box-sizing: border-box;
|
196 |
-
text-indent: -9999px;
|
197 |
-
white-space: nowrap;
|
198 |
-
}
|
199 |
-
|
200 |
-
/* no icon support for input elements */
|
201 |
-
input.ui-button.ui-button-icon-only {
|
202 |
-
text-indent: 0;
|
203 |
-
}
|
204 |
-
|
205 |
-
/* button icon element(s) */
|
206 |
-
.ui-button-icon-only .ui-icon {
|
207 |
-
position: absolute;
|
208 |
-
top: 50%;
|
209 |
-
left: 50%;
|
210 |
-
margin-top: -8px;
|
211 |
-
margin-left: -8px;
|
212 |
-
}
|
213 |
-
|
214 |
-
.ui-button.ui-icon-notext .ui-icon {
|
215 |
-
padding: 0;
|
216 |
-
width: 2.1em;
|
217 |
-
height: 2.1em;
|
218 |
-
text-indent: -9999px;
|
219 |
-
white-space: nowrap;
|
220 |
-
|
221 |
-
}
|
222 |
-
|
223 |
-
input.ui-button.ui-icon-notext .ui-icon {
|
224 |
-
width: auto;
|
225 |
-
height: auto;
|
226 |
-
text-indent: 0;
|
227 |
-
white-space: normal;
|
228 |
-
padding: .4em 1em;
|
229 |
-
}
|
230 |
-
|
231 |
-
/* workarounds */
|
232 |
-
/* Support: Firefox 5 - 40 */
|
233 |
-
input.ui-button::-moz-focus-inner,
|
234 |
-
button.ui-button::-moz-focus-inner {
|
235 |
-
border: 0;
|
236 |
-
padding: 0;
|
237 |
-
}
|
238 |
-
.ui-controlgroup {
|
239 |
-
vertical-align: middle;
|
240 |
-
display: inline-block;
|
241 |
-
}
|
242 |
-
.ui-controlgroup > .ui-controlgroup-item {
|
243 |
-
float: left;
|
244 |
-
margin-left: 0;
|
245 |
-
margin-right: 0;
|
246 |
-
}
|
247 |
-
.ui-controlgroup > .ui-controlgroup-item:focus,
|
248 |
-
.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus {
|
249 |
-
z-index: 9999;
|
250 |
-
}
|
251 |
-
.ui-controlgroup-vertical > .ui-controlgroup-item {
|
252 |
-
display: block;
|
253 |
-
float: none;
|
254 |
-
width: 100%;
|
255 |
-
margin-top: 0;
|
256 |
-
margin-bottom: 0;
|
257 |
-
text-align: left;
|
258 |
-
}
|
259 |
-
.ui-controlgroup-vertical .ui-controlgroup-item {
|
260 |
-
box-sizing: border-box;
|
261 |
-
}
|
262 |
-
.ui-controlgroup .ui-controlgroup-label {
|
263 |
-
padding: .4em 1em;
|
264 |
-
}
|
265 |
-
.ui-controlgroup .ui-controlgroup-label span {
|
266 |
-
font-size: 80%;
|
267 |
-
}
|
268 |
-
.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {
|
269 |
-
border-left: none;
|
270 |
-
}
|
271 |
-
.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item {
|
272 |
-
border-top: none;
|
273 |
-
}
|
274 |
-
.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {
|
275 |
-
border-right: none;
|
276 |
-
}
|
277 |
-
.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {
|
278 |
-
border-bottom: none;
|
279 |
-
}
|
280 |
-
|
281 |
-
/* Spinner specific style fixes */
|
282 |
-
.ui-controlgroup-vertical .ui-spinner-input {
|
283 |
-
|
284 |
-
/* Support: IE8 only, Android < 4.4 only */
|
285 |
-
width: 75%;
|
286 |
-
width: calc( 100% - 2.4em );
|
287 |
-
}
|
288 |
-
.ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
|
289 |
-
border-top-style: solid;
|
290 |
-
}
|
291 |
-
|
292 |
-
.ui-checkboxradio-label .ui-icon-background {
|
293 |
-
box-shadow: inset 1px 1px 1px #ccc;
|
294 |
-
border-radius: .12em;
|
295 |
-
border: none;
|
296 |
-
}
|
297 |
-
.ui-checkboxradio-radio-label .ui-icon-background {
|
298 |
-
width: 16px;
|
299 |
-
height: 16px;
|
300 |
-
border-radius: 1em;
|
301 |
-
overflow: visible;
|
302 |
-
border: none;
|
303 |
-
}
|
304 |
-
.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,
|
305 |
-
.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {
|
306 |
-
background-image: none;
|
307 |
-
width: 8px;
|
308 |
-
height: 8px;
|
309 |
-
border-width: 4px;
|
310 |
-
border-style: solid;
|
311 |
-
}
|
312 |
-
.ui-checkboxradio-disabled {
|
313 |
-
pointer-events: none;
|
314 |
-
}
|
315 |
-
.ui-datepicker {
|
316 |
-
width: 17em;
|
317 |
-
padding: .2em .2em 0;
|
318 |
-
display: none;
|
319 |
-
}
|
320 |
-
.ui-datepicker .ui-datepicker-header {
|
321 |
-
position: relative;
|
322 |
-
padding: .2em 0;
|
323 |
-
}
|
324 |
-
.ui-datepicker .ui-datepicker-prev,
|
325 |
-
.ui-datepicker .ui-datepicker-next {
|
326 |
-
position: absolute;
|
327 |
-
top: 2px;
|
328 |
-
width: 1.8em;
|
329 |
-
height: 1.8em;
|
330 |
-
}
|
331 |
-
.ui-datepicker .ui-datepicker-prev-hover,
|
332 |
-
.ui-datepicker .ui-datepicker-next-hover {
|
333 |
-
top: 1px;
|
334 |
-
}
|
335 |
-
.ui-datepicker .ui-datepicker-prev {
|
336 |
-
left: 2px;
|
337 |
-
}
|
338 |
-
.ui-datepicker .ui-datepicker-next {
|
339 |
-
right: 2px;
|
340 |
-
}
|
341 |
-
.ui-datepicker .ui-datepicker-prev-hover {
|
342 |
-
left: 1px;
|
343 |
-
}
|
344 |
-
.ui-datepicker .ui-datepicker-next-hover {
|
345 |
-
right: 1px;
|
346 |
-
}
|
347 |
-
.ui-datepicker .ui-datepicker-prev span,
|
348 |
-
.ui-datepicker .ui-datepicker-next span {
|
349 |
-
display: block;
|
350 |
-
position: absolute;
|
351 |
-
left: 50%;
|
352 |
-
margin-left: -8px;
|
353 |
-
top: 50%;
|
354 |
-
margin-top: -8px;
|
355 |
-
}
|
356 |
-
.ui-datepicker .ui-datepicker-title {
|
357 |
-
margin: 0 2.3em;
|
358 |
-
line-height: 1.8em;
|
359 |
-
text-align: center;
|
360 |
-
}
|
361 |
-
.ui-datepicker .ui-datepicker-title select {
|
362 |
-
font-size: 1em;
|
363 |
-
margin: 1px 0;
|
364 |
-
}
|
365 |
-
.ui-datepicker select.ui-datepicker-month,
|
366 |
-
.ui-datepicker select.ui-datepicker-year {
|
367 |
-
width: 45%;
|
368 |
-
}
|
369 |
-
.ui-datepicker table {
|
370 |
-
width: 100%;
|
371 |
-
font-size: .9em;
|
372 |
-
border-collapse: collapse;
|
373 |
-
margin: 0 0 .4em;
|
374 |
-
}
|
375 |
-
.ui-datepicker th {
|
376 |
-
padding: .7em .3em;
|
377 |
-
text-align: center;
|
378 |
-
font-weight: bold;
|
379 |
-
border: 0;
|
380 |
-
}
|
381 |
-
.ui-datepicker td {
|
382 |
-
border: 0;
|
383 |
-
padding: 1px;
|
384 |
-
}
|
385 |
-
.ui-datepicker td span,
|
386 |
-
.ui-datepicker td a {
|
387 |
-
display: block;
|
388 |
-
padding: .2em;
|
389 |
-
text-align: right;
|
390 |
-
text-decoration: none;
|
391 |
-
}
|
392 |
-
.ui-datepicker .ui-datepicker-buttonpane {
|
393 |
-
background-image: none;
|
394 |
-
margin: .7em 0 0 0;
|
395 |
-
padding: 0 .2em;
|
396 |
-
border-left: 0;
|
397 |
-
border-right: 0;
|
398 |
-
border-bottom: 0;
|
399 |
-
}
|
400 |
-
.ui-datepicker .ui-datepicker-buttonpane button {
|
401 |
-
float: right;
|
402 |
-
margin: .5em .2em .4em;
|
403 |
-
cursor: pointer;
|
404 |
-
padding: .2em .6em .3em .6em;
|
405 |
-
width: auto;
|
406 |
-
overflow: visible;
|
407 |
-
}
|
408 |
-
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
|
409 |
-
float: left;
|
410 |
-
}
|
411 |
-
|
412 |
-
/* with multiple calendars */
|
413 |
-
.ui-datepicker.ui-datepicker-multi {
|
414 |
-
width: auto;
|
415 |
-
}
|
416 |
-
.ui-datepicker-multi .ui-datepicker-group {
|
417 |
-
float: left;
|
418 |
-
}
|
419 |
-
.ui-datepicker-multi .ui-datepicker-group table {
|
420 |
-
width: 95%;
|
421 |
-
margin: 0 auto .4em;
|
422 |
-
}
|
423 |
-
.ui-datepicker-multi-2 .ui-datepicker-group {
|
424 |
-
width: 50%;
|
425 |
-
}
|
426 |
-
.ui-datepicker-multi-3 .ui-datepicker-group {
|
427 |
-
width: 33.3%;
|
428 |
-
}
|
429 |
-
.ui-datepicker-multi-4 .ui-datepicker-group {
|
430 |
-
width: 25%;
|
431 |
-
}
|
432 |
-
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
|
433 |
-
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
|
434 |
-
border-left-width: 0;
|
435 |
-
}
|
436 |
-
.ui-datepicker-multi .ui-datepicker-buttonpane {
|
437 |
-
clear: left;
|
438 |
-
}
|
439 |
-
.ui-datepicker-row-break {
|
440 |
-
clear: both;
|
441 |
-
width: 100%;
|
442 |
-
font-size: 0;
|
443 |
-
}
|
444 |
-
|
445 |
-
/* RTL support */
|
446 |
-
.ui-datepicker-rtl {
|
447 |
-
direction: rtl;
|
448 |
-
}
|
449 |
-
.ui-datepicker-rtl .ui-datepicker-prev {
|
450 |
-
right: 2px;
|
451 |
-
left: auto;
|
452 |
-
}
|
453 |
-
.ui-datepicker-rtl .ui-datepicker-next {
|
454 |
-
left: 2px;
|
455 |
-
right: auto;
|
456 |
-
}
|
457 |
-
.ui-datepicker-rtl .ui-datepicker-prev:hover {
|
458 |
-
right: 1px;
|
459 |
-
left: auto;
|
460 |
-
}
|
461 |
-
.ui-datepicker-rtl .ui-datepicker-next:hover {
|
462 |
-
left: 1px;
|
463 |
-
right: auto;
|
464 |
-
}
|
465 |
-
.ui-datepicker-rtl .ui-datepicker-buttonpane {
|
466 |
-
clear: right;
|
467 |
-
}
|
468 |
-
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
|
469 |
-
float: left;
|
470 |
-
}
|
471 |
-
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
|
472 |
-
.ui-datepicker-rtl .ui-datepicker-group {
|
473 |
-
float: right;
|
474 |
-
}
|
475 |
-
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
|
476 |
-
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
|
477 |
-
border-right-width: 0;
|
478 |
-
border-left-width: 1px;
|
479 |
-
}
|
480 |
-
|
481 |
-
/* Icons */
|
482 |
-
.ui-datepicker .ui-icon {
|
483 |
-
display: block;
|
484 |
-
text-indent: -99999px;
|
485 |
-
overflow: hidden;
|
486 |
-
background-repeat: no-repeat;
|
487 |
-
left: .5em;
|
488 |
-
top: .3em;
|
489 |
-
}
|
490 |
-
.ui-dialog {
|
491 |
-
position: absolute;
|
492 |
-
top: 0;
|
493 |
-
left: 0;
|
494 |
-
padding: .2em;
|
495 |
-
outline: 0;
|
496 |
-
}
|
497 |
-
.ui-dialog .ui-dialog-titlebar {
|
498 |
-
padding: .4em 1em;
|
499 |
-
position: relative;
|
500 |
-
}
|
501 |
-
.ui-dialog .ui-dialog-title {
|
502 |
-
float: left;
|
503 |
-
margin: .1em 0;
|
504 |
-
white-space: nowrap;
|
505 |
-
width: 90%;
|
506 |
-
overflow: hidden;
|
507 |
-
text-overflow: ellipsis;
|
508 |
-
}
|
509 |
-
.ui-dialog .ui-dialog-titlebar-close {
|
510 |
-
position: absolute;
|
511 |
-
right: .3em;
|
512 |
-
top: 50%;
|
513 |
-
width: 20px;
|
514 |
-
margin: -10px 0 0 0;
|
515 |
-
padding: 1px;
|
516 |
-
height: 20px;
|
517 |
-
}
|
518 |
-
.ui-dialog .ui-dialog-content {
|
519 |
-
position: relative;
|
520 |
-
border: 0;
|
521 |
-
padding: .5em 1em;
|
522 |
-
background: none;
|
523 |
-
overflow: auto;
|
524 |
-
}
|
525 |
-
.ui-dialog .ui-dialog-buttonpane {
|
526 |
-
text-align: left;
|
527 |
-
border-width: 1px 0 0 0;
|
528 |
-
background-image: none;
|
529 |
-
margin-top: .5em;
|
530 |
-
padding: .3em 1em .5em .4em;
|
531 |
-
}
|
532 |
-
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
|
533 |
-
float: right;
|
534 |
-
}
|
535 |
-
.ui-dialog .ui-dialog-buttonpane button {
|
536 |
-
margin: .5em .4em .5em 0;
|
537 |
-
cursor: pointer;
|
538 |
-
}
|
539 |
-
.ui-dialog .ui-resizable-n {
|
540 |
-
height: 2px;
|
541 |
-
top: 0;
|
542 |
-
}
|
543 |
-
.ui-dialog .ui-resizable-e {
|
544 |
-
width: 2px;
|
545 |
-
right: 0;
|
546 |
-
}
|
547 |
-
.ui-dialog .ui-resizable-s {
|
548 |
-
height: 2px;
|
549 |
-
bottom: 0;
|
550 |
-
}
|
551 |
-
.ui-dialog .ui-resizable-w {
|
552 |
-
width: 2px;
|
553 |
-
left: 0;
|
554 |
-
}
|
555 |
-
.ui-dialog .ui-resizable-se,
|
556 |
-
.ui-dialog .ui-resizable-sw,
|
557 |
-
.ui-dialog .ui-resizable-ne,
|
558 |
-
.ui-dialog .ui-resizable-nw {
|
559 |
-
width: 7px;
|
560 |
-
height: 7px;
|
561 |
-
}
|
562 |
-
.ui-dialog .ui-resizable-se {
|
563 |
-
right: 0;
|
564 |
-
bottom: 0;
|
565 |
-
}
|
566 |
-
.ui-dialog .ui-resizable-sw {
|
567 |
-
left: 0;
|
568 |
-
bottom: 0;
|
569 |
-
}
|
570 |
-
.ui-dialog .ui-resizable-ne {
|
571 |
-
right: 0;
|
572 |
-
top: 0;
|
573 |
-
}
|
574 |
-
.ui-dialog .ui-resizable-nw {
|
575 |
-
left: 0;
|
576 |
-
top: 0;
|
577 |
-
}
|
578 |
-
.ui-draggable .ui-dialog-titlebar {
|
579 |
-
cursor: move;
|
580 |
-
}
|
581 |
-
.ui-draggable-handle {
|
582 |
-
-ms-touch-action: none;
|
583 |
-
touch-action: none;
|
584 |
-
}
|
585 |
-
.ui-resizable {
|
586 |
-
position: relative;
|
587 |
-
}
|
588 |
-
.ui-resizable-handle {
|
589 |
-
position: absolute;
|
590 |
-
font-size: 0.1px;
|
591 |
-
display: block;
|
592 |
-
-ms-touch-action: none;
|
593 |
-
touch-action: none;
|
594 |
-
}
|
595 |
-
.ui-resizable-disabled .ui-resizable-handle,
|
596 |
-
.ui-resizable-autohide .ui-resizable-handle {
|
597 |
-
display: none;
|
598 |
-
}
|
599 |
-
.ui-resizable-n {
|
600 |
-
cursor: n-resize;
|
601 |
-
height: 7px;
|
602 |
-
width: 100%;
|
603 |
-
top: -5px;
|
604 |
-
left: 0;
|
605 |
-
}
|
606 |
-
.ui-resizable-s {
|
607 |
-
cursor: s-resize;
|
608 |
-
height: 7px;
|
609 |
-
width: 100%;
|
610 |
-
bottom: -5px;
|
611 |
-
left: 0;
|
612 |
-
}
|
613 |
-
.ui-resizable-e {
|
614 |
-
cursor: e-resize;
|
615 |
-
width: 7px;
|
616 |
-
right: -5px;
|
617 |
-
top: 0;
|
618 |
-
height: 100%;
|
619 |
-
}
|
620 |
-
.ui-resizable-w {
|
621 |
-
cursor: w-resize;
|
622 |
-
width: 7px;
|
623 |
-
left: -5px;
|
624 |
-
top: 0;
|
625 |
-
height: 100%;
|
626 |
-
}
|
627 |
-
.ui-resizable-se {
|
628 |
-
cursor: se-resize;
|
629 |
-
width: 12px;
|
630 |
-
height: 12px;
|
631 |
-
right: 1px;
|
632 |
-
bottom: 1px;
|
633 |
-
}
|
634 |
-
.ui-resizable-sw {
|
635 |
-
cursor: sw-resize;
|
636 |
-
width: 9px;
|
637 |
-
height: 9px;
|
638 |
-
left: -5px;
|
639 |
-
bottom: -5px;
|
640 |
-
}
|
641 |
-
.ui-resizable-nw {
|
642 |
-
cursor: nw-resize;
|
643 |
-
width: 9px;
|
644 |
-
height: 9px;
|
645 |
-
left: -5px;
|
646 |
-
top: -5px;
|
647 |
-
}
|
648 |
-
.ui-resizable-ne {
|
649 |
-
cursor: ne-resize;
|
650 |
-
width: 9px;
|
651 |
-
height: 9px;
|
652 |
-
right: -5px;
|
653 |
-
top: -5px;
|
654 |
-
}
|
655 |
-
.ui-progressbar {
|
656 |
-
height: 2em;
|
657 |
-
text-align: left;
|
658 |
-
overflow: hidden;
|
659 |
-
}
|
660 |
-
.ui-progressbar .ui-progressbar-value {
|
661 |
-
margin: -1px;
|
662 |
-
height: 100%;
|
663 |
-
}
|
664 |
-
.ui-progressbar .ui-progressbar-overlay {
|
665 |
-
background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
|
666 |
-
height: 100%;
|
667 |
-
filter: alpha(opacity=25); /* support: IE8 */
|
668 |
-
opacity: 0.25;
|
669 |
-
}
|
670 |
-
.ui-progressbar-indeterminate .ui-progressbar-value {
|
671 |
-
background-image: none;
|
672 |
-
}
|
673 |
-
.ui-selectable {
|
674 |
-
-ms-touch-action: none;
|
675 |
-
touch-action: none;
|
676 |
-
}
|
677 |
-
.ui-selectable-helper {
|
678 |
-
position: absolute;
|
679 |
-
z-index: 100;
|
680 |
-
border: 1px dotted black;
|
681 |
-
}
|
682 |
-
.ui-selectmenu-menu {
|
683 |
-
padding: 0;
|
684 |
-
margin: 0;
|
685 |
-
position: absolute;
|
686 |
-
top: 0;
|
687 |
-
left: 0;
|
688 |
-
display: none;
|
689 |
-
}
|
690 |
-
.ui-selectmenu-menu .ui-menu {
|
691 |
-
overflow: auto;
|
692 |
-
overflow-x: hidden;
|
693 |
-
padding-bottom: 1px;
|
694 |
-
}
|
695 |
-
.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
|
696 |
-
font-size: 1em;
|
697 |
-
font-weight: bold;
|
698 |
-
line-height: 1.5;
|
699 |
-
padding: 2px 0.4em;
|
700 |
-
margin: 0.5em 0 0 0;
|
701 |
-
height: auto;
|
702 |
-
border: 0;
|
703 |
-
}
|
704 |
-
.ui-selectmenu-open {
|
705 |
-
display: block;
|
706 |
-
}
|
707 |
-
.ui-selectmenu-text {
|
708 |
-
display: block;
|
709 |
-
margin-right: 20px;
|
710 |
-
overflow: hidden;
|
711 |
-
text-overflow: ellipsis;
|
712 |
-
}
|
713 |
-
.ui-selectmenu-button.ui-button {
|
714 |
-
text-align: left;
|
715 |
-
white-space: nowrap;
|
716 |
-
width: 14em;
|
717 |
-
}
|
718 |
-
.ui-selectmenu-icon.ui-icon {
|
719 |
-
float: right;
|
720 |
-
margin-top: 0;
|
721 |
-
}
|
722 |
-
.ui-slider {
|
723 |
-
position: relative;
|
724 |
-
text-align: left;
|
725 |
-
}
|
726 |
-
.ui-slider .ui-slider-handle {
|
727 |
-
position: absolute;
|
728 |
-
z-index: 2;
|
729 |
-
width: 1.2em;
|
730 |
-
height: 1.2em;
|
731 |
-
cursor: default;
|
732 |
-
-ms-touch-action: none;
|
733 |
-
touch-action: none;
|
734 |
-
}
|
735 |
-
.ui-slider .ui-slider-range {
|
736 |
-
position: absolute;
|
737 |
-
z-index: 1;
|
738 |
-
font-size: .7em;
|
739 |
-
display: block;
|
740 |
-
border: 0;
|
741 |
-
background-position: 0 0;
|
742 |
-
}
|
743 |
-
|
744 |
-
/* support: IE8 - See #6727 */
|
745 |
-
.ui-slider.ui-state-disabled .ui-slider-handle,
|
746 |
-
.ui-slider.ui-state-disabled .ui-slider-range {
|
747 |
-
filter: inherit;
|
748 |
-
}
|
749 |
-
|
750 |
-
.ui-slider-horizontal {
|
751 |
-
height: .8em;
|
752 |
-
}
|
753 |
-
.ui-slider-horizontal .ui-slider-handle {
|
754 |
-
top: -.3em;
|
755 |
-
margin-left: -.6em;
|
756 |
-
}
|
757 |
-
.ui-slider-horizontal .ui-slider-range {
|
758 |
-
top: 0;
|
759 |
-
height: 100%;
|
760 |
-
}
|
761 |
-
.ui-slider-horizontal .ui-slider-range-min {
|
762 |
-
left: 0;
|
763 |
-
}
|
764 |
-
.ui-slider-horizontal .ui-slider-range-max {
|
765 |
-
right: 0;
|
766 |
-
}
|
767 |
-
|
768 |
-
.ui-slider-vertical {
|
769 |
-
width: .8em;
|
770 |
-
height: 100px;
|
771 |
-
}
|
772 |
-
.ui-slider-vertical .ui-slider-handle {
|
773 |
-
left: -.3em;
|
774 |
-
margin-left: 0;
|
775 |
-
margin-bottom: -.6em;
|
776 |
-
}
|
777 |
-
.ui-slider-vertical .ui-slider-range {
|
778 |
-
left: 0;
|
779 |
-
width: 100%;
|
780 |
-
}
|
781 |
-
.ui-slider-vertical .ui-slider-range-min {
|
782 |
-
bottom: 0;
|
783 |
-
}
|
784 |
-
.ui-slider-vertical .ui-slider-range-max {
|
785 |
-
top: 0;
|
786 |
-
}
|
787 |
-
.ui-sortable-handle {
|
788 |
-
-ms-touch-action: none;
|
789 |
-
touch-action: none;
|
790 |
-
}
|
791 |
-
.ui-spinner {
|
792 |
-
position: relative;
|
793 |
-
display: inline-block;
|
794 |
-
overflow: hidden;
|
795 |
-
padding: 0;
|
796 |
-
vertical-align: middle;
|
797 |
-
}
|
798 |
-
.ui-spinner-input {
|
799 |
-
border: none;
|
800 |
-
background: none;
|
801 |
-
color: inherit;
|
802 |
-
padding: .222em 0;
|
803 |
-
margin: .2em 0;
|
804 |
-
vertical-align: middle;
|
805 |
-
margin-left: .4em;
|
806 |
-
margin-right: 2em;
|
807 |
-
}
|
808 |
-
.ui-spinner-button {
|
809 |
-
width: 1.6em;
|
810 |
-
height: 50%;
|
811 |
-
font-size: .5em;
|
812 |
-
padding: 0;
|
813 |
-
margin: 0;
|
814 |
-
text-align: center;
|
815 |
-
position: absolute;
|
816 |
-
cursor: default;
|
817 |
-
display: block;
|
818 |
-
overflow: hidden;
|
819 |
-
right: 0;
|
820 |
-
}
|
821 |
-
/* more specificity required here to override default borders */
|
822 |
-
.ui-spinner a.ui-spinner-button {
|
823 |
-
border-top-style: none;
|
824 |
-
border-bottom-style: none;
|
825 |
-
border-right-style: none;
|
826 |
-
}
|
827 |
-
.ui-spinner-up {
|
828 |
-
top: 0;
|
829 |
-
}
|
830 |
-
.ui-spinner-down {
|
831 |
-
bottom: 0;
|
832 |
-
}
|
833 |
-
.ui-tabs {
|
834 |
-
position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
835 |
-
padding: .2em;
|
836 |
-
}
|
837 |
-
.ui-tabs .ui-tabs-nav {
|
838 |
-
margin: 0;
|
839 |
-
padding: .2em .2em 0;
|
840 |
-
}
|
841 |
-
.ui-tabs .ui-tabs-nav li {
|
842 |
-
list-style: none;
|
843 |
-
float: left;
|
844 |
-
position: relative;
|
845 |
-
top: 0;
|
846 |
-
margin: 1px .2em 0 0;
|
847 |
-
border-bottom-width: 0;
|
848 |
-
padding: 0;
|
849 |
-
white-space: nowrap;
|
850 |
-
}
|
851 |
-
.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
|
852 |
-
float: left;
|
853 |
-
padding: .5em 1em;
|
854 |
-
text-decoration: none;
|
855 |
-
}
|
856 |
-
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
|
857 |
-
margin-bottom: -1px;
|
858 |
-
padding-bottom: 1px;
|
859 |
-
}
|
860 |
-
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
|
861 |
-
.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
|
862 |
-
.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
|
863 |
-
cursor: text;
|
864 |
-
}
|
865 |
-
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
|
866 |
-
cursor: pointer;
|
867 |
-
}
|
868 |
-
.ui-tabs .ui-tabs-panel {
|
869 |
-
display: block;
|
870 |
-
border-width: 0;
|
871 |
-
padding: 1em 1.4em;
|
872 |
-
background: none;
|
873 |
-
}
|
874 |
-
.ui-tooltip {
|
875 |
-
padding: 8px;
|
876 |
-
position: absolute;
|
877 |
-
z-index: 9999;
|
878 |
-
max-width: 300px;
|
879 |
-
}
|
880 |
-
body .ui-tooltip {
|
881 |
-
border-width: 2px;
|
882 |
-
}
|
883 |
-
/* Component containers
|
884 |
-
----------------------------------*/
|
885 |
-
.ui-widget {
|
886 |
-
font-family: Arial,Helvetica,sans-serif;
|
887 |
-
font-size: 1em;
|
888 |
-
}
|
889 |
-
.ui-widget .ui-widget {
|
890 |
-
font-size: 1em;
|
891 |
-
}
|
892 |
-
.ui-widget input,
|
893 |
-
.ui-widget select,
|
894 |
-
.ui-widget textarea,
|
895 |
-
.ui-widget button {
|
896 |
-
font-family: Arial,Helvetica,sans-serif;
|
897 |
-
font-size: 1em;
|
898 |
-
}
|
899 |
-
.ui-widget.ui-widget-content {
|
900 |
-
border: 1px solid #c5c5c5;
|
901 |
-
}
|
902 |
-
.ui-widget-content {
|
903 |
-
border: 1px solid #dddddd;
|
904 |
-
background: #ffffff;
|
905 |
-
color: #333333;
|
906 |
-
}
|
907 |
-
.ui-widget-content a {
|
908 |
-
color: #333333;
|
909 |
-
}
|
910 |
-
.ui-widget-header {
|
911 |
-
border: 1px solid #dddddd;
|
912 |
-
background: #e9e9e9;
|
913 |
-
color: #333333;
|
914 |
-
font-weight: bold;
|
915 |
-
}
|
916 |
-
.ui-widget-header a {
|
917 |
-
color: #333333;
|
918 |
-
}
|
919 |
-
|
920 |
-
/* Interaction states
|
921 |
-
----------------------------------*/
|
922 |
-
.ui-state-default,
|
923 |
-
.ui-widget-content .ui-state-default,
|
924 |
-
.ui-widget-header .ui-state-default,
|
925 |
-
.ui-button,
|
926 |
-
|
927 |
-
/* We use html here because we need a greater specificity to make sure disabled
|
928 |
-
works properly when clicked or hovered */
|
929 |
-
html .ui-button.ui-state-disabled:hover,
|
930 |
-
html .ui-button.ui-state-disabled:active {
|
931 |
-
border: 1px solid #c5c5c5;
|
932 |
-
background: #f6f6f6;
|
933 |
-
font-weight: normal;
|
934 |
-
color: #454545;
|
935 |
-
}
|
936 |
-
.ui-state-default a,
|
937 |
-
.ui-state-default a:link,
|
938 |
-
.ui-state-default a:visited,
|
939 |
-
a.ui-button,
|
940 |
-
a:link.ui-button,
|
941 |
-
a:visited.ui-button,
|
942 |
-
.ui-button {
|
943 |
-
color: #454545;
|
944 |
-
text-decoration: none;
|
945 |
-
}
|
946 |
-
.ui-state-hover,
|
947 |
-
.ui-widget-content .ui-state-hover,
|
948 |
-
.ui-widget-header .ui-state-hover,
|
949 |
-
.ui-state-focus,
|
950 |
-
.ui-widget-content .ui-state-focus,
|
951 |
-
.ui-widget-header .ui-state-focus,
|
952 |
-
.ui-button:hover,
|
953 |
-
.ui-button:focus {
|
954 |
-
border: 1px solid #cccccc;
|
955 |
-
background: #ededed;
|
956 |
-
font-weight: normal;
|
957 |
-
color: #2b2b2b;
|
958 |
-
}
|
959 |
-
.ui-state-hover a,
|
960 |
-
.ui-state-hover a:hover,
|
961 |
-
.ui-state-hover a:link,
|
962 |
-
.ui-state-hover a:visited,
|
963 |
-
.ui-state-focus a,
|
964 |
-
.ui-state-focus a:hover,
|
965 |
-
.ui-state-focus a:link,
|
966 |
-
.ui-state-focus a:visited,
|
967 |
-
a.ui-button:hover,
|
968 |
-
a.ui-button:focus {
|
969 |
-
color: #2b2b2b;
|
970 |
-
text-decoration: none;
|
971 |
-
}
|
972 |
-
|
973 |
-
.ui-visual-focus {
|
974 |
-
box-shadow: 0 0 3px 1px rgb(94, 158, 214);
|
975 |
-
}
|
976 |
-
.ui-state-active,
|
977 |
-
.ui-widget-content .ui-state-active,
|
978 |
-
.ui-widget-header .ui-state-active,
|
979 |
-
a.ui-button:active,
|
980 |
-
.ui-button:active,
|
981 |
-
.ui-button.ui-state-active:hover {
|
982 |
-
border: 1px solid #003eff;
|
983 |
-
background: #007fff;
|
984 |
-
font-weight: normal;
|
985 |
-
color: #ffffff;
|
986 |
-
}
|
987 |
-
.ui-icon-background,
|
988 |
-
.ui-state-active .ui-icon-background {
|
989 |
-
border: #003eff;
|
990 |
-
background-color: #ffffff;
|
991 |
-
}
|
992 |
-
.ui-state-active a,
|
993 |
-
.ui-state-active a:link,
|
994 |
-
.ui-state-active a:visited {
|
995 |
-
color: #ffffff;
|
996 |
-
text-decoration: none;
|
997 |
-
}
|
998 |
-
|
999 |
-
/* Interaction Cues
|
1000 |
-
----------------------------------*/
|
1001 |
-
.ui-state-highlight,
|
1002 |
-
.ui-widget-content .ui-state-highlight,
|
1003 |
-
.ui-widget-header .ui-state-highlight {
|
1004 |
-
border: 1px solid #dad55e;
|
1005 |
-
background: #fffa90;
|
1006 |
-
color: #777620;
|
1007 |
-
}
|
1008 |
-
.ui-state-checked {
|
1009 |
-
border: 1px solid #dad55e;
|
1010 |
-
background: #fffa90;
|
1011 |
-
}
|
1012 |
-
.ui-state-highlight a,
|
1013 |
-
.ui-widget-content .ui-state-highlight a,
|
1014 |
-
.ui-widget-header .ui-state-highlight a {
|
1015 |
-
color: #777620;
|
1016 |
-
}
|
1017 |
-
.ui-state-error,
|
1018 |
-
.ui-widget-content .ui-state-error,
|
1019 |
-
.ui-widget-header .ui-state-error {
|
1020 |
-
border: 1px solid #f1a899;
|
1021 |
-
background: #fddfdf;
|
1022 |
-
color: #5f3f3f;
|
1023 |
-
}
|
1024 |
-
.ui-state-error a,
|
1025 |
-
.ui-widget-content .ui-state-error a,
|
1026 |
-
.ui-widget-header .ui-state-error a {
|
1027 |
-
color: #5f3f3f;
|
1028 |
-
}
|
1029 |
-
.ui-state-error-text,
|
1030 |
-
.ui-widget-content .ui-state-error-text,
|
1031 |
-
.ui-widget-header .ui-state-error-text {
|
1032 |
-
color: #5f3f3f;
|
1033 |
-
}
|
1034 |
-
.ui-priority-primary,
|
1035 |
-
.ui-widget-content .ui-priority-primary,
|
1036 |
-
.ui-widget-header .ui-priority-primary {
|
1037 |
-
font-weight: bold;
|
1038 |
-
}
|
1039 |
-
.ui-priority-secondary,
|
1040 |
-
.ui-widget-content .ui-priority-secondary,
|
1041 |
-
.ui-widget-header .ui-priority-secondary {
|
1042 |
-
opacity: .7;
|
1043 |
-
filter:Alpha(Opacity=70); /* support: IE8 */
|
1044 |
-
font-weight: normal;
|
1045 |
-
}
|
1046 |
-
.ui-state-disabled,
|
1047 |
-
.ui-widget-content .ui-state-disabled,
|
1048 |
-
.ui-widget-header .ui-state-disabled {
|
1049 |
-
opacity: .35;
|
1050 |
-
filter:Alpha(Opacity=35); /* support: IE8 */
|
1051 |
-
background-image: none;
|
1052 |
-
}
|
1053 |
-
.ui-state-disabled .ui-icon {
|
1054 |
-
filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
|
1055 |
-
}
|
1056 |
-
|
1057 |
-
/* Icons
|
1058 |
-
----------------------------------*/
|
1059 |
-
|
1060 |
-
/* states and images */
|
1061 |
-
.ui-icon {
|
1062 |
-
width: 16px;
|
1063 |
-
height: 16px;
|
1064 |
-
}
|
1065 |
-
.ui-icon,
|
1066 |
-
.ui-widget-content .ui-icon {
|
1067 |
-
background-image: url("images/ui-icons_444444_256x240.png");
|
1068 |
-
}
|
1069 |
-
.ui-widget-header .ui-icon {
|
1070 |
-
background-image: url("images/ui-icons_444444_256x240.png");
|
1071 |
-
}
|
1072 |
-
.ui-button .ui-icon {
|
1073 |
-
background-image: url("images/ui-icons_777777_256x240.png");
|
1074 |
-
}
|
1075 |
-
.ui-state-hover .ui-icon,
|
1076 |
-
.ui-state-focus .ui-icon,
|
1077 |
-
.ui-button:hover .ui-icon,
|
1078 |
-
.ui-button:focus .ui-icon,
|
1079 |
-
.ui-state-default .ui-icon {
|
1080 |
-
background-image: url("images/ui-icons_555555_256x240.png");
|
1081 |
-
}
|
1082 |
-
.ui-state-active .ui-icon,
|
1083 |
-
.ui-button:active .ui-icon {
|
1084 |
-
background-image: url("images/ui-icons_ffffff_256x240.png");
|
1085 |
-
}
|
1086 |
-
.ui-state-highlight .ui-icon,
|
1087 |
-
.ui-button .ui-state-highlight.ui-icon {
|
1088 |
-
background-image: url("images/ui-icons_777620_256x240.png");
|
1089 |
-
}
|
1090 |
-
.ui-state-error .ui-icon,
|
1091 |
-
.ui-state-error-text .ui-icon {
|
1092 |
-
background-image: url("images/ui-icons_cc0000_256x240.png");
|
1093 |
-
}
|
1094 |
-
|
1095 |
-
/* positioning */
|
1096 |
-
.ui-icon-blank { background-position: 16px 16px; }
|
1097 |
-
.ui-icon-caret-1-n { background-position: 0 0; }
|
1098 |
-
.ui-icon-caret-1-ne { background-position: -16px 0; }
|
1099 |
-
.ui-icon-caret-1-e { background-position: -32px 0; }
|
1100 |
-
.ui-icon-caret-1-se { background-position: -48px 0; }
|
1101 |
-
.ui-icon-caret-1-s { background-position: -65px 0; }
|
1102 |
-
.ui-icon-caret-1-sw { background-position: -80px 0; }
|
1103 |
-
.ui-icon-caret-1-w { background-position: -96px 0; }
|
1104 |
-
.ui-icon-caret-1-nw { background-position: -112px 0; }
|
1105 |
-
.ui-icon-caret-2-n-s { background-position: -128px 0; }
|
1106 |
-
.ui-icon-caret-2-e-w { background-position: -144px 0; }
|
1107 |
-
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
1108 |
-
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
1109 |
-
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
1110 |
-
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
1111 |
-
.ui-icon-triangle-1-s { background-position: -65px -16px; }
|
1112 |
-
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
1113 |
-
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
1114 |
-
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
1115 |
-
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
1116 |
-
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
1117 |
-
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
1118 |
-
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
1119 |
-
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
1120 |
-
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
1121 |
-
.ui-icon-arrow-1-s { background-position: -65px -32px; }
|
1122 |
-
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
1123 |
-
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
1124 |
-
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
1125 |
-
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
1126 |
-
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
1127 |
-
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
1128 |
-
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
1129 |
-
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
1130 |
-
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
1131 |
-
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
1132 |
-
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
1133 |
-
.ui-icon-arrowthick-1-n { background-position: 1px -48px; }
|
1134 |
-
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
1135 |
-
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
1136 |
-
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
1137 |
-
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
1138 |
-
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
1139 |
-
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
1140 |
-
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
1141 |
-
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
1142 |
-
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
1143 |
-
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
1144 |
-
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
1145 |
-
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
1146 |
-
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
1147 |
-
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
1148 |
-
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
1149 |
-
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
1150 |
-
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
1151 |
-
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
1152 |
-
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
1153 |
-
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
1154 |
-
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
1155 |
-
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
1156 |
-
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
1157 |
-
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
1158 |
-
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
1159 |
-
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
1160 |
-
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
1161 |
-
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
1162 |
-
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
1163 |
-
.ui-icon-extlink { background-position: -32px -80px; }
|
1164 |
-
.ui-icon-newwin { background-position: -48px -80px; }
|
1165 |
-
.ui-icon-refresh { background-position: -64px -80px; }
|
1166 |
-
.ui-icon-shuffle { background-position: -80px -80px; }
|
1167 |
-
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
1168 |
-
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
1169 |
-
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
1170 |
-
.ui-icon-folder-open { background-position: -16px -96px; }
|
1171 |
-
.ui-icon-document { background-position: -32px -96px; }
|
1172 |
-
.ui-icon-document-b { background-position: -48px -96px; }
|
1173 |
-
.ui-icon-note { background-position: -64px -96px; }
|
1174 |
-
.ui-icon-mail-closed { background-position: -80px -96px; }
|
1175 |
-
.ui-icon-mail-open { background-position: -96px -96px; }
|
1176 |
-
.ui-icon-suitcase { background-position: -112px -96px; }
|
1177 |
-
.ui-icon-comment { background-position: -128px -96px; }
|
1178 |
-
.ui-icon-person { background-position: -144px -96px; }
|
1179 |
-
.ui-icon-print { background-position: -160px -96px; }
|
1180 |
-
.ui-icon-trash { background-position: -176px -96px; }
|
1181 |
-
.ui-icon-locked { background-position: -192px -96px; }
|
1182 |
-
.ui-icon-unlocked { background-position: -208px -96px; }
|
1183 |
-
.ui-icon-bookmark { background-position: -224px -96px; }
|
1184 |
-
.ui-icon-tag { background-position: -240px -96px; }
|
1185 |
-
.ui-icon-home { background-position: 0 -112px; }
|
1186 |
-
.ui-icon-flag { background-position: -16px -112px; }
|
1187 |
-
.ui-icon-calendar { background-position: -32px -112px; }
|
1188 |
-
.ui-icon-cart { background-position: -48px -112px; }
|
1189 |
-
.ui-icon-pencil { background-position: -64px -112px; }
|
1190 |
-
.ui-icon-clock { background-position: -80px -112px; }
|
1191 |
-
.ui-icon-disk { background-position: -96px -112px; }
|
1192 |
-
.ui-icon-calculator { background-position: -112px -112px; }
|
1193 |
-
.ui-icon-zoomin { background-position: -128px -112px; }
|
1194 |
-
.ui-icon-zoomout { background-position: -144px -112px; }
|
1195 |
-
.ui-icon-search { background-position: -160px -112px; }
|
1196 |
-
.ui-icon-wrench { background-position: -176px -112px; }
|
1197 |
-
.ui-icon-gear { background-position: -192px -112px; }
|
1198 |
-
.ui-icon-heart { background-position: -208px -112px; }
|
1199 |
-
.ui-icon-star { background-position: -224px -112px; }
|
1200 |
-
.ui-icon-link { background-position: -240px -112px; }
|
1201 |
-
.ui-icon-cancel { background-position: 0 -128px; }
|
1202 |
-
.ui-icon-plus { background-position: -16px -128px; }
|
1203 |
-
.ui-icon-plusthick { background-position: -32px -128px; }
|
1204 |
-
.ui-icon-minus { background-position: -48px -128px; }
|
1205 |
-
.ui-icon-minusthick { background-position: -64px -128px; }
|
1206 |
-
.ui-icon-close { background-position: -80px -128px; }
|
1207 |
-
.ui-icon-closethick { background-position: -96px -128px; }
|
1208 |
-
.ui-icon-key { background-position: -112px -128px; }
|
1209 |
-
.ui-icon-lightbulb { background-position: -128px -128px; }
|
1210 |
-
.ui-icon-scissors { background-position: -144px -128px; }
|
1211 |
-
.ui-icon-clipboard { background-position: -160px -128px; }
|
1212 |
-
.ui-icon-copy { background-position: -176px -128px; }
|
1213 |
-
.ui-icon-contact { background-position: -192px -128px; }
|
1214 |
-
.ui-icon-image { background-position: -208px -128px; }
|
1215 |
-
.ui-icon-video { background-position: -224px -128px; }
|
1216 |
-
.ui-icon-script { background-position: -240px -128px; }
|
1217 |
-
.ui-icon-alert { background-position: 0 -144px; }
|
1218 |
-
.ui-icon-info { background-position: -16px -144px; }
|
1219 |
-
.ui-icon-notice { background-position: -32px -144px; }
|
1220 |
-
.ui-icon-help { background-position: -48px -144px; }
|
1221 |
-
.ui-icon-check { background-position: -64px -144px; }
|
1222 |
-
.ui-icon-bullet { background-position: -80px -144px; }
|
1223 |
-
.ui-icon-radio-on { background-position: -96px -144px; }
|
1224 |
-
.ui-icon-radio-off { background-position: -112px -144px; }
|
1225 |
-
.ui-icon-pin-w { background-position: -128px -144px; }
|
1226 |
-
.ui-icon-pin-s { background-position: -144px -144px; }
|
1227 |
-
.ui-icon-play { background-position: 0 -160px; }
|
1228 |
-
.ui-icon-pause { background-position: -16px -160px; }
|
1229 |
-
.ui-icon-seek-next { background-position: -32px -160px; }
|
1230 |
-
.ui-icon-seek-prev { background-position: -48px -160px; }
|
1231 |
-
.ui-icon-seek-end { background-position: -64px -160px; }
|
1232 |
-
.ui-icon-seek-start { background-position: -80px -160px; }
|
1233 |
-
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
1234 |
-
.ui-icon-seek-first { background-position: -80px -160px; }
|
1235 |
-
.ui-icon-stop { background-position: -96px -160px; }
|
1236 |
-
.ui-icon-eject { background-position: -112px -160px; }
|
1237 |
-
.ui-icon-volume-off { background-position: -128px -160px; }
|
1238 |
-
.ui-icon-volume-on { background-position: -144px -160px; }
|
1239 |
-
.ui-icon-power { background-position: 0 -176px; }
|
1240 |
-
.ui-icon-signal-diag { background-position: -16px -176px; }
|
1241 |
-
.ui-icon-signal { background-position: -32px -176px; }
|
1242 |
-
.ui-icon-battery-0 { background-position: -48px -176px; }
|
1243 |
-
.ui-icon-battery-1 { background-position: -64px -176px; }
|
1244 |
-
.ui-icon-battery-2 { background-position: -80px -176px; }
|
1245 |
-
.ui-icon-battery-3 { background-position: -96px -176px; }
|
1246 |
-
.ui-icon-circle-plus { background-position: 0 -192px; }
|
1247 |
-
.ui-icon-circle-minus { background-position: -16px -192px; }
|
1248 |
-
.ui-icon-circle-close { background-position: -32px -192px; }
|
1249 |
-
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
1250 |
-
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
1251 |
-
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
1252 |
-
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
1253 |
-
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
1254 |
-
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
1255 |
-
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
1256 |
-
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
1257 |
-
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
1258 |
-
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
1259 |
-
.ui-icon-circle-check { background-position: -208px -192px; }
|
1260 |
-
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
1261 |
-
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
1262 |
-
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
1263 |
-
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
1264 |
-
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
1265 |
-
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
1266 |
-
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
1267 |
-
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
1268 |
-
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
1269 |
-
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
1270 |
-
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
1271 |
-
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
1272 |
-
|
1273 |
-
|
1274 |
-
/* Misc visuals
|
1275 |
-
----------------------------------*/
|
1276 |
-
|
1277 |
-
/* Corner radius */
|
1278 |
-
.ui-corner-all,
|
1279 |
-
.ui-corner-top,
|
1280 |
-
.ui-corner-left,
|
1281 |
-
.ui-corner-tl {
|
1282 |
-
border-top-left-radius: 3px;
|
1283 |
-
}
|
1284 |
-
.ui-corner-all,
|
1285 |
-
.ui-corner-top,
|
1286 |
-
.ui-corner-right,
|
1287 |
-
.ui-corner-tr {
|
1288 |
-
border-top-right-radius: 3px;
|
1289 |
-
}
|
1290 |
-
.ui-corner-all,
|
1291 |
-
.ui-corner-bottom,
|
1292 |
-
.ui-corner-left,
|
1293 |
-
.ui-corner-bl {
|
1294 |
-
border-bottom-left-radius: 3px;
|
1295 |
-
}
|
1296 |
-
.ui-corner-all,
|
1297 |
-
.ui-corner-bottom,
|
1298 |
-
.ui-corner-right,
|
1299 |
-
.ui-corner-br {
|
1300 |
-
border-bottom-right-radius: 3px;
|
1301 |
-
}
|
1302 |
-
|
1303 |
-
/* Overlays */
|
1304 |
-
.ui-widget-overlay {
|
1305 |
-
background: #aaaaaa;
|
1306 |
-
opacity: .3;
|
1307 |
-
filter: Alpha(Opacity=30); /* support: IE8 */
|
1308 |
-
}
|
1309 |
-
.ui-widget-shadow {
|
1310 |
-
-webkit-box-shadow: 0px 0px 5px #666666;
|
1311 |
-
box-shadow: 0px 0px 5px #666666;
|
1312 |
-
}
|
1 |
+
/*! jQuery UI - v1.12.0 - 2016-07-08
|
2 |
+
* http://jqueryui.com
|
3 |
+
* Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
|
4 |
+
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&fwDefault=normal&cornerRadius=3px&bgColorHeader=e9e9e9&bgTextureHeader=flat&borderColorHeader=dddddd&fcHeader=333333&iconColorHeader=444444&bgColorContent=ffffff&bgTextureContent=flat&borderColorContent=dddddd&fcContent=333333&iconColorContent=444444&bgColorDefault=f6f6f6&bgTextureDefault=flat&borderColorDefault=c5c5c5&fcDefault=454545&iconColorDefault=777777&bgColorHover=ededed&bgTextureHover=flat&borderColorHover=cccccc&fcHover=2b2b2b&iconColorHover=555555&bgColorActive=007fff&bgTextureActive=flat&borderColorActive=003eff&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=fffa90&bgTextureHighlight=flat&borderColorHighlight=dad55e&fcHighlight=777620&iconColorHighlight=777620&bgColorError=fddfdf&bgTextureError=flat&borderColorError=f1a899&fcError=5f3f3f&iconColorError=cc0000&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=666666&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=5px&offsetTopShadow=0px&offsetLeftShadow=0px&cornerRadiusShadow=8px
|
5 |
+
* Copyright jQuery Foundation and other contributors; Licensed MIT */
|
6 |
+
|
7 |
+
/* Layout helpers
|
8 |
+
----------------------------------*/
|
9 |
+
.ui-helper-hidden {
|
10 |
+
display: none;
|
11 |
+
}
|
12 |
+
.ui-helper-hidden-accessible {
|
13 |
+
border: 0;
|
14 |
+
clip: rect(0 0 0 0);
|
15 |
+
height: 1px;
|
16 |
+
margin: -1px;
|
17 |
+
overflow: hidden;
|
18 |
+
padding: 0;
|
19 |
+
position: absolute;
|
20 |
+
width: 1px;
|
21 |
+
}
|
22 |
+
.ui-helper-reset {
|
23 |
+
margin: 0;
|
24 |
+
padding: 0;
|
25 |
+
border: 0;
|
26 |
+
outline: 0;
|
27 |
+
line-height: 1.3;
|
28 |
+
text-decoration: none;
|
29 |
+
font-size: 100%;
|
30 |
+
list-style: none;
|
31 |
+
}
|
32 |
+
.ui-helper-clearfix:before,
|
33 |
+
.ui-helper-clearfix:after {
|
34 |
+
content: "";
|
35 |
+
display: table;
|
36 |
+
border-collapse: collapse;
|
37 |
+
}
|
38 |
+
.ui-helper-clearfix:after {
|
39 |
+
clear: both;
|
40 |
+
}
|
41 |
+
.ui-helper-zfix {
|
42 |
+
width: 100%;
|
43 |
+
height: 100%;
|
44 |
+
top: 0;
|
45 |
+
left: 0;
|
46 |
+
position: absolute;
|
47 |
+
opacity: 0;
|
48 |
+
filter:Alpha(Opacity=0); /* support: IE8 */
|
49 |
+
}
|
50 |
+
|
51 |
+
.ui-front {
|
52 |
+
z-index: 100;
|
53 |
+
}
|
54 |
+
|
55 |
+
|
56 |
+
/* Interaction Cues
|
57 |
+
----------------------------------*/
|
58 |
+
.ui-state-disabled {
|
59 |
+
cursor: default !important;
|
60 |
+
pointer-events: none;
|
61 |
+
}
|
62 |
+
|
63 |
+
|
64 |
+
/* Icons
|
65 |
+
----------------------------------*/
|
66 |
+
.ui-icon {
|
67 |
+
display: inline-block;
|
68 |
+
vertical-align: middle;
|
69 |
+
margin-top: -.25em;
|
70 |
+
position: relative;
|
71 |
+
text-indent: -99999px;
|
72 |
+
overflow: hidden;
|
73 |
+
background-repeat: no-repeat;
|
74 |
+
}
|
75 |
+
|
76 |
+
.ui-widget-icon-block {
|
77 |
+
left: 50%;
|
78 |
+
margin-left: -8px;
|
79 |
+
display: block;
|
80 |
+
}
|
81 |
+
|
82 |
+
/* Misc visuals
|
83 |
+
----------------------------------*/
|
84 |
+
|
85 |
+
/* Overlays */
|
86 |
+
.ui-widget-overlay {
|
87 |
+
position: fixed;
|
88 |
+
top: 0;
|
89 |
+
left: 0;
|
90 |
+
width: 100%;
|
91 |
+
height: 100%;
|
92 |
+
}
|
93 |
+
.ui-accordion .ui-accordion-header {
|
94 |
+
display: block;
|
95 |
+
cursor: pointer;
|
96 |
+
position: relative;
|
97 |
+
margin: 2px 0 0 0;
|
98 |
+
padding: .5em .5em .5em .7em;
|
99 |
+
font-size: 100%;
|
100 |
+
}
|
101 |
+
.ui-accordion .ui-accordion-content {
|
102 |
+
padding: 1em 2.2em;
|
103 |
+
border-top: 0;
|
104 |
+
overflow: auto;
|
105 |
+
}
|
106 |
+
.ui-autocomplete {
|
107 |
+
position: absolute;
|
108 |
+
top: 0;
|
109 |
+
left: 0;
|
110 |
+
cursor: default;
|
111 |
+
}
|
112 |
+
.ui-menu {
|
113 |
+
list-style: none;
|
114 |
+
padding: 0;
|
115 |
+
margin: 0;
|
116 |
+
display: block;
|
117 |
+
outline: 0;
|
118 |
+
}
|
119 |
+
.ui-menu .ui-menu {
|
120 |
+
position: absolute;
|
121 |
+
}
|
122 |
+
.ui-menu .ui-menu-item {
|
123 |
+
margin: 0;
|
124 |
+
cursor: pointer;
|
125 |
+
/* support: IE10, see #8844 */
|
126 |
+
list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
|
127 |
+
}
|
128 |
+
.ui-menu .ui-menu-item-wrapper {
|
129 |
+
position: relative;
|
130 |
+
padding: 3px 1em 3px .4em;
|
131 |
+
}
|
132 |
+
.ui-menu .ui-menu-divider {
|
133 |
+
margin: 5px 0;
|
134 |
+
height: 0;
|
135 |
+
font-size: 0;
|
136 |
+
line-height: 0;
|
137 |
+
border-width: 1px 0 0 0;
|
138 |
+
}
|
139 |
+
.ui-menu .ui-state-focus,
|
140 |
+
.ui-menu .ui-state-active {
|
141 |
+
margin: -1px;
|
142 |
+
}
|
143 |
+
|
144 |
+
/* icon support */
|
145 |
+
.ui-menu-icons {
|
146 |
+
position: relative;
|
147 |
+
}
|
148 |
+
.ui-menu-icons .ui-menu-item-wrapper {
|
149 |
+
padding-left: 2em;
|
150 |
+
}
|
151 |
+
|
152 |
+
/* left-aligned */
|
153 |
+
.ui-menu .ui-icon {
|
154 |
+
position: absolute;
|
155 |
+
top: 0;
|
156 |
+
bottom: 0;
|
157 |
+
left: .2em;
|
158 |
+
margin: auto 0;
|
159 |
+
}
|
160 |
+
|
161 |
+
/* right-aligned */
|
162 |
+
.ui-menu .ui-menu-icon {
|
163 |
+
left: auto;
|
164 |
+
right: 0;
|
165 |
+
}
|
166 |
+
.ui-button {
|
167 |
+
padding: .4em 1em;
|
168 |
+
display: inline-block;
|
169 |
+
position: relative;
|
170 |
+
line-height: normal;
|
171 |
+
margin-right: .1em;
|
172 |
+
cursor: pointer;
|
173 |
+
vertical-align: middle;
|
174 |
+
text-align: center;
|
175 |
+
-webkit-user-select: none;
|
176 |
+
-moz-user-select: none;
|
177 |
+
-ms-user-select: none;
|
178 |
+
user-select: none;
|
179 |
+
|
180 |
+
/* Support: IE <= 11 */
|
181 |
+
overflow: visible;
|
182 |
+
}
|
183 |
+
|
184 |
+
.ui-button,
|
185 |
+
.ui-button:link,
|
186 |
+
.ui-button:visited,
|
187 |
+
.ui-button:hover,
|
188 |
+
.ui-button:active {
|
189 |
+
text-decoration: none;
|
190 |
+
}
|
191 |
+
|
192 |
+
/* to make room for the icon, a width needs to be set here */
|
193 |
+
.ui-button-icon-only {
|
194 |
+
width: 2em;
|
195 |
+
box-sizing: border-box;
|
196 |
+
text-indent: -9999px;
|
197 |
+
white-space: nowrap;
|
198 |
+
}
|
199 |
+
|
200 |
+
/* no icon support for input elements */
|
201 |
+
input.ui-button.ui-button-icon-only {
|
202 |
+
text-indent: 0;
|
203 |
+
}
|
204 |
+
|
205 |
+
/* button icon element(s) */
|
206 |
+
.ui-button-icon-only .ui-icon {
|
207 |
+
position: absolute;
|
208 |
+
top: 50%;
|
209 |
+
left: 50%;
|
210 |
+
margin-top: -8px;
|
211 |
+
margin-left: -8px;
|
212 |
+
}
|
213 |
+
|
214 |
+
.ui-button.ui-icon-notext .ui-icon {
|
215 |
+
padding: 0;
|
216 |
+
width: 2.1em;
|
217 |
+
height: 2.1em;
|
218 |
+
text-indent: -9999px;
|
219 |
+
white-space: nowrap;
|
220 |
+
|
221 |
+
}
|
222 |
+
|
223 |
+
input.ui-button.ui-icon-notext .ui-icon {
|
224 |
+
width: auto;
|
225 |
+
height: auto;
|
226 |
+
text-indent: 0;
|
227 |
+
white-space: normal;
|
228 |
+
padding: .4em 1em;
|
229 |
+
}
|
230 |
+
|
231 |
+
/* workarounds */
|
232 |
+
/* Support: Firefox 5 - 40 */
|
233 |
+
input.ui-button::-moz-focus-inner,
|
234 |
+
button.ui-button::-moz-focus-inner {
|
235 |
+
border: 0;
|
236 |
+
padding: 0;
|
237 |
+
}
|
238 |
+
.ui-controlgroup {
|
239 |
+
vertical-align: middle;
|
240 |
+
display: inline-block;
|
241 |
+
}
|
242 |
+
.ui-controlgroup > .ui-controlgroup-item {
|
243 |
+
float: left;
|
244 |
+
margin-left: 0;
|
245 |
+
margin-right: 0;
|
246 |
+
}
|
247 |
+
.ui-controlgroup > .ui-controlgroup-item:focus,
|
248 |
+
.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus {
|
249 |
+
z-index: 9999;
|
250 |
+
}
|
251 |
+
.ui-controlgroup-vertical > .ui-controlgroup-item {
|
252 |
+
display: block;
|
253 |
+
float: none;
|
254 |
+
width: 100%;
|
255 |
+
margin-top: 0;
|
256 |
+
margin-bottom: 0;
|
257 |
+
text-align: left;
|
258 |
+
}
|
259 |
+
.ui-controlgroup-vertical .ui-controlgroup-item {
|
260 |
+
box-sizing: border-box;
|
261 |
+
}
|
262 |
+
.ui-controlgroup .ui-controlgroup-label {
|
263 |
+
padding: .4em 1em;
|
264 |
+
}
|
265 |
+
.ui-controlgroup .ui-controlgroup-label span {
|
266 |
+
font-size: 80%;
|
267 |
+
}
|
268 |
+
.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {
|
269 |
+
border-left: none;
|
270 |
+
}
|
271 |
+
.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item {
|
272 |
+
border-top: none;
|
273 |
+
}
|
274 |
+
.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {
|
275 |
+
border-right: none;
|
276 |
+
}
|
277 |
+
.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {
|
278 |
+
border-bottom: none;
|
279 |
+
}
|
280 |
+
|
281 |
+
/* Spinner specific style fixes */
|
282 |
+
.ui-controlgroup-vertical .ui-spinner-input {
|
283 |
+
|
284 |
+
/* Support: IE8 only, Android < 4.4 only */
|
285 |
+
width: 75%;
|
286 |
+
width: calc( 100% - 2.4em );
|
287 |
+
}
|
288 |
+
.ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
|
289 |
+
border-top-style: solid;
|
290 |
+
}
|
291 |
+
|
292 |
+
.ui-checkboxradio-label .ui-icon-background {
|
293 |
+
box-shadow: inset 1px 1px 1px #ccc;
|
294 |
+
border-radius: .12em;
|
295 |
+
border: none;
|
296 |
+
}
|
297 |
+
.ui-checkboxradio-radio-label .ui-icon-background {
|
298 |
+
width: 16px;
|
299 |
+
height: 16px;
|
300 |
+
border-radius: 1em;
|
301 |
+
overflow: visible;
|
302 |
+
border: none;
|
303 |
+
}
|
304 |
+
.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,
|
305 |
+
.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {
|
306 |
+
background-image: none;
|
307 |
+
width: 8px;
|
308 |
+
height: 8px;
|
309 |
+
border-width: 4px;
|
310 |
+
border-style: solid;
|
311 |
+
}
|
312 |
+
.ui-checkboxradio-disabled {
|
313 |
+
pointer-events: none;
|
314 |
+
}
|
315 |
+
.ui-datepicker {
|
316 |
+
width: 17em;
|
317 |
+
padding: .2em .2em 0;
|
318 |
+
display: none;
|
319 |
+
}
|
320 |
+
.ui-datepicker .ui-datepicker-header {
|
321 |
+
position: relative;
|
322 |
+
padding: .2em 0;
|
323 |
+
}
|
324 |
+
.ui-datepicker .ui-datepicker-prev,
|
325 |
+
.ui-datepicker .ui-datepicker-next {
|
326 |
+
position: absolute;
|
327 |
+
top: 2px;
|
328 |
+
width: 1.8em;
|
329 |
+
height: 1.8em;
|
330 |
+
}
|
331 |
+
.ui-datepicker .ui-datepicker-prev-hover,
|
332 |
+
.ui-datepicker .ui-datepicker-next-hover {
|
333 |
+
top: 1px;
|
334 |
+
}
|
335 |
+
.ui-datepicker .ui-datepicker-prev {
|
336 |
+
left: 2px;
|
337 |
+
}
|
338 |
+
.ui-datepicker .ui-datepicker-next {
|
339 |
+
right: 2px;
|
340 |
+
}
|
341 |
+
.ui-datepicker .ui-datepicker-prev-hover {
|
342 |
+
left: 1px;
|
343 |
+
}
|
344 |
+
.ui-datepicker .ui-datepicker-next-hover {
|
345 |
+
right: 1px;
|
346 |
+
}
|
347 |
+
.ui-datepicker .ui-datepicker-prev span,
|
348 |
+
.ui-datepicker .ui-datepicker-next span {
|
349 |
+
display: block;
|
350 |
+
position: absolute;
|
351 |
+
left: 50%;
|
352 |
+
margin-left: -8px;
|
353 |
+
top: 50%;
|
354 |
+
margin-top: -8px;
|
355 |
+
}
|
356 |
+
.ui-datepicker .ui-datepicker-title {
|
357 |
+
margin: 0 2.3em;
|
358 |
+
line-height: 1.8em;
|
359 |
+
text-align: center;
|
360 |
+
}
|
361 |
+
.ui-datepicker .ui-datepicker-title select {
|
362 |
+
font-size: 1em;
|
363 |
+
margin: 1px 0;
|
364 |
+
}
|
365 |
+
.ui-datepicker select.ui-datepicker-month,
|
366 |
+
.ui-datepicker select.ui-datepicker-year {
|
367 |
+
width: 45%;
|
368 |
+
}
|
369 |
+
.ui-datepicker table {
|
370 |
+
width: 100%;
|
371 |
+
font-size: .9em;
|
372 |
+
border-collapse: collapse;
|
373 |
+
margin: 0 0 .4em;
|
374 |
+
}
|
375 |
+
.ui-datepicker th {
|
376 |
+
padding: .7em .3em;
|
377 |
+
text-align: center;
|
378 |
+
font-weight: bold;
|
379 |
+
border: 0;
|
380 |
+
}
|
381 |
+
.ui-datepicker td {
|
382 |
+
border: 0;
|
383 |
+
padding: 1px;
|
384 |
+
}
|
385 |
+
.ui-datepicker td span,
|
386 |
+
.ui-datepicker td a {
|
387 |
+
display: block;
|
388 |
+
padding: .2em;
|
389 |
+
text-align: right;
|
390 |
+
text-decoration: none;
|
391 |
+
}
|
392 |
+
.ui-datepicker .ui-datepicker-buttonpane {
|
393 |
+
background-image: none;
|
394 |
+
margin: .7em 0 0 0;
|
395 |
+
padding: 0 .2em;
|
396 |
+
border-left: 0;
|
397 |
+
border-right: 0;
|
398 |
+
border-bottom: 0;
|
399 |
+
}
|
400 |
+
.ui-datepicker .ui-datepicker-buttonpane button {
|
401 |
+
float: right;
|
402 |
+
margin: .5em .2em .4em;
|
403 |
+
cursor: pointer;
|
404 |
+
padding: .2em .6em .3em .6em;
|
405 |
+
width: auto;
|
406 |
+
overflow: visible;
|
407 |
+
}
|
408 |
+
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
|
409 |
+
float: left;
|
410 |
+
}
|
411 |
+
|
412 |
+
/* with multiple calendars */
|
413 |
+
.ui-datepicker.ui-datepicker-multi {
|
414 |
+
width: auto;
|
415 |
+
}
|
416 |
+
.ui-datepicker-multi .ui-datepicker-group {
|
417 |
+
float: left;
|
418 |
+
}
|
419 |
+
.ui-datepicker-multi .ui-datepicker-group table {
|
420 |
+
width: 95%;
|
421 |
+
margin: 0 auto .4em;
|
422 |
+
}
|
423 |
+
.ui-datepicker-multi-2 .ui-datepicker-group {
|
424 |
+
width: 50%;
|
425 |
+
}
|
426 |
+
.ui-datepicker-multi-3 .ui-datepicker-group {
|
427 |
+
width: 33.3%;
|
428 |
+
}
|
429 |
+
.ui-datepicker-multi-4 .ui-datepicker-group {
|
430 |
+
width: 25%;
|
431 |
+
}
|
432 |
+
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
|
433 |
+
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
|
434 |
+
border-left-width: 0;
|
435 |
+
}
|
436 |
+
.ui-datepicker-multi .ui-datepicker-buttonpane {
|
437 |
+
clear: left;
|
438 |
+
}
|
439 |
+
.ui-datepicker-row-break {
|
440 |
+
clear: both;
|
441 |
+
width: 100%;
|
442 |
+
font-size: 0;
|
443 |
+
}
|
444 |
+
|
445 |
+
/* RTL support */
|
446 |
+
.ui-datepicker-rtl {
|
447 |
+
direction: rtl;
|
448 |
+
}
|
449 |
+
.ui-datepicker-rtl .ui-datepicker-prev {
|
450 |
+
right: 2px;
|
451 |
+
left: auto;
|
452 |
+
}
|
453 |
+
.ui-datepicker-rtl .ui-datepicker-next {
|
454 |
+
left: 2px;
|
455 |
+
right: auto;
|
456 |
+
}
|
457 |
+
.ui-datepicker-rtl .ui-datepicker-prev:hover {
|
458 |
+
right: 1px;
|
459 |
+
left: auto;
|
460 |
+
}
|
461 |
+
.ui-datepicker-rtl .ui-datepicker-next:hover {
|
462 |
+
left: 1px;
|
463 |
+
right: auto;
|
464 |
+
}
|
465 |
+
.ui-datepicker-rtl .ui-datepicker-buttonpane {
|
466 |
+
clear: right;
|
467 |
+
}
|
468 |
+
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
|
469 |
+
float: left;
|
470 |
+
}
|
471 |
+
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
|
472 |
+
.ui-datepicker-rtl .ui-datepicker-group {
|
473 |
+
float: right;
|
474 |
+
}
|
475 |
+
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
|
476 |
+
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
|
477 |
+
border-right-width: 0;
|
478 |
+
border-left-width: 1px;
|
479 |
+
}
|
480 |
+
|
481 |
+
/* Icons */
|
482 |
+
.ui-datepicker .ui-icon {
|
483 |
+
display: block;
|
484 |
+
text-indent: -99999px;
|
485 |
+
overflow: hidden;
|
486 |
+
background-repeat: no-repeat;
|
487 |
+
left: .5em;
|
488 |
+
top: .3em;
|
489 |
+
}
|
490 |
+
.ui-dialog {
|
491 |
+
position: absolute;
|
492 |
+
top: 0;
|
493 |
+
left: 0;
|
494 |
+
padding: .2em;
|
495 |
+
outline: 0;
|
496 |
+
}
|
497 |
+
.ui-dialog .ui-dialog-titlebar {
|
498 |
+
padding: .4em 1em;
|
499 |
+
position: relative;
|
500 |
+
}
|
501 |
+
.ui-dialog .ui-dialog-title {
|
502 |
+
float: left;
|
503 |
+
margin: .1em 0;
|
504 |
+
white-space: nowrap;
|
505 |
+
width: 90%;
|
506 |
+
overflow: hidden;
|
507 |
+
text-overflow: ellipsis;
|
508 |
+
}
|
509 |
+
.ui-dialog .ui-dialog-titlebar-close {
|
510 |
+
position: absolute;
|
511 |
+
right: .3em;
|
512 |
+
top: 50%;
|
513 |
+
width: 20px;
|
514 |
+
margin: -10px 0 0 0;
|
515 |
+
padding: 1px;
|
516 |
+
height: 20px;
|
517 |
+
}
|
518 |
+
.ui-dialog .ui-dialog-content {
|
519 |
+
position: relative;
|
520 |
+
border: 0;
|
521 |
+
padding: .5em 1em;
|
522 |
+
background: none;
|
523 |
+
overflow: auto;
|
524 |
+
}
|
525 |
+
.ui-dialog .ui-dialog-buttonpane {
|
526 |
+
text-align: left;
|
527 |
+
border-width: 1px 0 0 0;
|
528 |
+
background-image: none;
|
529 |
+
margin-top: .5em;
|
530 |
+
padding: .3em 1em .5em .4em;
|
531 |
+
}
|
532 |
+
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
|
533 |
+
float: right;
|
534 |
+
}
|
535 |
+
.ui-dialog .ui-dialog-buttonpane button {
|
536 |
+
margin: .5em .4em .5em 0;
|
537 |
+
cursor: pointer;
|
538 |
+
}
|
539 |
+
.ui-dialog .ui-resizable-n {
|
540 |
+
height: 2px;
|
541 |
+
top: 0;
|
542 |
+
}
|
543 |
+
.ui-dialog .ui-resizable-e {
|
544 |
+
width: 2px;
|
545 |
+
right: 0;
|
546 |
+
}
|
547 |
+
.ui-dialog .ui-resizable-s {
|
548 |
+
height: 2px;
|
549 |
+
bottom: 0;
|
550 |
+
}
|
551 |
+
.ui-dialog .ui-resizable-w {
|
552 |
+
width: 2px;
|
553 |
+
left: 0;
|
554 |
+
}
|
555 |
+
.ui-dialog .ui-resizable-se,
|
556 |
+
.ui-dialog .ui-resizable-sw,
|
557 |
+
.ui-dialog .ui-resizable-ne,
|
558 |
+
.ui-dialog .ui-resizable-nw {
|
559 |
+
width: 7px;
|
560 |
+
height: 7px;
|
561 |
+
}
|
562 |
+
.ui-dialog .ui-resizable-se {
|
563 |
+
right: 0;
|
564 |
+
bottom: 0;
|
565 |
+
}
|
566 |
+
.ui-dialog .ui-resizable-sw {
|
567 |
+
left: 0;
|
568 |
+
bottom: 0;
|
569 |
+
}
|
570 |
+
.ui-dialog .ui-resizable-ne {
|
571 |
+
right: 0;
|
572 |
+
top: 0;
|
573 |
+
}
|
574 |
+
.ui-dialog .ui-resizable-nw {
|
575 |
+
left: 0;
|
576 |
+
top: 0;
|
577 |
+
}
|
578 |
+
.ui-draggable .ui-dialog-titlebar {
|
579 |
+
cursor: move;
|
580 |
+
}
|
581 |
+
.ui-draggable-handle {
|
582 |
+
-ms-touch-action: none;
|
583 |
+
touch-action: none;
|
584 |
+
}
|
585 |
+
.ui-resizable {
|
586 |
+
position: relative;
|
587 |
+
}
|
588 |
+
.ui-resizable-handle {
|
589 |
+
position: absolute;
|
590 |
+
font-size: 0.1px;
|
591 |
+
display: block;
|
592 |
+
-ms-touch-action: none;
|
593 |
+
touch-action: none;
|
594 |
+
}
|
595 |
+
.ui-resizable-disabled .ui-resizable-handle,
|
596 |
+
.ui-resizable-autohide .ui-resizable-handle {
|
597 |
+
display: none;
|
598 |
+
}
|
599 |
+
.ui-resizable-n {
|
600 |
+
cursor: n-resize;
|
601 |
+
height: 7px;
|
602 |
+
width: 100%;
|
603 |
+
top: -5px;
|
604 |
+
left: 0;
|
605 |
+
}
|
606 |
+
.ui-resizable-s {
|
607 |
+
cursor: s-resize;
|
608 |
+
height: 7px;
|
609 |
+
width: 100%;
|
610 |
+
bottom: -5px;
|
611 |
+
left: 0;
|
612 |
+
}
|
613 |
+
.ui-resizable-e {
|
614 |
+
cursor: e-resize;
|
615 |
+
width: 7px;
|
616 |
+
right: -5px;
|
617 |
+
top: 0;
|
618 |
+
height: 100%;
|
619 |
+
}
|
620 |
+
.ui-resizable-w {
|
621 |
+
cursor: w-resize;
|
622 |
+
width: 7px;
|
623 |
+
left: -5px;
|
624 |
+
top: 0;
|
625 |
+
height: 100%;
|
626 |
+
}
|
627 |
+
.ui-resizable-se {
|
628 |
+
cursor: se-resize;
|
629 |
+
width: 12px;
|
630 |
+
height: 12px;
|
631 |
+
right: 1px;
|
632 |
+
bottom: 1px;
|
633 |
+
}
|
634 |
+
.ui-resizable-sw {
|
635 |
+
cursor: sw-resize;
|
636 |
+
width: 9px;
|
637 |
+
height: 9px;
|
638 |
+
left: -5px;
|
639 |
+
bottom: -5px;
|
640 |
+
}
|
641 |
+
.ui-resizable-nw {
|
642 |
+
cursor: nw-resize;
|
643 |
+
width: 9px;
|
644 |
+
height: 9px;
|
645 |
+
left: -5px;
|
646 |
+
top: -5px;
|
647 |
+
}
|
648 |
+
.ui-resizable-ne {
|
649 |
+
cursor: ne-resize;
|
650 |
+
width: 9px;
|
651 |
+
height: 9px;
|
652 |
+
right: -5px;
|
653 |
+
top: -5px;
|
654 |
+
}
|
655 |
+
.ui-progressbar {
|
656 |
+
height: 2em;
|
657 |
+
text-align: left;
|
658 |
+
overflow: hidden;
|
659 |
+
}
|
660 |
+
.ui-progressbar .ui-progressbar-value {
|
661 |
+
margin: -1px;
|
662 |
+
height: 100%;
|
663 |
+
}
|
664 |
+
.ui-progressbar .ui-progressbar-overlay {
|
665 |
+
background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
|
666 |
+
height: 100%;
|
667 |
+
filter: alpha(opacity=25); /* support: IE8 */
|
668 |
+
opacity: 0.25;
|
669 |
+
}
|
670 |
+
.ui-progressbar-indeterminate .ui-progressbar-value {
|
671 |
+
background-image: none;
|
672 |
+
}
|
673 |
+
.ui-selectable {
|
674 |
+
-ms-touch-action: none;
|
675 |
+
touch-action: none;
|
676 |
+
}
|
677 |
+
.ui-selectable-helper {
|
678 |
+
position: absolute;
|
679 |
+
z-index: 100;
|
680 |
+
border: 1px dotted black;
|
681 |
+
}
|
682 |
+
.ui-selectmenu-menu {
|
683 |
+
padding: 0;
|
684 |
+
margin: 0;
|
685 |
+
position: absolute;
|
686 |
+
top: 0;
|
687 |
+
left: 0;
|
688 |
+
display: none;
|
689 |
+
}
|
690 |
+
.ui-selectmenu-menu .ui-menu {
|
691 |
+
overflow: auto;
|
692 |
+
overflow-x: hidden;
|
693 |
+
padding-bottom: 1px;
|
694 |
+
}
|
695 |
+
.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
|
696 |
+
font-size: 1em;
|
697 |
+
font-weight: bold;
|
698 |
+
line-height: 1.5;
|
699 |
+
padding: 2px 0.4em;
|
700 |
+
margin: 0.5em 0 0 0;
|
701 |
+
height: auto;
|
702 |
+
border: 0;
|
703 |
+
}
|
704 |
+
.ui-selectmenu-open {
|
705 |
+
display: block;
|
706 |
+
}
|
707 |
+
.ui-selectmenu-text {
|
708 |
+
display: block;
|
709 |
+
margin-right: 20px;
|
710 |
+
overflow: hidden;
|
711 |
+
text-overflow: ellipsis;
|
712 |
+
}
|
713 |
+
.ui-selectmenu-button.ui-button {
|
714 |
+
text-align: left;
|
715 |
+
white-space: nowrap;
|
716 |
+
width: 14em;
|
717 |
+
}
|
718 |
+
.ui-selectmenu-icon.ui-icon {
|
719 |
+
float: right;
|
720 |
+
margin-top: 0;
|
721 |
+
}
|
722 |
+
.ui-slider {
|
723 |
+
position: relative;
|
724 |
+
text-align: left;
|
725 |
+
}
|
726 |
+
.ui-slider .ui-slider-handle {
|
727 |
+
position: absolute;
|
728 |
+
z-index: 2;
|
729 |
+
width: 1.2em;
|
730 |
+
height: 1.2em;
|
731 |
+
cursor: default;
|
732 |
+
-ms-touch-action: none;
|
733 |
+
touch-action: none;
|
734 |
+
}
|
735 |
+
.ui-slider .ui-slider-range {
|
736 |
+
position: absolute;
|
737 |
+
z-index: 1;
|
738 |
+
font-size: .7em;
|
739 |
+
display: block;
|
740 |
+
border: 0;
|
741 |
+
background-position: 0 0;
|
742 |
+
}
|
743 |
+
|
744 |
+
/* support: IE8 - See #6727 */
|
745 |
+
.ui-slider.ui-state-disabled .ui-slider-handle,
|
746 |
+
.ui-slider.ui-state-disabled .ui-slider-range {
|
747 |
+
filter: inherit;
|
748 |
+
}
|
749 |
+
|
750 |
+
.ui-slider-horizontal {
|
751 |
+
height: .8em;
|
752 |
+
}
|
753 |
+
.ui-slider-horizontal .ui-slider-handle {
|
754 |
+
top: -.3em;
|
755 |
+
margin-left: -.6em;
|
756 |
+
}
|
757 |
+
.ui-slider-horizontal .ui-slider-range {
|
758 |
+
top: 0;
|
759 |
+
height: 100%;
|
760 |
+
}
|
761 |
+
.ui-slider-horizontal .ui-slider-range-min {
|
762 |
+
left: 0;
|
763 |
+
}
|
764 |
+
.ui-slider-horizontal .ui-slider-range-max {
|
765 |
+
right: 0;
|
766 |
+
}
|
767 |
+
|
768 |
+
.ui-slider-vertical {
|
769 |
+
width: .8em;
|
770 |
+
height: 100px;
|
771 |
+
}
|
772 |
+
.ui-slider-vertical .ui-slider-handle {
|
773 |
+
left: -.3em;
|
774 |
+
margin-left: 0;
|
775 |
+
margin-bottom: -.6em;
|
776 |
+
}
|
777 |
+
.ui-slider-vertical .ui-slider-range {
|
778 |
+
left: 0;
|
779 |
+
width: 100%;
|
780 |
+
}
|
781 |
+
.ui-slider-vertical .ui-slider-range-min {
|
782 |
+
bottom: 0;
|
783 |
+
}
|
784 |
+
.ui-slider-vertical .ui-slider-range-max {
|
785 |
+
top: 0;
|
786 |
+
}
|
787 |
+
.ui-sortable-handle {
|
788 |
+
-ms-touch-action: none;
|
789 |
+
touch-action: none;
|
790 |
+
}
|
791 |
+
.ui-spinner {
|
792 |
+
position: relative;
|
793 |
+
display: inline-block;
|
794 |
+
overflow: hidden;
|
795 |
+
padding: 0;
|
796 |
+
vertical-align: middle;
|
797 |
+
}
|
798 |
+
.ui-spinner-input {
|
799 |
+
border: none;
|
800 |
+
background: none;
|
801 |
+
color: inherit;
|
802 |
+
padding: .222em 0;
|
803 |
+
margin: .2em 0;
|
804 |
+
vertical-align: middle;
|
805 |
+
margin-left: .4em;
|
806 |
+
margin-right: 2em;
|
807 |
+
}
|
808 |
+
.ui-spinner-button {
|
809 |
+
width: 1.6em;
|
810 |
+
height: 50%;
|
811 |
+
font-size: .5em;
|
812 |
+
padding: 0;
|
813 |
+
margin: 0;
|
814 |
+
text-align: center;
|
815 |
+
position: absolute;
|
816 |
+
cursor: default;
|
817 |
+
display: block;
|
818 |
+
overflow: hidden;
|
819 |
+
right: 0;
|
820 |
+
}
|
821 |
+
/* more specificity required here to override default borders */
|
822 |
+
.ui-spinner a.ui-spinner-button {
|
823 |
+
border-top-style: none;
|
824 |
+
border-bottom-style: none;
|
825 |
+
border-right-style: none;
|
826 |
+
}
|
827 |
+
.ui-spinner-up {
|
828 |
+
top: 0;
|
829 |
+
}
|
830 |
+
.ui-spinner-down {
|
831 |
+
bottom: 0;
|
832 |
+
}
|
833 |
+
.ui-tabs {
|
834 |
+
position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
835 |
+
padding: .2em;
|
836 |
+
}
|
837 |
+
.ui-tabs .ui-tabs-nav {
|
838 |
+
margin: 0;
|
839 |
+
padding: .2em .2em 0;
|
840 |
+
}
|
841 |
+
.ui-tabs .ui-tabs-nav li {
|
842 |
+
list-style: none;
|
843 |
+
float: left;
|
844 |
+
position: relative;
|
845 |
+
top: 0;
|
846 |
+
margin: 1px .2em 0 0;
|
847 |
+
border-bottom-width: 0;
|
848 |
+
padding: 0;
|
849 |
+
white-space: nowrap;
|
850 |
+
}
|
851 |
+
.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
|
852 |
+
float: left;
|
853 |
+
padding: .5em 1em;
|
854 |
+
text-decoration: none;
|
855 |
+
}
|
856 |
+
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
|
857 |
+
margin-bottom: -1px;
|
858 |
+
padding-bottom: 1px;
|
859 |
+
}
|
860 |
+
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
|
861 |
+
.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
|
862 |
+
.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
|
863 |
+
cursor: text;
|
864 |
+
}
|
865 |
+
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
|
866 |
+
cursor: pointer;
|
867 |
+
}
|
868 |
+
.ui-tabs .ui-tabs-panel {
|
869 |
+
display: block;
|
870 |
+
border-width: 0;
|
871 |
+
padding: 1em 1.4em;
|
872 |
+
background: none;
|
873 |
+
}
|
874 |
+
.ui-tooltip {
|
875 |
+
padding: 8px;
|
876 |
+
position: absolute;
|
877 |
+
z-index: 9999;
|
878 |
+
max-width: 300px;
|
879 |
+
}
|
880 |
+
body .ui-tooltip {
|
881 |
+
border-width: 2px;
|
882 |
+
}
|
883 |
+
/* Component containers
|
884 |
+
----------------------------------*/
|
885 |
+
.ui-widget {
|
886 |
+
font-family: Arial,Helvetica,sans-serif;
|
887 |
+
font-size: 1em;
|
888 |
+
}
|
889 |
+
.ui-widget .ui-widget {
|
890 |
+
font-size: 1em;
|
891 |
+
}
|
892 |
+
.ui-widget input,
|
893 |
+
.ui-widget select,
|
894 |
+
.ui-widget textarea,
|
895 |
+
.ui-widget button {
|
896 |
+
font-family: Arial,Helvetica,sans-serif;
|
897 |
+
font-size: 1em;
|
898 |
+
}
|
899 |
+
.ui-widget.ui-widget-content {
|
900 |
+
border: 1px solid #c5c5c5;
|
901 |
+
}
|
902 |
+
.ui-widget-content {
|
903 |
+
border: 1px solid #dddddd;
|
904 |
+
background: #ffffff;
|
905 |
+
color: #333333;
|
906 |
+
}
|
907 |
+
.ui-widget-content a {
|
908 |
+
color: #333333;
|
909 |
+
}
|
910 |
+
.ui-widget-header {
|
911 |
+
border: 1px solid #dddddd;
|
912 |
+
background: #e9e9e9;
|
913 |
+
color: #333333;
|
914 |
+
font-weight: bold;
|
915 |
+
}
|
916 |
+
.ui-widget-header a {
|
917 |
+
color: #333333;
|
918 |
+
}
|
919 |
+
|
920 |
+
/* Interaction states
|
921 |
+
----------------------------------*/
|
922 |
+
.ui-state-default,
|
923 |
+
.ui-widget-content .ui-state-default,
|
924 |
+
.ui-widget-header .ui-state-default,
|
925 |
+
.ui-button,
|
926 |
+
|
927 |
+
/* We use html here because we need a greater specificity to make sure disabled
|
928 |
+
works properly when clicked or hovered */
|
929 |
+
html .ui-button.ui-state-disabled:hover,
|
930 |
+
html .ui-button.ui-state-disabled:active {
|
931 |
+
border: 1px solid #c5c5c5;
|
932 |
+
background: #f6f6f6;
|
933 |
+
font-weight: normal;
|
934 |
+
color: #454545;
|
935 |
+
}
|
936 |
+
.ui-state-default a,
|
937 |
+
.ui-state-default a:link,
|
938 |
+
.ui-state-default a:visited,
|
939 |
+
a.ui-button,
|
940 |
+
a:link.ui-button,
|
941 |
+
a:visited.ui-button,
|
942 |
+
.ui-button {
|
943 |
+
color: #454545;
|
944 |
+
text-decoration: none;
|
945 |
+
}
|
946 |
+
.ui-state-hover,
|
947 |
+
.ui-widget-content .ui-state-hover,
|
948 |
+
.ui-widget-header .ui-state-hover,
|
949 |
+
.ui-state-focus,
|
950 |
+
.ui-widget-content .ui-state-focus,
|
951 |
+
.ui-widget-header .ui-state-focus,
|
952 |
+
.ui-button:hover,
|
953 |
+
.ui-button:focus {
|
954 |
+
border: 1px solid #cccccc;
|
955 |
+
background: #ededed;
|
956 |
+
font-weight: normal;
|
957 |
+
color: #2b2b2b;
|
958 |
+
}
|
959 |
+
.ui-state-hover a,
|
960 |
+
.ui-state-hover a:hover,
|
961 |
+
.ui-state-hover a:link,
|
962 |
+
.ui-state-hover a:visited,
|
963 |
+
.ui-state-focus a,
|
964 |
+
.ui-state-focus a:hover,
|
965 |
+
.ui-state-focus a:link,
|
966 |
+
.ui-state-focus a:visited,
|
967 |
+
a.ui-button:hover,
|
968 |
+
a.ui-button:focus {
|
969 |
+
color: #2b2b2b;
|
970 |
+
text-decoration: none;
|
971 |
+
}
|
972 |
+
|
973 |
+
.ui-visual-focus {
|
974 |
+
box-shadow: 0 0 3px 1px rgb(94, 158, 214);
|
975 |
+
}
|
976 |
+
.ui-state-active,
|
977 |
+
.ui-widget-content .ui-state-active,
|
978 |
+
.ui-widget-header .ui-state-active,
|
979 |
+
a.ui-button:active,
|
980 |
+
.ui-button:active,
|
981 |
+
.ui-button.ui-state-active:hover {
|
982 |
+
border: 1px solid #003eff;
|
983 |
+
background: #007fff;
|
984 |
+
font-weight: normal;
|
985 |
+
color: #ffffff;
|
986 |
+
}
|
987 |
+
.ui-icon-background,
|
988 |
+
.ui-state-active .ui-icon-background {
|
989 |
+
border: #003eff;
|
990 |
+
background-color: #ffffff;
|
991 |
+
}
|
992 |
+
.ui-state-active a,
|
993 |
+
.ui-state-active a:link,
|
994 |
+
.ui-state-active a:visited {
|
995 |
+
color: #ffffff;
|
996 |
+
text-decoration: none;
|
997 |
+
}
|
998 |
+
|
999 |
+
/* Interaction Cues
|
1000 |
+
----------------------------------*/
|
1001 |
+
.ui-state-highlight,
|
1002 |
+
.ui-widget-content .ui-state-highlight,
|
1003 |
+
.ui-widget-header .ui-state-highlight {
|
1004 |
+
border: 1px solid #dad55e;
|
1005 |
+
background: #fffa90;
|
1006 |
+
color: #777620;
|
1007 |
+
}
|
1008 |
+
.ui-state-checked {
|
1009 |
+
border: 1px solid #dad55e;
|
1010 |
+
background: #fffa90;
|
1011 |
+
}
|
1012 |
+
.ui-state-highlight a,
|
1013 |
+
.ui-widget-content .ui-state-highlight a,
|
1014 |
+
.ui-widget-header .ui-state-highlight a {
|
1015 |
+
color: #777620;
|
1016 |
+
}
|
1017 |
+
.ui-state-error,
|
1018 |
+
.ui-widget-content .ui-state-error,
|
1019 |
+
.ui-widget-header .ui-state-error {
|
1020 |
+
border: 1px solid #f1a899;
|
1021 |
+
background: #fddfdf;
|
1022 |
+
color: #5f3f3f;
|
1023 |
+
}
|
1024 |
+
.ui-state-error a,
|
1025 |
+
.ui-widget-content .ui-state-error a,
|
1026 |
+
.ui-widget-header .ui-state-error a {
|
1027 |
+
color: #5f3f3f;
|
1028 |
+
}
|
1029 |
+
.ui-state-error-text,
|
1030 |
+
.ui-widget-content .ui-state-error-text,
|
1031 |
+
.ui-widget-header .ui-state-error-text {
|
1032 |
+
color: #5f3f3f;
|
1033 |
+
}
|
1034 |
+
.ui-priority-primary,
|
1035 |
+
.ui-widget-content .ui-priority-primary,
|
1036 |
+
.ui-widget-header .ui-priority-primary {
|
1037 |
+
font-weight: bold;
|
1038 |
+
}
|
1039 |
+
.ui-priority-secondary,
|
1040 |
+
.ui-widget-content .ui-priority-secondary,
|
1041 |
+
.ui-widget-header .ui-priority-secondary {
|
1042 |
+
opacity: .7;
|
1043 |
+
filter:Alpha(Opacity=70); /* support: IE8 */
|
1044 |
+
font-weight: normal;
|
1045 |
+
}
|
1046 |
+
.ui-state-disabled,
|
1047 |
+
.ui-widget-content .ui-state-disabled,
|
1048 |
+
.ui-widget-header .ui-state-disabled {
|
1049 |
+
opacity: .35;
|
1050 |
+
filter:Alpha(Opacity=35); /* support: IE8 */
|
1051 |
+
background-image: none;
|
1052 |
+
}
|
1053 |
+
.ui-state-disabled .ui-icon {
|
1054 |
+
filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
|
1055 |
+
}
|
1056 |
+
|
1057 |
+
/* Icons
|
1058 |
+
----------------------------------*/
|
1059 |
+
|
1060 |
+
/* states and images */
|
1061 |
+
.ui-icon {
|
1062 |
+
width: 16px;
|
1063 |
+
height: 16px;
|
1064 |
+
}
|
1065 |
+
.ui-icon,
|
1066 |
+
.ui-widget-content .ui-icon {
|
1067 |
+
background-image: url("images/ui-icons_444444_256x240.png");
|
1068 |
+
}
|
1069 |
+
.ui-widget-header .ui-icon {
|
1070 |
+
background-image: url("images/ui-icons_444444_256x240.png");
|
1071 |
+
}
|
1072 |
+
.ui-button .ui-icon {
|
1073 |
+
background-image: url("images/ui-icons_777777_256x240.png");
|
1074 |
+
}
|
1075 |
+
.ui-state-hover .ui-icon,
|
1076 |
+
.ui-state-focus .ui-icon,
|
1077 |
+
.ui-button:hover .ui-icon,
|
1078 |
+
.ui-button:focus .ui-icon,
|
1079 |
+
.ui-state-default .ui-icon {
|
1080 |
+
background-image: url("images/ui-icons_555555_256x240.png");
|
1081 |
+
}
|
1082 |
+
.ui-state-active .ui-icon,
|
1083 |
+
.ui-button:active .ui-icon {
|
1084 |
+
background-image: url("images/ui-icons_ffffff_256x240.png");
|
1085 |
+
}
|
1086 |
+
.ui-state-highlight .ui-icon,
|
1087 |
+
.ui-button .ui-state-highlight.ui-icon {
|
1088 |
+
background-image: url("images/ui-icons_777620_256x240.png");
|
1089 |
+
}
|
1090 |
+
.ui-state-error .ui-icon,
|
1091 |
+
.ui-state-error-text .ui-icon {
|
1092 |
+
background-image: url("images/ui-icons_cc0000_256x240.png");
|
1093 |
+
}
|
1094 |
+
|
1095 |
+
/* positioning */
|
1096 |
+
.ui-icon-blank { background-position: 16px 16px; }
|
1097 |
+
.ui-icon-caret-1-n { background-position: 0 0; }
|
1098 |
+
.ui-icon-caret-1-ne { background-position: -16px 0; }
|
1099 |
+
.ui-icon-caret-1-e { background-position: -32px 0; }
|
1100 |
+
.ui-icon-caret-1-se { background-position: -48px 0; }
|
1101 |
+
.ui-icon-caret-1-s { background-position: -65px 0; }
|
1102 |
+
.ui-icon-caret-1-sw { background-position: -80px 0; }
|
1103 |
+
.ui-icon-caret-1-w { background-position: -96px 0; }
|
1104 |
+
.ui-icon-caret-1-nw { background-position: -112px 0; }
|
1105 |
+
.ui-icon-caret-2-n-s { background-position: -128px 0; }
|
1106 |
+
.ui-icon-caret-2-e-w { background-position: -144px 0; }
|
1107 |
+
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
1108 |
+
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
1109 |
+
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
1110 |
+
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
1111 |
+
.ui-icon-triangle-1-s { background-position: -65px -16px; }
|
1112 |
+
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
1113 |
+
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
1114 |
+
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
1115 |
+
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
1116 |
+
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
1117 |
+
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
1118 |
+
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
1119 |
+
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
1120 |
+
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
1121 |
+
.ui-icon-arrow-1-s { background-position: -65px -32px; }
|
1122 |
+
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
1123 |
+
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
1124 |
+
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
1125 |
+
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
1126 |
+
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
1127 |
+
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
1128 |
+
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
1129 |
+
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
1130 |
+
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
1131 |
+
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
1132 |
+
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
1133 |
+
.ui-icon-arrowthick-1-n { background-position: 1px -48px; }
|
1134 |
+
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
1135 |
+
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
1136 |
+
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
1137 |
+
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
1138 |
+
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
1139 |
+
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
1140 |
+
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
1141 |
+
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
1142 |
+
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
1143 |
+
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
1144 |
+
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
1145 |
+
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
1146 |
+
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
1147 |
+
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
1148 |
+
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
1149 |
+
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
1150 |
+
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
1151 |
+
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
1152 |
+
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
1153 |
+
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
1154 |
+
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
1155 |
+
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
1156 |
+
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
1157 |
+
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
1158 |
+
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
1159 |
+
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
1160 |
+
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
1161 |
+
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
1162 |
+
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
1163 |
+
.ui-icon-extlink { background-position: -32px -80px; }
|
1164 |
+
.ui-icon-newwin { background-position: -48px -80px; }
|
1165 |
+
.ui-icon-refresh { background-position: -64px -80px; }
|
1166 |
+
.ui-icon-shuffle { background-position: -80px -80px; }
|
1167 |
+
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
1168 |
+
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
1169 |
+
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
1170 |
+
.ui-icon-folder-open { background-position: -16px -96px; }
|
1171 |
+
.ui-icon-document { background-position: -32px -96px; }
|
1172 |
+
.ui-icon-document-b { background-position: -48px -96px; }
|
1173 |
+
.ui-icon-note { background-position: -64px -96px; }
|
1174 |
+
.ui-icon-mail-closed { background-position: -80px -96px; }
|
1175 |
+
.ui-icon-mail-open { background-position: -96px -96px; }
|
1176 |
+
.ui-icon-suitcase { background-position: -112px -96px; }
|
1177 |
+
.ui-icon-comment { background-position: -128px -96px; }
|
1178 |
+
.ui-icon-person { background-position: -144px -96px; }
|
1179 |
+
.ui-icon-print { background-position: -160px -96px; }
|
1180 |
+
.ui-icon-trash { background-position: -176px -96px; }
|
1181 |
+
.ui-icon-locked { background-position: -192px -96px; }
|
1182 |
+
.ui-icon-unlocked { background-position: -208px -96px; }
|
1183 |
+
.ui-icon-bookmark { background-position: -224px -96px; }
|
1184 |
+
.ui-icon-tag { background-position: -240px -96px; }
|
1185 |
+
.ui-icon-home { background-position: 0 -112px; }
|
1186 |
+
.ui-icon-flag { background-position: -16px -112px; }
|
1187 |
+
.ui-icon-calendar { background-position: -32px -112px; }
|
1188 |
+
.ui-icon-cart { background-position: -48px -112px; }
|
1189 |
+
.ui-icon-pencil { background-position: -64px -112px; }
|
1190 |
+
.ui-icon-clock { background-position: -80px -112px; }
|
1191 |
+
.ui-icon-disk { background-position: -96px -112px; }
|
1192 |
+
.ui-icon-calculator { background-position: -112px -112px; }
|
1193 |
+
.ui-icon-zoomin { background-position: -128px -112px; }
|
1194 |
+
.ui-icon-zoomout { background-position: -144px -112px; }
|
1195 |
+
.ui-icon-search { background-position: -160px -112px; }
|
1196 |
+
.ui-icon-wrench { background-position: -176px -112px; }
|
1197 |
+
.ui-icon-gear { background-position: -192px -112px; }
|
1198 |
+
.ui-icon-heart { background-position: -208px -112px; }
|
1199 |
+
.ui-icon-star { background-position: -224px -112px; }
|
1200 |
+
.ui-icon-link { background-position: -240px -112px; }
|
1201 |
+
.ui-icon-cancel { background-position: 0 -128px; }
|
1202 |
+
.ui-icon-plus { background-position: -16px -128px; }
|
1203 |
+
.ui-icon-plusthick { background-position: -32px -128px; }
|
1204 |
+
.ui-icon-minus { background-position: -48px -128px; }
|
1205 |
+
.ui-icon-minusthick { background-position: -64px -128px; }
|
1206 |
+
.ui-icon-close { background-position: -80px -128px; }
|
1207 |
+
.ui-icon-closethick { background-position: -96px -128px; }
|
1208 |
+
.ui-icon-key { background-position: -112px -128px; }
|
1209 |
+
.ui-icon-lightbulb { background-position: -128px -128px; }
|
1210 |
+
.ui-icon-scissors { background-position: -144px -128px; }
|
1211 |
+
.ui-icon-clipboard { background-position: -160px -128px; }
|
1212 |
+
.ui-icon-copy { background-position: -176px -128px; }
|
1213 |
+
.ui-icon-contact { background-position: -192px -128px; }
|
1214 |
+
.ui-icon-image { background-position: -208px -128px; }
|
1215 |
+
.ui-icon-video { background-position: -224px -128px; }
|
1216 |
+
.ui-icon-script { background-position: -240px -128px; }
|
1217 |
+
.ui-icon-alert { background-position: 0 -144px; }
|
1218 |
+
.ui-icon-info { background-position: -16px -144px; }
|
1219 |
+
.ui-icon-notice { background-position: -32px -144px; }
|
1220 |
+
.ui-icon-help { background-position: -48px -144px; }
|
1221 |
+
.ui-icon-check { background-position: -64px -144px; }
|
1222 |
+
.ui-icon-bullet { background-position: -80px -144px; }
|
1223 |
+
.ui-icon-radio-on { background-position: -96px -144px; }
|
1224 |
+
.ui-icon-radio-off { background-position: -112px -144px; }
|
1225 |
+
.ui-icon-pin-w { background-position: -128px -144px; }
|
1226 |
+
.ui-icon-pin-s { background-position: -144px -144px; }
|
1227 |
+
.ui-icon-play { background-position: 0 -160px; }
|
1228 |
+
.ui-icon-pause { background-position: -16px -160px; }
|
1229 |
+
.ui-icon-seek-next { background-position: -32px -160px; }
|
1230 |
+
.ui-icon-seek-prev { background-position: -48px -160px; }
|
1231 |
+
.ui-icon-seek-end { background-position: -64px -160px; }
|
1232 |
+
.ui-icon-seek-start { background-position: -80px -160px; }
|
1233 |
+
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
1234 |
+
.ui-icon-seek-first { background-position: -80px -160px; }
|
1235 |
+
.ui-icon-stop { background-position: -96px -160px; }
|
1236 |
+
.ui-icon-eject { background-position: -112px -160px; }
|
1237 |
+
.ui-icon-volume-off { background-position: -128px -160px; }
|
1238 |
+
.ui-icon-volume-on { background-position: -144px -160px; }
|
1239 |
+
.ui-icon-power { background-position: 0 -176px; }
|
1240 |
+
.ui-icon-signal-diag { background-position: -16px -176px; }
|
1241 |
+
.ui-icon-signal { background-position: -32px -176px; }
|
1242 |
+
.ui-icon-battery-0 { background-position: -48px -176px; }
|
1243 |
+
.ui-icon-battery-1 { background-position: -64px -176px; }
|
1244 |
+
.ui-icon-battery-2 { background-position: -80px -176px; }
|
1245 |
+
.ui-icon-battery-3 { background-position: -96px -176px; }
|
1246 |
+
.ui-icon-circle-plus { background-position: 0 -192px; }
|
1247 |
+
.ui-icon-circle-minus { background-position: -16px -192px; }
|
1248 |
+
.ui-icon-circle-close { background-position: -32px -192px; }
|
1249 |
+
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
1250 |
+
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
1251 |
+
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
1252 |
+
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
1253 |
+
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
1254 |
+
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
1255 |
+
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
1256 |
+
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
1257 |
+
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
1258 |
+
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
1259 |
+
.ui-icon-circle-check { background-position: -208px -192px; }
|
1260 |
+
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
1261 |
+
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
1262 |
+
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
1263 |
+
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
1264 |
+
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
1265 |
+
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
1266 |
+
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
1267 |
+
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
1268 |
+
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
1269 |
+
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
1270 |
+
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
1271 |
+
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
1272 |
+
|
1273 |
+
|
1274 |
+
/* Misc visuals
|
1275 |
+
----------------------------------*/
|
1276 |
+
|
1277 |
+
/* Corner radius */
|
1278 |
+
.ui-corner-all,
|
1279 |
+
.ui-corner-top,
|
1280 |
+
.ui-corner-left,
|
1281 |
+
.ui-corner-tl {
|
1282 |
+
border-top-left-radius: 3px;
|
1283 |
+
}
|
1284 |
+
.ui-corner-all,
|
1285 |
+
.ui-corner-top,
|
1286 |
+
.ui-corner-right,
|
1287 |
+
.ui-corner-tr {
|
1288 |
+
border-top-right-radius: 3px;
|
1289 |
+
}
|
1290 |
+
.ui-corner-all,
|
1291 |
+
.ui-corner-bottom,
|
1292 |
+
.ui-corner-left,
|
1293 |
+
.ui-corner-bl {
|
1294 |
+
border-bottom-left-radius: 3px;
|
1295 |
+
}
|
1296 |
+
.ui-corner-all,
|
1297 |
+
.ui-corner-bottom,
|
1298 |
+
.ui-corner-right,
|
1299 |
+
.ui-corner-br {
|
1300 |
+
border-bottom-right-radius: 3px;
|
1301 |
+
}
|
1302 |
+
|
1303 |
+
/* Overlays */
|
1304 |
+
.ui-widget-overlay {
|
1305 |
+
background: #aaaaaa;
|
1306 |
+
opacity: .3;
|
1307 |
+
filter: Alpha(Opacity=30); /* support: IE8 */
|
1308 |
+
}
|
1309 |
+
.ui-widget-shadow {
|
1310 |
+
-webkit-box-shadow: 0px 0px 5px #666666;
|
1311 |
+
box-shadow: 0px 0px 5px #666666;
|
1312 |
+
}
|
assets/css/wp-bulk-delete-admin.css
CHANGED
@@ -1,148 +1,148 @@
|
|
1 |
-
/**
|
2 |
-
* All of the CSS for your admin-specific functionality should be
|
3 |
-
* included in this file.
|
4 |
-
*/
|
5 |
-
.upgrade_to_pro{
|
6 |
-
padding-top: 100px;
|
7 |
-
padding: 15px;
|
8 |
-
border-radius: 2px;
|
9 |
-
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
10 |
-
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
11 |
-
margin-bottom: 20px;
|
12 |
-
background: url('../images/xt_logo.png') no-repeat bottom 5%right 5% #fff;
|
13 |
-
background-size: 20%;
|
14 |
-
}
|
15 |
-
.upgrade_to_pro h2{
|
16 |
-
font-size: 22px !important;
|
17 |
-
padding: 0px !important;
|
18 |
-
}
|
19 |
-
.upgrade_button{
|
20 |
-
height: 36px !important;
|
21 |
-
padding: 4px 20px !important;
|
22 |
-
font-size: 16px !important;
|
23 |
-
}
|
24 |
-
|
25 |
-
.wpbd_well{
|
26 |
-
background-color: #f9f9f9;
|
27 |
-
border: 1px solid #ccc;
|
28 |
-
padding: 8px 20px 20px 20px;
|
29 |
-
}
|
30 |
-
|
31 |
-
.plugin_box {
|
32 |
-
width: 24%;
|
33 |
-
float: left;
|
34 |
-
background-color: #fff;
|
35 |
-
border-radius: 3px;
|
36 |
-
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
37 |
-
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
38 |
-
margin-bottom: 20px;
|
39 |
-
margin-left: 0.5%;
|
40 |
-
margin-right: 0.5%;
|
41 |
-
}
|
42 |
-
|
43 |
-
.plugin_box .plugin_img{
|
44 |
-
width: 100%;
|
45 |
-
border-top-left-radius: 3px;
|
46 |
-
border-top-right-radius: 3px;
|
47 |
-
}
|
48 |
-
.plugin_box h3{
|
49 |
-
margin: 0.5em 0;
|
50 |
-
}
|
51 |
-
.plugin_box .plugin_content{
|
52 |
-
padding: 10px 10px 20px 10px;
|
53 |
-
}
|
54 |
-
@media (max-width: 1300px ){
|
55 |
-
.plugin_box {
|
56 |
-
width: 32.333%;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
@media (max-width: 1080px ){
|
60 |
-
.plugin_box {
|
61 |
-
width: 48%;
|
62 |
-
margin-left: 1%;
|
63 |
-
margin-right: 1%;
|
64 |
-
}
|
65 |
-
}
|
66 |
-
@media (max-width: 1080px ){
|
67 |
-
.plugin_box {
|
68 |
-
width: 100%;
|
69 |
-
float: none;
|
70 |
-
}
|
71 |
-
}
|
72 |
-
|
73 |
-
.chosen-container{
|
74 |
-
min-width: 260px;
|
75 |
-
}
|
76 |
-
|
77 |
-
.wpbd_inline{
|
78 |
-
display: inline;
|
79 |
-
}
|
80 |
-
|
81 |
-
.wpbd_input_days{
|
82 |
-
width: 4em;
|
83 |
-
}
|
84 |
-
|
85 |
-
.wpbd_inprogress_delete strong{
|
86 |
-
color: green;
|
87 |
-
}
|
88 |
-
|
89 |
-
|
90 |
-
.wp-bulk-delete_page_wpbd_schedule #TB_window.thickbox-loading:before {
|
91 |
-
content: "";
|
92 |
-
display: block;
|
93 |
-
width: 20px;
|
94 |
-
height: 20px;
|
95 |
-
position: absolute;
|
96 |
-
left: 50%;
|
97 |
-
top: 50%;
|
98 |
-
z-index: -1;
|
99 |
-
margin: -10px 0 0 -10px;
|
100 |
-
background: #fcfcfc url(../../../../../wp-admin/images/spinner.gif) no-repeat center;
|
101 |
-
background-size: 20px 20px;
|
102 |
-
transform: translateZ(0);
|
103 |
-
}
|
104 |
-
|
105 |
-
.wp-bulk-delete_page_wpbd_schedule #TB_window {
|
106 |
-
background: #fcfcfc;
|
107 |
-
}
|
108 |
-
|
109 |
-
.wp-bulk-delete_page_wpbd_schedule #TB_title {
|
110 |
-
float: left;
|
111 |
-
height: 1px;
|
112 |
-
}
|
113 |
-
|
114 |
-
.wp-bulk-delete_page_wpbd_schedule #TB_ajaxWindowTitle {
|
115 |
-
display: none;
|
116 |
-
}
|
117 |
-
|
118 |
-
.wp-bulk-delete_page_wpbd_schedule #TB_closeWindowButton {
|
119 |
-
left: auto;
|
120 |
-
right: -30px;
|
121 |
-
color: #eee;
|
122 |
-
}
|
123 |
-
|
124 |
-
.wp-bulk-delete_page_wpbd_schedule #TB_closeWindowButton:hover,
|
125 |
-
.wp-bulk-delete_page_wpbd_schedule #TB_closeWindowButton:focus {
|
126 |
-
color: #00a0d2;
|
127 |
-
outline: none;
|
128 |
-
box-shadow: none;
|
129 |
-
}
|
130 |
-
|
131 |
-
.wp-bulk-delete_page_wpbd_schedule .tb-close-icon {
|
132 |
-
display: none;
|
133 |
-
}
|
134 |
-
|
135 |
-
.wp-bulk-delete_page_wpbd_schedule #TB_closeWindowButton:after {
|
136 |
-
content: "\f335";
|
137 |
-
font: normal 32px/29px 'dashicons';
|
138 |
-
speak: none;
|
139 |
-
-webkit-font-smoothing: antialiased;
|
140 |
-
-moz-osx-font-smoothing: grayscale;
|
141 |
-
}
|
142 |
-
|
143 |
-
@media screen and (max-width: 830px) {
|
144 |
-
.wp-bulk-delete_page_wpbd_schedule #TB_closeWindowButton {
|
145 |
-
right: 0;
|
146 |
-
top: -30px;
|
147 |
-
}
|
148 |
}
|
1 |
+
/**
|
2 |
+
* All of the CSS for your admin-specific functionality should be
|
3 |
+
* included in this file.
|
4 |
+
*/
|
5 |
+
.upgrade_to_pro{
|
6 |
+
padding-top: 100px;
|
7 |
+
padding: 15px;
|
8 |
+
border-radius: 2px;
|
9 |
+
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
10 |
+
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
11 |
+
margin-bottom: 20px;
|
12 |
+
background: url('../images/xt_logo.png') no-repeat bottom 5%right 5% #fff;
|
13 |
+
background-size: 20%;
|
14 |
+
}
|
15 |
+
.upgrade_to_pro h2{
|
16 |
+
font-size: 22px !important;
|
17 |
+
padding: 0px !important;
|
18 |
+
}
|
19 |
+
.upgrade_button{
|
20 |
+
height: 36px !important;
|
21 |
+
padding: 4px 20px !important;
|
22 |
+
font-size: 16px !important;
|
23 |
+
}
|
24 |
+
|
25 |
+
.wpbd_well{
|
26 |
+
background-color: #f9f9f9;
|
27 |
+
border: 1px solid #ccc;
|
28 |
+
padding: 8px 20px 20px 20px;
|
29 |
+
}
|
30 |
+
|
31 |
+
.plugin_box {
|
32 |
+
width: 24%;
|
33 |
+
float: left;
|
34 |
+
background-color: #fff;
|
35 |
+
border-radius: 3px;
|
36 |
+
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
37 |
+
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
38 |
+
margin-bottom: 20px;
|
39 |
+
margin-left: 0.5%;
|
40 |
+
margin-right: 0.5%;
|
41 |
+
}
|
42 |
+
|
43 |
+
.plugin_box .plugin_img{
|
44 |
+
width: 100%;
|
45 |
+
border-top-left-radius: 3px;
|
46 |
+
border-top-right-radius: 3px;
|
47 |
+
}
|
48 |
+
.plugin_box h3{
|
49 |
+
margin: 0.5em 0;
|
50 |
+
}
|
51 |
+
.plugin_box .plugin_content{
|
52 |
+
padding: 10px 10px 20px 10px;
|
53 |
+
}
|
54 |
+
@media (max-width: 1300px ){
|
55 |
+
.plugin_box {
|
56 |
+
width: 32.333%;
|
57 |
+
}
|
58 |
+
}
|
59 |
+
@media (max-width: 1080px ){
|
60 |
+
.plugin_box {
|
61 |
+
width: 48%;
|
62 |
+
margin-left: 1%;
|
63 |
+
margin-right: 1%;
|
64 |
+
}
|
65 |
+
}
|
66 |
+
@media (max-width: 1080px ){
|
67 |
+
.plugin_box {
|
68 |
+
width: 100%;
|
69 |
+
float: none;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
.chosen-container{
|
74 |
+
min-width: 260px;
|
75 |
+
}
|
76 |
+
|
77 |
+
.wpbd_inline{
|
78 |
+
display: inline;
|
79 |
+
}
|
80 |
+
|
81 |
+
.wpbd_input_days{
|
82 |
+
width: 4em;
|
83 |
+
}
|
84 |
+
|
85 |
+
.wpbd_inprogress_delete strong{
|
86 |
+
color: green;
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
+
.wp-bulk-delete_page_wpbd_schedule #TB_window.thickbox-loading:before {
|
91 |
+
content: "";
|
92 |
+
display: block;
|
93 |
+
width: 20px;
|
94 |
+
height: 20px;
|
95 |
+
position: absolute;
|
96 |
+
left: 50%;
|
97 |
+
top: 50%;
|
98 |
+
z-index: -1;
|
99 |
+
margin: -10px 0 0 -10px;
|
100 |
+
background: #fcfcfc url(../../../../../wp-admin/images/spinner.gif) no-repeat center;
|
101 |
+
background-size: 20px 20px;
|
102 |
+
transform: translateZ(0);
|
103 |
+
}
|
104 |
+
|
105 |
+
.wp-bulk-delete_page_wpbd_schedule #TB_window {
|
106 |
+
background: #fcfcfc;
|
107 |
+
}
|
108 |
+
|
109 |
+
.wp-bulk-delete_page_wpbd_schedule #TB_title {
|
110 |
+
float: left;
|
111 |
+
height: 1px;
|
112 |
+
}
|
113 |
+
|
114 |
+
.wp-bulk-delete_page_wpbd_schedule #TB_ajaxWindowTitle {
|
115 |
+
display: none;
|
116 |
+
}
|
117 |
+
|
118 |
+
.wp-bulk-delete_page_wpbd_schedule #TB_closeWindowButton {
|
119 |
+
left: auto;
|
120 |
+
right: -30px;
|
121 |
+
color: #eee;
|
122 |
+
}
|
123 |
+
|
124 |
+
.wp-bulk-delete_page_wpbd_schedule #TB_closeWindowButton:hover,
|
125 |
+
.wp-bulk-delete_page_wpbd_schedule #TB_closeWindowButton:focus {
|
126 |
+
color: #00a0d2;
|
127 |
+
outline: none;
|
128 |
+
box-shadow: none;
|
129 |
+
}
|
130 |
+
|
131 |
+
.wp-bulk-delete_page_wpbd_schedule .tb-close-icon {
|
132 |
+
display: none;
|
133 |
+
}
|
134 |
+
|
135 |
+
.wp-bulk-delete_page_wpbd_schedule #TB_closeWindowButton:after {
|
136 |
+
content: "\f335";
|
137 |
+
font: normal 32px/29px 'dashicons';
|
138 |
+
speak: none;
|
139 |
+
-webkit-font-smoothing: antialiased;
|
140 |
+
-moz-osx-font-smoothing: grayscale;
|
141 |
+
}
|
142 |
+
|
143 |
+
@media screen and (max-width: 830px) {
|
144 |
+
.wp-bulk-delete_page_wpbd_schedule #TB_closeWindowButton {
|
145 |
+
right: 0;
|
146 |
+
top: -30px;
|
147 |
+
}
|
148 |
}
|
assets/js/chosen.jquery.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
/* Chosen v1.6.2 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
|
2 |
(function(){var a,AbstractChosen,Chosen,SelectParser,b,c={}.hasOwnProperty,d=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,title:a.title?a.title:void 0,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,group_label:null!=b?this.parsed[b].label:null,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"<",">":">",'"':""","'":"'","`":"`"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1},AbstractChosen.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.choice_label=function(a){return this.include_group_label_in_selected&&null!=a.group_label?"<b class='group-name'>"+a.group_label+"</b>"+a.html:a.html},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(a){var b=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(a){var b=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return b.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f,g,h;for(b="",e=0,h=this.results_data,f=0,g=h.length;g>f&&(c=h[f],d="",d=c.group?this.result_add_group(c):this.result_add_option(c),""!==d&&(e++,b+=d),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(c))),!(e>=this.max_shown_results));f++);return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match&&this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.result_add_group=function(a){var b,c;return(a.search_match||a.group_match)&&a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),d=0,f=this.get_search_text(),a=f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),i=new RegExp(a,"i"),c=this.get_search_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)b=l[j],b.search_match=!1,e=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(e=this.results_data[b.group_array_index],0===e.active_options&&e.search_match&&(d+=1),e.active_options+=1),b.search_text=b.group?b.label:b.html,(!b.group||this.group_search)&&(b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(d+=1),b.search_match?(f.length&&(g=b.search_text.search(i),h=b.search_text.substr(0,g+f.length)+"</em>"+b.search_text.substr(g+f.length),b.search_text=h.substr(0,g)+"<em>"+h.substr(g)),null!=e&&(e.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>d&&f.length?(this.update_results_content(""),this.no_results(f)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.get_search_regex=function(a){var b,c;return b=this.search_contains?"":"^",c=this.case_sensitive_search?"":"i",new RegExp(b+a,c)},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:case 18:break;default:return this.results_search()}},AbstractChosen.prototype.clipboard_event_checker=function(a){var b=this;return setTimeout(function(){return b.results_search()},50)},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},AbstractChosen.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},AbstractChosen.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},AbstractChosen.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},AbstractChosen.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent)?!1:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),a=jQuery,a.fn.extend({chosen:function(b){return AbstractChosen.browser_is_supported()?this.each(function(c){var d,e;return d=a(this),e=d.data("chosen"),"destroy"===b?void(e instanceof Chosen&&e.destroy()):void(e instanceof Chosen||d.data("chosen",new Chosen(this,b)))}):this}}),Chosen=function(c){function Chosen(){return b=Chosen.__super__.constructor.apply(this,arguments)}return d(Chosen,c),Chosen.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},Chosen.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",c),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):this.container.html('<a class="chosen-single chosen-default"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.bind("touchstart.chosen",function(b){return a.container_mousedown(b),b.preventDefault()}),this.container.bind("touchend.chosen",function(b){return a.container_mouseup(b),b.preventDefault()}),this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},Chosen.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},Chosen.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=a.originalEvent.deltaY||-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},Chosen.prototype.blur_test=function(a){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},Chosen.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},Chosen.prototype.update_results_content=function(a){return this.search_results.html(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(a){var b;return this.form_field.tabIndex?(b=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=b):void 0},Chosen.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},Chosen.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},Chosen.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(b){var c,d,e=this;return c=a("<li />",{"class":"search-choice"}).html("<span>"+this.choice_label(b)+"</span>"),b.disabled?c.addClass("search-choice-disabled"):(d=a("<a />",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},Chosen.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},Chosen.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),b.addClass("result-selected"),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(this.choice_label(c)),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.show_search_field_default(),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,a.preventDefault(),this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return a("<div/>").text(a.trim(this.search_field.val())).html()},Chosen.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("<div />",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},Chosen}(AbstractChosen)}).call(this);
|
1 |
+
/* Chosen v1.6.2 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
|
2 |
(function(){var a,AbstractChosen,Chosen,SelectParser,b,c={}.hasOwnProperty,d=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,title:a.title?a.title:void 0,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,group_label:null!=b?this.parsed[b].label:null,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"<",">":">",'"':""","'":"'","`":"`"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1},AbstractChosen.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.choice_label=function(a){return this.include_group_label_in_selected&&null!=a.group_label?"<b class='group-name'>"+a.group_label+"</b>"+a.html:a.html},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(a){var b=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(a){var b=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return b.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f,g,h;for(b="",e=0,h=this.results_data,f=0,g=h.length;g>f&&(c=h[f],d="",d=c.group?this.result_add_group(c):this.result_add_option(c),""!==d&&(e++,b+=d),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(c))),!(e>=this.max_shown_results));f++);return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match&&this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.result_add_group=function(a){var b,c;return(a.search_match||a.group_match)&&a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),d=0,f=this.get_search_text(),a=f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),i=new RegExp(a,"i"),c=this.get_search_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)b=l[j],b.search_match=!1,e=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(e=this.results_data[b.group_array_index],0===e.active_options&&e.search_match&&(d+=1),e.active_options+=1),b.search_text=b.group?b.label:b.html,(!b.group||this.group_search)&&(b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(d+=1),b.search_match?(f.length&&(g=b.search_text.search(i),h=b.search_text.substr(0,g+f.length)+"</em>"+b.search_text.substr(g+f.length),b.search_text=h.substr(0,g)+"<em>"+h.substr(g)),null!=e&&(e.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>d&&f.length?(this.update_results_content(""),this.no_results(f)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.get_search_regex=function(a){var b,c;return b=this.search_contains?"":"^",c=this.case_sensitive_search?"":"i",new RegExp(b+a,c)},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:case 18:break;default:return this.results_search()}},AbstractChosen.prototype.clipboard_event_checker=function(a){var b=this;return setTimeout(function(){return b.results_search()},50)},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},AbstractChosen.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},AbstractChosen.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},AbstractChosen.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},AbstractChosen.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent)?!1:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),a=jQuery,a.fn.extend({chosen:function(b){return AbstractChosen.browser_is_supported()?this.each(function(c){var d,e;return d=a(this),e=d.data("chosen"),"destroy"===b?void(e instanceof Chosen&&e.destroy()):void(e instanceof Chosen||d.data("chosen",new Chosen(this,b)))}):this}}),Chosen=function(c){function Chosen(){return b=Chosen.__super__.constructor.apply(this,arguments)}return d(Chosen,c),Chosen.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},Chosen.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",c),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):this.container.html('<a class="chosen-single chosen-default"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.bind("touchstart.chosen",function(b){return a.container_mousedown(b),b.preventDefault()}),this.container.bind("touchend.chosen",function(b){return a.container_mouseup(b),b.preventDefault()}),this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},Chosen.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},Chosen.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=a.originalEvent.deltaY||-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},Chosen.prototype.blur_test=function(a){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},Chosen.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},Chosen.prototype.update_results_content=function(a){return this.search_results.html(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(a){var b;return this.form_field.tabIndex?(b=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=b):void 0},Chosen.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},Chosen.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},Chosen.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(b){var c,d,e=this;return c=a("<li />",{"class":"search-choice"}).html("<span>"+this.choice_label(b)+"</span>"),b.disabled?c.addClass("search-choice-disabled"):(d=a("<a />",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},Chosen.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},Chosen.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),b.addClass("result-selected"),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(this.choice_label(c)),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.show_search_field_default(),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,a.preventDefault(),this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return a("<div/>").text(a.trim(this.search_field.val())).html()},Chosen.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("<div />",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},Chosen}(AbstractChosen)}).call(this);
|
assets/js/jquery-ui-timepicker-addon.min.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
|
2 |
-
* http://trentrichardson.com/examples/timepicker
|
3 |
-
* Copyright (c) 2016 Trent Richardson; Licensed MIT */
|
4 |
-
!function(a){"function"==typeof define&&define.amd?define(["jquery","jquery-ui"],a):a(jQuery)}(function($){if($.ui.timepicker=$.ui.timepicker||{},!$.ui.timepicker.version){$.extend($.ui,{timepicker:{version:"1.6.3"}});var Timepicker=function(){this.regional=[],this.regional[""]={currentText:"Now",closeText:"Done",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"HH:mm",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",microsecText:"Microsecond",timezoneText:"Time Zone",isRTL:!1},this._defaults={showButtonPanel:!0,timeOnly:!1,timeOnlyShowDate:!1,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:!0,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,stepMicrosec:1,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,microsecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,microsecMax:999,minDateTime:null,maxDateTime:null,maxTime:null,minTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,microsecGrid:0,alwaysSetTime:!0,separator:" ",altFieldTimeOnly:!0,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,altRedirectFocus:!0,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:!0,timezoneList:null,addSliderAccess:!1,sliderAccessArgs:null,controlType:"slider",oneLine:!1,defaultValue:null,parse:"strict",afterInject:null},$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,maxTime:null,minTime:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_newInst:function($input,opts){var tp_inst=new Timepicker,inlineSettings={},fns={},overrides,i;for(var attrName in this._defaults)if(this._defaults.hasOwnProperty(attrName)){var attrValue=$input.attr("time:"+attrName);if(attrValue)try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}overrides={beforeShow:function(a,b){return $.isFunction(tp_inst._defaults.evnts.beforeShow)?tp_inst._defaults.evnts.beforeShow.call($input[0],a,b,tp_inst):void 0},onChangeMonthYear:function(a,b,c){$.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)&&tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],a,b,c,tp_inst)},onClose:function(a,b){tp_inst.timeDefined===!0&&""!==$input.val()&&tp_inst._updateDateTime(b),$.isFunction(tp_inst._defaults.evnts.onClose)&&tp_inst._defaults.evnts.onClose.call($input[0],a,b,tp_inst)}};for(i in overrides)overrides.hasOwnProperty(i)&&(fns[i]=opts[i]||this._defaults[i]||null);tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst}),tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(a){return a.toUpperCase()}),tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(a){return a.toUpperCase()}),tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:"")),"string"==typeof tp_inst._defaults.controlType?("slider"===tp_inst._defaults.controlType&&"undefined"==typeof $.ui.slider&&(tp_inst._defaults.controlType="select"),tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]):tp_inst.control=tp_inst._defaults.controlType;var timezoneList=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-270,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,525,540,570,600,630,660,690,720,765,780,840];null!==tp_inst._defaults.timezoneList&&(timezoneList=tp_inst._defaults.timezoneList);var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&"object"!=typeof timezoneList[0])for(;tzl>tzi;tzi++)tzv=timezoneList[tzi],timezoneList[tzi]={value:tzv,label:$.timepicker.timezoneOffsetString(tzv,tp_inst.support.iso8601)};return tp_inst._defaults.timezoneList=timezoneList,tp_inst.timezone=null!==tp_inst._defaults.timezone?$.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone):-1*(new Date).getTimezoneOffset(),tp_inst.hour=tp_inst._defaults.hour<tp_inst._defaults.hourMin?tp_inst._defaults.hourMin:tp_inst._defaults.hour>tp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour,tp_inst.minute=tp_inst._defaults.minute<tp_inst._defaults.minuteMin?tp_inst._defaults.minuteMin:tp_inst._defaults.minute>tp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute,tp_inst.second=tp_inst._defaults.second<tp_inst._defaults.secondMin?tp_inst._defaults.secondMin:tp_inst._defaults.second>tp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second,tp_inst.millisec=tp_inst._defaults.millisec<tp_inst._defaults.millisecMin?tp_inst._defaults.millisecMin:tp_inst._defaults.millisec>tp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec,tp_inst.microsec=tp_inst._defaults.microsec<tp_inst._defaults.microsecMin?tp_inst._defaults.microsecMin:tp_inst._defaults.microsec>tp_inst._defaults.microsecMax?tp_inst._defaults.microsecMax:tp_inst._defaults.microsec,tp_inst.ampm="",tp_inst.$input=$input,tp_inst._defaults.altField&&(tp_inst.$altInput=$(tp_inst._defaults.altField),tp_inst._defaults.altRedirectFocus===!0&&tp_inst.$altInput.css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})),(0===tp_inst._defaults.minDate||0===tp_inst._defaults.minDateTime)&&(tp_inst._defaults.minDate=new Date),(0===tp_inst._defaults.maxDate||0===tp_inst._defaults.maxDateTime)&&(tp_inst._defaults.maxDate=new Date),void 0!==tp_inst._defaults.minDate&&tp_inst._defaults.minDate instanceof Date&&(tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())),void 0!==tp_inst._defaults.minDateTime&&tp_inst._defaults.minDateTime instanceof Date&&(tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())),void 0!==tp_inst._defaults.maxDate&&tp_inst._defaults.maxDate instanceof Date&&(tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())),void 0!==tp_inst._defaults.maxDateTime&&tp_inst._defaults.maxDateTime instanceof Date&&(tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())),tp_inst.$input.bind("focus",function(){tp_inst._onFocus()}),tp_inst},_addTimePicker:function(a){var b=$.trim(this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val());this.timeDefined=this._parseTime(b),this._limitMinMaxDateTime(a,!1),this._injectTimePicker(),this._afterInject()},_parseTime:function(a,b){if(this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),b||!this._defaults.timeOnly){var c=$.datepicker._get(this.inst,"dateFormat");try{var d=parseDateTimeInternal(c,this._defaults.timeFormat,a,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!d.timeObj)return!1;$.extend(this,d.timeObj)}catch(e){return $.timepicker.log("Error parsing the date/time string: "+e+"\ndate/time string = "+a+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+c),!1}return!0}var f=$.datepicker.parseTime(this._defaults.timeFormat,a,this._defaults);return f?($.extend(this,f),!0):!1},_afterInject:function(){var a=this.inst.settings;$.isFunction(a.afterInject)&&a.afterInject.call(this)},_injectTimePicker:function(){var a=this.inst.dpDiv,b=this.inst.settings,c=this,d="",e="",f=null,g={},h={},i=null,j=0,k=0;if(0===a.find("div.ui-timepicker-div").length&&b.showTimepicker){var l=" ui_tpicker_unit_hide",m='<div class="ui-timepicker-div'+(b.isRTL?" ui-timepicker-rtl":"")+(b.oneLine&&"select"===b.controlType?" ui-timepicker-oneLine":"")+'"><dl><dt class="ui_tpicker_time_label'+(b.showTime?"":l)+'">'+b.timeText+'</dt><dd class="ui_tpicker_time '+(b.showTime?"":l)+'"><input class="ui_tpicker_time_input" '+(b.timeInput?"":"disabled")+"/></dd>";for(j=0,k=this.units.length;k>j;j++){if(d=this.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],g[d]=parseInt(b[d+"Max"]-(b[d+"Max"]-b[d+"Min"])%b["step"+e],10),h[d]=0,m+='<dt class="ui_tpicker_'+d+"_label"+(f?"":l)+'">'+b[d+"Text"]+'</dt><dd class="ui_tpicker_'+d+(f?"":l)+'"><div class="ui_tpicker_'+d+"_slider"+(f?"":l)+'"></div>',f&&b[d+"Grid"]>0){if(m+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>',"hour"===d)for(var n=b[d+"Min"];n<=g[d];n+=parseInt(b[d+"Grid"],10)){h[d]++;var o=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:n},b);m+='<td data-for="'+d+'">'+o+"</td>"}else for(var p=b[d+"Min"];p<=g[d];p+=parseInt(b[d+"Grid"],10))h[d]++,m+='<td data-for="'+d+'">'+(10>p?"0":"")+p+"</td>";m+="</tr></table></div>"}m+="</dd>"}var q=null!==b.showTimezone?b.showTimezone:this.support.timezone;m+='<dt class="ui_tpicker_timezone_label'+(q?"":l)+'">'+b.timezoneText+"</dt>",m+='<dd class="ui_tpicker_timezone'+(q?"":l)+'"></dd>',m+="</dl></div>";var r=$(m);for(b.timeOnly===!0&&(r.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+b.timeOnlyTitle+"</div></div>"),a.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()),j=0,k=c.units.length;k>j;j++)d=c.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],c[d+"_slider"]=c.control.create(c,r.find(".ui_tpicker_"+d+"_slider"),d,c[d],b[d+"Min"],g[d],b["step"+e]),f&&b[d+"Grid"]>0&&(i=100*h[d]*b[d+"Grid"]/(g[d]-b[d+"Min"]),r.find(".ui_tpicker_"+d+" table").css({width:i+"%",marginLeft:b.isRTL?"0":i/(-2*h[d])+"%",marginRight:b.isRTL?i/(-2*h[d])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(a){var b=$(this),e=b.html(),f=parseInt(e.replace(/[^0-9]/g),10),g=e.replace(/[^apm]/gi),h=b.data("for");"hour"===h&&(-1!==g.indexOf("p")&&12>f?f+=12:-1!==g.indexOf("a")&&12===f&&(f=0)),c.control.value(c,c[h+"_slider"],d,f),c._onTimeChange(),c._onSelectHandler()}).css({cursor:"pointer",width:100/h[d]+"%",textAlign:"center",overflow:"hidden"}));if(this.timezone_select=r.find(".ui_tpicker_timezone").append("<select></select>").find("select"),$.fn.append.apply(this.timezone_select,$.map(b.timezoneList,function(a,b){return $("<option />").val("object"==typeof a?a.value:a).text("object"==typeof a?a.label:a)})),"undefined"!=typeof this.timezone&&null!==this.timezone&&""!==this.timezone){var s=-1*new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12).getTimezoneOffset();s===this.timezone?selectLocalTimezone(c):this.timezone_select.val(this.timezone)}else"undefined"!=typeof this.hour&&null!==this.hour&&""!==this.hour?this.timezone_select.val(b.timezone):selectLocalTimezone(c);this.timezone_select.change(function(){c._onTimeChange(),c._onSelectHandler(),c._afterInject()});var t=a.find(".ui-datepicker-buttonpane");if(t.length?t.before(r):a.append(r),this.$timeObj=r.find(".ui_tpicker_time_input"),this.$timeObj.change(function(){var a=c.inst.settings.timeFormat,b=$.datepicker.parseTime(a,this.value),d=new Date;b?(d.setHours(b.hour),d.setMinutes(b.minute),d.setSeconds(b.second),$.datepicker._setTime(c.inst,d)):(this.value=c.formattedTime,this.blur())}),null!==this.inst){var u=this.timeDefined;this._onTimeChange(),this.timeDefined=u}if(this._defaults.addSliderAccess){var v=this._defaults.sliderAccessArgs,w=this._defaults.isRTL;v.isRTL=w,setTimeout(function(){if(0===r.find(".ui-slider-access").length){r.find(".ui-slider:visible").sliderAccess(v);var a=r.find(".ui-slider-access:eq(0)").outerWidth(!0);a&&r.find("table:visible").each(function(){var b=$(this),c=b.outerWidth(),d=b.css(w?"marginRight":"marginLeft").toString().replace("%",""),e=c-a,f=d*e/c+"%",g={width:e,marginRight:0,marginLeft:0};g[w?"marginRight":"marginLeft"]=f,b.css(g)})}},10)}c._limitMinMaxDateTime(this.inst,!0)}},_limitMinMaxDateTime:function(a,b){var c=this._defaults,d=new Date(a.selectedYear,a.selectedMonth,a.selectedDay);if(this._defaults.showTimepicker){if(null!==$.datepicker._get(a,"minDateTime")&&void 0!==$.datepicker._get(a,"minDateTime")&&d){var e=$.datepicker._get(a,"minDateTime"),f=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0);(null===this.hourMinOriginal||null===this.minuteMinOriginal||null===this.secondMinOriginal||null===this.millisecMinOriginal||null===this.microsecMinOriginal)&&(this.hourMinOriginal=c.hourMin,this.minuteMinOriginal=c.minuteMin,this.secondMinOriginal=c.secondMin,this.millisecMinOriginal=c.millisecMin,this.microsecMinOriginal=c.microsecMin),a.settings.timeOnly||f.getTime()===d.getTime()?(this._defaults.hourMin=e.getHours(),this.hour<=this._defaults.hourMin?(this.hour=this._defaults.hourMin,this._defaults.minuteMin=e.getMinutes(),this.minute<=this._defaults.minuteMin?(this.minute=this._defaults.minuteMin,this._defaults.secondMin=e.getSeconds(),this.second<=this._defaults.secondMin?(this.second=this._defaults.secondMin,this._defaults.millisecMin=e.getMilliseconds(),this.millisec<=this._defaults.millisecMin?(this.millisec=this._defaults.millisecMin,this._defaults.microsecMin=e.getMicroseconds()):(this.microsec<this._defaults.microsecMin&&(this.microsec=this._defaults.microsecMin),this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.hourMin=this.hourMinOriginal,this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)}if(null!==$.datepicker._get(a,"maxDateTime")&&void 0!==$.datepicker._get(a,"maxDateTime")&&d){var g=$.datepicker._get(a,"maxDateTime"),h=new Date(g.getFullYear(),g.getMonth(),g.getDate(),0,0,0,0);(null===this.hourMaxOriginal||null===this.minuteMaxOriginal||null===this.secondMaxOriginal||null===this.millisecMaxOriginal)&&(this.hourMaxOriginal=c.hourMax,this.minuteMaxOriginal=c.minuteMax,this.secondMaxOriginal=c.secondMax,this.millisecMaxOriginal=c.millisecMax,this.microsecMaxOriginal=c.microsecMax),a.settings.timeOnly||h.getTime()===d.getTime()?(this._defaults.hourMax=g.getHours(),this.hour>=this._defaults.hourMax?(this.hour=this._defaults.hourMax,this._defaults.minuteMax=g.getMinutes(),this.minute>=this._defaults.minuteMax?(this.minute=this._defaults.minuteMax,this._defaults.secondMax=g.getSeconds(),this.second>=this._defaults.secondMax?(this.second=this._defaults.secondMax,this._defaults.millisecMax=g.getMilliseconds(),this.millisec>=this._defaults.millisecMax?(this.millisec=this._defaults.millisecMax,this._defaults.microsecMax=g.getMicroseconds()):(this.microsec>this._defaults.microsecMax&&(this.microsec=this._defaults.microsecMax),this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.hourMax=this.hourMaxOriginal,this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)}if(null!==a.settings.minTime){var i=new Date("01/01/1970 "+a.settings.minTime);this.hour<i.getHours()?(this.hour=this._defaults.hourMin=i.getHours(),this.minute=this._defaults.minuteMin=i.getMinutes()):this.hour===i.getHours()&&this.minute<i.getMinutes()?this.minute=this._defaults.minuteMin=i.getMinutes():this._defaults.hourMin<i.getHours()?(this._defaults.hourMin=i.getHours(),this._defaults.minuteMin=i.getMinutes()):this._defaults.hourMin===i.getHours()===this.hour&&this._defaults.minuteMin<i.getMinutes()?this._defaults.minuteMin=i.getMinutes():this._defaults.minuteMin=0}if(null!==a.settings.maxTime){var j=new Date("01/01/1970 "+a.settings.maxTime);this.hour>j.getHours()?(this.hour=this._defaults.hourMax=j.getHours(),this.minute=this._defaults.minuteMax=j.getMinutes()):this.hour===j.getHours()&&this.minute>j.getMinutes()?this.minute=this._defaults.minuteMax=j.getMinutes():this._defaults.hourMax>j.getHours()?(this._defaults.hourMax=j.getHours(),this._defaults.minuteMax=j.getMinutes()):this._defaults.hourMax===j.getHours()===this.hour&&this._defaults.minuteMax>j.getMinutes()?this._defaults.minuteMax=j.getMinutes():this._defaults.minuteMax=59}if(void 0!==b&&b===!0){var k=parseInt(this._defaults.hourMax-(this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour,10),l=parseInt(this._defaults.minuteMax-(this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute,10),m=parseInt(this._defaults.secondMax-(this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond,10),n=parseInt(this._defaults.millisecMax-(this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec,10),o=parseInt(this._defaults.microsecMax-(this._defaults.microsecMax-this._defaults.microsecMin)%this._defaults.stepMicrosec,10);this.hour_slider&&(this.control.options(this,this.hour_slider,"hour",{min:this._defaults.hourMin,max:k,step:this._defaults.stepHour}),this.control.value(this,this.hour_slider,"hour",this.hour-this.hour%this._defaults.stepHour)),this.minute_slider&&(this.control.options(this,this.minute_slider,"minute",{min:this._defaults.minuteMin,max:l,step:this._defaults.stepMinute}),this.control.value(this,this.minute_slider,"minute",this.minute-this.minute%this._defaults.stepMinute)),this.second_slider&&(this.control.options(this,this.second_slider,"second",{min:this._defaults.secondMin,max:m,step:this._defaults.stepSecond}),this.control.value(this,this.second_slider,"second",this.second-this.second%this._defaults.stepSecond)),this.millisec_slider&&(this.control.options(this,this.millisec_slider,"millisec",{min:this._defaults.millisecMin,max:n,step:this._defaults.stepMillisec}),this.control.value(this,this.millisec_slider,"millisec",this.millisec-this.millisec%this._defaults.stepMillisec)),this.microsec_slider&&(this.control.options(this,this.microsec_slider,"microsec",{min:this._defaults.microsecMin,max:o,step:this._defaults.stepMicrosec}),this.control.value(this,this.microsec_slider,"microsec",this.microsec-this.microsec%this._defaults.stepMicrosec))}}},_onTimeChange:function(){if(this._defaults.showTimepicker){var a=this.hour_slider?this.control.value(this,this.hour_slider,"hour"):!1,b=this.minute_slider?this.control.value(this,this.minute_slider,"minute"):!1,c=this.second_slider?this.control.value(this,this.second_slider,"second"):!1,d=this.millisec_slider?this.control.value(this,this.millisec_slider,"millisec"):!1,e=this.microsec_slider?this.control.value(this,this.microsec_slider,"microsec"):!1,f=this.timezone_select?this.timezone_select.val():!1,g=this._defaults,h=g.pickerTimeFormat||g.timeFormat,i=g.pickerTimeSuffix||g.timeSuffix;"object"==typeof a&&(a=!1),"object"==typeof b&&(b=!1),"object"==typeof c&&(c=!1),"object"==typeof d&&(d=!1),"object"==typeof e&&(e=!1),"object"==typeof f&&(f=!1),a!==!1&&(a=parseInt(a,10)),b!==!1&&(b=parseInt(b,10)),c!==!1&&(c=parseInt(c,10)),d!==!1&&(d=parseInt(d,10)),e!==!1&&(e=parseInt(e,10)),f!==!1&&(f=f.toString());var j=g[12>a?"amNames":"pmNames"][0],k=a!==parseInt(this.hour,10)||b!==parseInt(this.minute,10)||c!==parseInt(this.second,10)||d!==parseInt(this.millisec,10)||e!==parseInt(this.microsec,10)||this.ampm.length>0&&12>a!=(-1!==$.inArray(this.ampm.toUpperCase(),this.amNames))||null!==this.timezone&&f!==this.timezone.toString();if(k&&(a!==!1&&(this.hour=a),b!==!1&&(this.minute=b),c!==!1&&(this.second=c),d!==!1&&(this.millisec=d),e!==!1&&(this.microsec=e),f!==!1&&(this.timezone=f),this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),this._limitMinMaxDateTime(this.inst,!0)),this.support.ampm&&(this.ampm=j),this.formattedTime=$.datepicker.formatTime(g.timeFormat,this,g),this.$timeObj&&(this.$timeObj.val(h===g.timeFormat?this.formattedTime+i:$.datepicker.formatTime(h,this,g)+i),this.$timeObj[0].setSelectionRange)){var l=this.$timeObj[0].selectionStart,m=this.$timeObj[0].selectionEnd;this.$timeObj[0].setSelectionRange(l,m)}this.timeDefined=!0,k&&this._updateDateTime()}},_onSelectHandler:function(){var a=this._defaults.onSelect||this.inst.settings.onSelect,b=this.$input?this.$input[0]:null;a&&b&&a.apply(b,[this.formattedDateTime,this])},_updateDateTime:function(a){a=this.inst||a;var b=a.currentYear>0?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(a.selectedYear,a.selectedMonth,a.selectedDay),c=$.datepicker._daylightSavingAdjust(b),d=$.datepicker._get(a,"dateFormat"),e=$.datepicker._getFormatConfig(a),f=null!==c&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(d,null===c?new Date:c,e);var g=this.formattedDate;if(""===a.lastVal&&(a.currentYear=a.selectedYear,a.currentMonth=a.selectedMonth,a.currentDay=a.selectedDay),this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!1?g=this.formattedTime:(this._defaults.timeOnly!==!0&&(this._defaults.alwaysSetTime||f)||this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!0)&&(g+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix),this.formattedDateTime=g,this._defaults.showTimepicker)if(this.$altInput&&this._defaults.timeOnly===!1&&this._defaults.altFieldTimeOnly===!0)this.$altInput.val(this.formattedTime),this.$input.val(this.formattedDate);else if(this.$altInput){this.$input.val(g);var h="",i=null!==this._defaults.altSeparator?this._defaults.altSeparator:this._defaults.separator,j=null!==this._defaults.altTimeSuffix?this._defaults.altTimeSuffix:this._defaults.timeSuffix;this._defaults.timeOnly||(h=this._defaults.altFormat?$.datepicker.formatDate(this._defaults.altFormat,null===c?new Date:c,e):this.formattedDate,h&&(h+=i)),h+=null!==this._defaults.altTimeFormat?$.datepicker.formatTime(this._defaults.altTimeFormat,this,this._defaults)+j:this.formattedTime+j,this.$altInput.val(h)}else this.$input.val(g);else this.$input.val(this.formattedDate);this.$input.trigger("change")},_onFocus:function(){if(!this.$input.val()&&this._defaults.defaultValue){this.$input.val(this._defaults.defaultValue);var a=$.datepicker._getInst(this.$input.get(0)),b=$.datepicker._get(a,"timepicker");if(b&&b._defaults.timeOnly&&a.input.val()!==a.lastVal)try{$.datepicker._updateDatepicker(a)}catch(c){$.timepicker.log(c)}}},_controls:{slider:{create:function(a,b,c,d,e,f,g){var h=a._defaults.isRTL;return b.prop("slide",null).slider({orientation:"horizontal",value:h?-1*d:d,min:h?-1*f:e,max:h?-1*e:f,step:g,slide:function(b,d){a.control.value(a,$(this),c,h?-1*d.value:d.value),a._onTimeChange()},stop:function(b,c){a._onSelectHandler()}})},options:function(a,b,c,d,e){if(a._defaults.isRTL){if("string"==typeof d)return"min"===d||"max"===d?void 0!==e?b.slider(d,-1*e):Math.abs(b.slider(d)):b.slider(d);var f=d.min,g=d.max;return d.min=d.max=null,void 0!==f&&(d.max=-1*f),void 0!==g&&(d.min=-1*g),b.slider(d)}return"string"==typeof d&&void 0!==e?b.slider(d,e):b.slider(d)},value:function(a,b,c,d){return a._defaults.isRTL?void 0!==d?b.slider("value",-1*d):Math.abs(b.slider("value")):void 0!==d?b.slider("value",d):b.slider("value")}},select:{create:function(a,b,c,d,e,f,g){for(var h='<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="'+c+'" data-min="'+e+'" data-max="'+f+'" data-step="'+g+'">',i=a._defaults.pickerTimeFormat||a._defaults.timeFormat,j=e;f>=j;j+=g)h+='<option value="'+j+'"'+(j===d?" selected":"")+">",h+="hour"===c?$.datepicker.formatTime($.trim(i.replace(/[^ht ]/gi,"")),{hour:j},a._defaults):"millisec"===c||"microsec"===c||j>=10?j:"0"+j.toString(),h+="</option>";return h+="</select>",b.children("select").remove(),$(h).appendTo(b).change(function(b){a._onTimeChange(),a._onSelectHandler(),a._afterInject()}),b},options:function(a,b,c,d,e){var f={},g=b.children("select");if("string"==typeof d){if(void 0===e)return g.data(d);f[d]=e}else f=d;return a.control.create(a,b,g.data("unit"),g.val(),f.min>=0?f.min:g.data("min"),f.max||g.data("max"),f.step||g.data("step"))},value:function(a,b,c,d){var e=b.children("select");return void 0!==d?e.val(d):e.val()}}}}),$.fn.extend({timepicker:function(a){a=a||{};var b=Array.prototype.slice.call(arguments);return"object"==typeof a&&(b[0]=$.extend(a,{timeOnly:!0})),$(this).each(function(){$.fn.datetimepicker.apply($(this),b)})},datetimepicker:function(a){a=a||{};var b=arguments;return"string"==typeof a?"getDate"===a||"option"===a&&2===b.length&&"string"==typeof b[1]?$.fn.datepicker.apply($(this[0]),b):this.each(function(){var a=$(this);a.datepicker.apply(a,b)}):this.each(function(){var b=$(this);b.datepicker($.timepicker._newInst(b,a)._defaults)})}}),$.datepicker.parseDateTime=function(a,b,c,d,e){var f=parseDateTimeInternal(a,b,c,d,e);if(f.timeObj){var g=f.timeObj;f.date.setHours(g.hour,g.minute,g.second,g.millisec),f.date.setMicroseconds(g.microsec)}return f.date},$.datepicker.parseTime=function(a,b,c){var d=extendRemove(extendRemove({},$.timepicker._defaults),c||{}),e=(-1!==a.replace(/\'.*?\'/g,"").indexOf("Z"),function(a,b,c){var d,e=function(a,b){var c=[];return a&&$.merge(c,a),b&&$.merge(c,b),c=$.map(c,function(a){return a.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")}),"("+c.join("|")+")?"},f=function(a){var b=a.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),c={h:-1,m:-1,s:-1,l:-1,c:-1,t:-1,z:-1};if(b)for(var d=0;d<b.length;d++)-1===c[b[d].toString().charAt(0)]&&(c[b[d].toString().charAt(0)]=d+1);return c},g="^"+a.toString().replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(a){var b=a.length;switch(a.charAt(0).toLowerCase()){case"h":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"m":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"s":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"l":return"(\\d?\\d?\\d)";case"c":return"(\\d?\\d?\\d)";case"z":return"(z|[-+]\\d\\d:?\\d\\d|\\S+)?";case"t":return e(c.amNames,c.pmNames);default:return"("+a.replace(/\'/g,"").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g,function(a){return"\\"+a})+")?"}}).replace(/\s/g,"\\s?")+c.timeSuffix+"$",h=f(a),i="";d=b.match(new RegExp(g,"i"));var j={hour:0,minute:0,second:0,millisec:0,microsec:0};return d?(-1!==h.t&&(void 0===d[h.t]||0===d[h.t].length?(i="",j.ampm=""):(i=-1!==$.inArray(d[h.t].toUpperCase(),$.map(c.amNames,function(a,b){return a.toUpperCase()}))?"AM":"PM",j.ampm=c["AM"===i?"amNames":"pmNames"][0])),-1!==h.h&&("AM"===i&&"12"===d[h.h]?j.hour=0:"PM"===i&&"12"!==d[h.h]?j.hour=parseInt(d[h.h],10)+12:j.hour=Number(d[h.h])),-1!==h.m&&(j.minute=Number(d[h.m])),-1!==h.s&&(j.second=Number(d[h.s])),-1!==h.l&&(j.millisec=Number(d[h.l])),-1!==h.c&&(j.microsec=Number(d[h.c])),-1!==h.z&&void 0!==d[h.z]&&(j.timezone=$.timepicker.timezoneOffsetNumber(d[h.z])),j):!1}),f=function(a,b,c){try{var d=new Date("2012-01-01 "+b);if(isNaN(d.getTime())&&(d=new Date("2012-01-01T"+b),isNaN(d.getTime())&&(d=new Date("01/01/2012 "+b),isNaN(d.getTime()))))throw"Unable to parse time with native Date: "+b;return{hour:d.getHours(),minute:d.getMinutes(),second:d.getSeconds(),millisec:d.getMilliseconds(),microsec:d.getMicroseconds(),timezone:-1*d.getTimezoneOffset()}}catch(f){try{return e(a,b,c)}catch(g){$.timepicker.log("Unable to parse \ntimeString: "+b+"\ntimeFormat: "+a)}}return!1};return"function"==typeof d.parse?d.parse(a,b,d):"loose"===d.parse?f(a,b,d):e(a,b,d)},$.datepicker.formatTime=function(a,b,c){c=c||{},c=$.extend({},$.timepicker._defaults,c),b=$.extend({hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null},b);var d=a,e=c.amNames[0],f=parseInt(b.hour,10);return f>11&&(e=c.pmNames[0]),d=d.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(a){switch(a){case"HH":return("0"+f).slice(-2);case"H":return f;case"hh":return("0"+convert24to12(f)).slice(-2);case"h":return convert24to12(f);case"mm":return("0"+b.minute).slice(-2);case"m":return b.minute;case"ss":return("0"+b.second).slice(-2);case"s":return b.second;case"l":return("00"+b.millisec).slice(-3);case"c":return("00"+b.microsec).slice(-3);case"z":return $.timepicker.timezoneOffsetString(null===b.timezone?c.timezone:b.timezone,!1);case"Z":return $.timepicker.timezoneOffsetString(null===b.timezone?c.timezone:b.timezone,!0);case"T":return e.charAt(0).toUpperCase();case"TT":return e.toUpperCase();case"t":return e.charAt(0).toLowerCase();case"tt":return e.toLowerCase();default:return a.replace(/'/g,"")}})},$.datepicker._base_selectDate=$.datepicker._selectDate,$.datepicker._selectDate=function(a,b){var c,d=this._getInst($(a)[0]),e=this._get(d,"timepicker");e&&d.settings.showTimepicker?(e._limitMinMaxDateTime(d,!0),c=d.inline,d.inline=d.stay_open=!0,this._base_selectDate(a,b),d.inline=c,d.stay_open=!1,this._notifyChange(d),this._updateDatepicker(d)):this._base_selectDate(a,b)},$.datepicker._base_updateDatepicker=$.datepicker._updateDatepicker,$.datepicker._updateDatepicker=function(a){var b=a.input[0];if(!($.datepicker._curInst&&$.datepicker._curInst!==a&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!==b||"boolean"==typeof a.stay_open&&a.stay_open!==!1)){this._base_updateDatepicker(a);var c=this._get(a,"timepicker");c&&c._addTimePicker(a)}},$.datepicker._base_doKeyPress=$.datepicker._doKeyPress,$.datepicker._doKeyPress=function(a){var b=$.datepicker._getInst(a.target),c=$.datepicker._get(b,"timepicker");if(c&&$.datepicker._get(b,"constrainInput")){var d=c.support.ampm,e=null!==c._defaults.showTimezone?c._defaults.showTimezone:c.support.timezone,f=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),g=c._defaults.timeFormat.toString().replace(/[hms]/g,"").replace(/TT/g,d?"APM":"").replace(/Tt/g,d?"AaPpMm":"").replace(/tT/g,d?"AaPpMm":"").replace(/T/g,d?"AP":"").replace(/tt/g,d?"apm":"").replace(/t/g,d?"ap":"")+" "+c._defaults.separator+c._defaults.timeSuffix+(e?c._defaults.timezoneList.join(""):"")+c._defaults.amNames.join("")+c._defaults.pmNames.join("")+f,h=String.fromCharCode(void 0===a.charCode?a.keyCode:a.charCode);return a.ctrlKey||" ">h||!f||g.indexOf(h)>-1}return $.datepicker._base_doKeyPress(a)},$.datepicker._base_updateAlternate=$.datepicker._updateAlternate,$.datepicker._updateAlternate=function(a){var b=this._get(a,"timepicker");if(b){var c=b._defaults.altField;if(c){var d=(b._defaults.altFormat||b._defaults.dateFormat,this._getDate(a)),e=$.datepicker._getFormatConfig(a),f="",g=b._defaults.altSeparator?b._defaults.altSeparator:b._defaults.separator,h=b._defaults.altTimeSuffix?b._defaults.altTimeSuffix:b._defaults.timeSuffix,i=null!==b._defaults.altTimeFormat?b._defaults.altTimeFormat:b._defaults.timeFormat;f+=$.datepicker.formatTime(i,b,b._defaults)+h,b._defaults.timeOnly||b._defaults.altFieldTimeOnly||null===d||(f=b._defaults.altFormat?$.datepicker.formatDate(b._defaults.altFormat,d,e)+g+f:b.formattedDate+g+f),$(c).val(a.input.val()?f:"")}}else $.datepicker._base_updateAlternate(a)},$.datepicker._base_doKeyUp=$.datepicker._doKeyUp,$.datepicker._doKeyUp=function(a){var b=$.datepicker._getInst(a.target),c=$.datepicker._get(b,"timepicker");
|
5 |
if(c&&c._defaults.timeOnly&&b.input.val()!==b.lastVal)try{$.datepicker._updateDatepicker(b)}catch(d){$.timepicker.log(d)}return $.datepicker._base_doKeyUp(a)},$.datepicker._base_gotoToday=$.datepicker._gotoToday,$.datepicker._gotoToday=function(a){var b=this._getInst($(a)[0]);this._base_gotoToday(a);var c=this._get(b,"timepicker");if(c){var d=$.timepicker.timezoneOffsetNumber(c.timezone),e=new Date;e.setMinutes(e.getMinutes()+e.getTimezoneOffset()+parseInt(d,10)),this._setTime(b,e),this._setDate(b,e),c._onSelectHandler()}},$.datepicker._disableTimepickerDatepicker=function(a){var b=this._getInst(a);if(b){var c=this._get(b,"timepicker");$(a).datepicker("getDate"),c&&(b.settings.showTimepicker=!1,c._defaults.showTimepicker=!1,c._updateDateTime(b))}},$.datepicker._enableTimepickerDatepicker=function(a){var b=this._getInst(a);if(b){var c=this._get(b,"timepicker");$(a).datepicker("getDate"),c&&(b.settings.showTimepicker=!0,c._defaults.showTimepicker=!0,c._addTimePicker(b),c._updateDateTime(b))}},$.datepicker._setTime=function(a,b){var c=this._get(a,"timepicker");if(c){var d=c._defaults;c.hour=b?b.getHours():d.hour,c.minute=b?b.getMinutes():d.minute,c.second=b?b.getSeconds():d.second,c.millisec=b?b.getMilliseconds():d.millisec,c.microsec=b?b.getMicroseconds():d.microsec,c._limitMinMaxDateTime(a,!0),c._onTimeChange(),c._updateDateTime(a)}},$.datepicker._setTimeDatepicker=function(a,b,c){var d=this._getInst(a);if(d){var e=this._get(d,"timepicker");if(e){this._setDateFromField(d);var f;b&&("string"==typeof b?(e._parseTime(b,c),f=new Date,f.setHours(e.hour,e.minute,e.second,e.millisec),f.setMicroseconds(e.microsec)):(f=new Date(b.getTime()),f.setMicroseconds(b.getMicroseconds())),"Invalid Date"===f.toString()&&(f=void 0),this._setTime(d,f))}}},$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker,$.datepicker._setDateDatepicker=function(a,b){var c=this._getInst(a),d=b;if(c){"string"==typeof b&&(d=new Date(b),d.getTime()||(this._base_setDateDatepicker.apply(this,arguments),d=$(a).datepicker("getDate")));var e,f=this._get(c,"timepicker");d instanceof Date?(e=new Date(d.getTime()),e.setMicroseconds(d.getMicroseconds())):e=d,f&&e&&(f.support.timezone||null!==f._defaults.timezone||(f.timezone=-1*e.getTimezoneOffset()),d=$.timepicker.timezoneAdjust(d,$.timepicker.timezoneOffsetString(-d.getTimezoneOffset()),f.timezone),e=$.timepicker.timezoneAdjust(e,$.timepicker.timezoneOffsetString(-e.getTimezoneOffset()),f.timezone)),this._updateDatepicker(c),this._base_setDateDatepicker.apply(this,arguments),this._setTimeDatepicker(a,e,!0)}},$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker,$.datepicker._getDateDatepicker=function(a,b){var c=this._getInst(a);if(c){var d=this._get(c,"timepicker");if(d){void 0===c.lastVal&&this._setDateFromField(c,b);var e=this._getDate(c),f=null;return f=d.$altInput&&d._defaults.altFieldTimeOnly?d.$input.val()+" "+d.$altInput.val():"INPUT"!==d.$input.get(0).tagName&&d.$altInput?d.$altInput.val():d.$input.val(),e&&d._parseTime(f,!c.settings.timeOnly)&&(e.setHours(d.hour,d.minute,d.second,d.millisec),e.setMicroseconds(d.microsec),null!=d.timezone&&(d.support.timezone||null!==d._defaults.timezone||(d.timezone=-1*e.getTimezoneOffset()),e=$.timepicker.timezoneAdjust(e,d.timezone,$.timepicker.timezoneOffsetString(-e.getTimezoneOffset())))),e}return this._base_getDateDatepicker(a,b)}},$.datepicker._base_parseDate=$.datepicker.parseDate,$.datepicker.parseDate=function(a,b,c){var d;try{d=this._base_parseDate(a,b,c)}catch(e){if(!(e.indexOf(":")>=0))throw e;d=this._base_parseDate(a,b.substring(0,b.length-(e.length-e.indexOf(":")-2)),c),$.timepicker.log("Error parsing the date string: "+e+"\ndate string = "+b+"\ndate format = "+a)}return d},$.datepicker._base_formatDate=$.datepicker._formatDate,$.datepicker._formatDate=function(a,b,c,d){var e=this._get(a,"timepicker");return e?(e._updateDateTime(a),e.$input.val()):this._base_formatDate(a)},$.datepicker._base_optionDatepicker=$.datepicker._optionDatepicker,$.datepicker._optionDatepicker=function(a,b,c){var d,e=this._getInst(a);if(!e)return null;var f=this._get(e,"timepicker");if(f){var g,h,i,j,k=null,l=null,m=null,n=f._defaults.evnts,o={};if("string"==typeof b){if("minDate"===b||"minDateTime"===b)k=c;else if("maxDate"===b||"maxDateTime"===b)l=c;else if("onSelect"===b)m=c;else if(n.hasOwnProperty(b)){if("undefined"==typeof c)return n[b];o[b]=c,d={}}}else if("object"==typeof b){b.minDate?k=b.minDate:b.minDateTime?k=b.minDateTime:b.maxDate?l=b.maxDate:b.maxDateTime&&(l=b.maxDateTime);for(g in n)n.hasOwnProperty(g)&&b[g]&&(o[g]=b[g])}for(g in o)o.hasOwnProperty(g)&&(n[g]=o[g],d||(d=$.extend({},b)),delete d[g]);if(d&&isEmptyObject(d))return;if(k?(k=0===k?new Date:new Date(k),f._defaults.minDate=k,f._defaults.minDateTime=k):l?(l=0===l?new Date:new Date(l),f._defaults.maxDate=l,f._defaults.maxDateTime=l):m&&(f._defaults.onSelect=m),k||l)return j=$(a),i=j.datetimepicker("getDate"),h=this._base_optionDatepicker.call($.datepicker,a,d||b,c),j.datetimepicker("setDate",i),h}return void 0===c?this._base_optionDatepicker.call($.datepicker,a,b):this._base_optionDatepicker.call($.datepicker,a,d||b,c)};var isEmptyObject=function(a){var b;for(b in a)if(a.hasOwnProperty(b))return!1;return!0},extendRemove=function(a,b){$.extend(a,b);for(var c in b)(null===b[c]||void 0===b[c])&&(a[c]=b[c]);return a},detectSupport=function(a){var b=a.replace(/'.*?'/g,"").toLowerCase(),c=function(a,b){return-1!==a.indexOf(b)?!0:!1};return{hour:c(b,"h"),minute:c(b,"m"),second:c(b,"s"),millisec:c(b,"l"),microsec:c(b,"c"),timezone:c(b,"z"),ampm:c(b,"t")&&c(a,"h"),iso8601:c(a,"Z")}},convert24to12=function(a){return a%=12,0===a&&(a=12),String(a)},computeEffectiveSetting=function(a,b){return a&&a[b]?a[b]:$.timepicker._defaults[b]},splitDateTime=function(a,b){var c=computeEffectiveSetting(b,"separator"),d=computeEffectiveSetting(b,"timeFormat"),e=d.split(c),f=e.length,g=a.split(c),h=g.length;return h>1?{dateString:g.splice(0,h-f).join(c),timeString:g.splice(0,f).join(c)}:{dateString:a,timeString:""}},parseDateTimeInternal=function(a,b,c,d,e){var f,g,h;if(g=splitDateTime(c,e),f=$.datepicker._base_parseDate(a,g.dateString,d),""===g.timeString)return{date:f};if(h=$.datepicker.parseTime(b,g.timeString,e),!h)throw"Wrong time format";return{date:f,timeObj:h}},selectLocalTimezone=function(a,b){if(a&&a.timezone_select){var c=b||new Date;a.timezone_select.val(-c.getTimezoneOffset())}};$.timepicker=new Timepicker,$.timepicker.timezoneOffsetString=function(a,b){if(isNaN(a)||a>840||-720>a)return a;var c=a,d=c%60,e=(c-d)/60,f=b?":":"",g=(c>=0?"+":"-")+("0"+Math.abs(e)).slice(-2)+f+("0"+Math.abs(d)).slice(-2);return"+00:00"===g?"Z":g},$.timepicker.timezoneOffsetNumber=function(a){var b=a.toString().replace(":","");return"Z"===b.toUpperCase()?0:/^(\-|\+)\d{4}$/.test(b)?("-"===b.substr(0,1)?-1:1)*(60*parseInt(b.substr(1,2),10)+parseInt(b.substr(3,2),10)):parseInt(a,10)},$.timepicker.timezoneAdjust=function(a,b,c){var d=$.timepicker.timezoneOffsetNumber(b),e=$.timepicker.timezoneOffsetNumber(c);return isNaN(e)||a.setMinutes(a.getMinutes()+-d- -e),a},$.timepicker.timeRange=function(a,b,c){return $.timepicker.handleRange("timepicker",a,b,c)},$.timepicker.datetimeRange=function(a,b,c){$.timepicker.handleRange("datetimepicker",a,b,c)},$.timepicker.dateRange=function(a,b,c){$.timepicker.handleRange("datepicker",a,b,c)},$.timepicker.handleRange=function(a,b,c,d){function e(e,f){var g=b[a]("getDate"),h=c[a]("getDate"),i=e[a]("getDate");if(null!==g){var j=new Date(g.getTime()),k=new Date(g.getTime());j.setMilliseconds(j.getMilliseconds()+d.minInterval),k.setMilliseconds(k.getMilliseconds()+d.maxInterval),d.minInterval>0&&j>h?c[a]("setDate",j):d.maxInterval>0&&h>k?c[a]("setDate",k):g>h&&f[a]("setDate",i)}}function f(b,c,e){if(b.val()){var f=b[a].call(b,"getDate");null!==f&&d.minInterval>0&&("minDate"===e&&f.setMilliseconds(f.getMilliseconds()+d.minInterval),"maxDate"===e&&f.setMilliseconds(f.getMilliseconds()-d.minInterval)),f.getTime&&c[a].call(c,"option",e,f)}}d=$.extend({},{minInterval:0,maxInterval:0,start:{},end:{}},d);var g=!1;return"timepicker"===a&&(g=!0,a="datetimepicker"),$.fn[a].call(b,$.extend({timeOnly:g,onClose:function(a,b){e($(this),c)},onSelect:function(a){f($(this),c,"minDate")}},d,d.start)),$.fn[a].call(c,$.extend({timeOnly:g,onClose:function(a,c){e($(this),b)},onSelect:function(a){f($(this),b,"maxDate")}},d,d.end)),e(b,c),f(b,c,"minDate"),f(c,b,"maxDate"),$([b.get(0),c.get(0)])},$.timepicker.log=function(){window.console&&window.console.log&&window.console.log.apply&&window.console.log.apply(window.console,Array.prototype.slice.call(arguments))},$.timepicker._util={_extendRemove:extendRemove,_isEmptyObject:isEmptyObject,_convert24to12:convert24to12,_detectSupport:detectSupport,_selectLocalTimezone:selectLocalTimezone,_computeEffectiveSetting:computeEffectiveSetting,_splitDateTime:splitDateTime,_parseDateTimeInternal:parseDateTimeInternal},Date.prototype.getMicroseconds||(Date.prototype.microseconds=0,Date.prototype.getMicroseconds=function(){return this.microseconds},Date.prototype.setMicroseconds=function(a){return this.setMilliseconds(this.getMilliseconds()+Math.floor(a/1e3)),this.microseconds=a%1e3,this}),$.timepicker.version="1.6.3"}});
|
1 |
+
/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
|
2 |
+
* http://trentrichardson.com/examples/timepicker
|
3 |
+
* Copyright (c) 2016 Trent Richardson; Licensed MIT */
|
4 |
+
!function(a){"function"==typeof define&&define.amd?define(["jquery","jquery-ui"],a):a(jQuery)}(function($){if($.ui.timepicker=$.ui.timepicker||{},!$.ui.timepicker.version){$.extend($.ui,{timepicker:{version:"1.6.3"}});var Timepicker=function(){this.regional=[],this.regional[""]={currentText:"Now",closeText:"Done",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"HH:mm",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",microsecText:"Microsecond",timezoneText:"Time Zone",isRTL:!1},this._defaults={showButtonPanel:!0,timeOnly:!1,timeOnlyShowDate:!1,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:!0,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,stepMicrosec:1,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,microsecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,microsecMax:999,minDateTime:null,maxDateTime:null,maxTime:null,minTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,microsecGrid:0,alwaysSetTime:!0,separator:" ",altFieldTimeOnly:!0,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,altRedirectFocus:!0,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:!0,timezoneList:null,addSliderAccess:!1,sliderAccessArgs:null,controlType:"slider",oneLine:!1,defaultValue:null,parse:"strict",afterInject:null},$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,maxTime:null,minTime:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_newInst:function($input,opts){var tp_inst=new Timepicker,inlineSettings={},fns={},overrides,i;for(var attrName in this._defaults)if(this._defaults.hasOwnProperty(attrName)){var attrValue=$input.attr("time:"+attrName);if(attrValue)try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}overrides={beforeShow:function(a,b){return $.isFunction(tp_inst._defaults.evnts.beforeShow)?tp_inst._defaults.evnts.beforeShow.call($input[0],a,b,tp_inst):void 0},onChangeMonthYear:function(a,b,c){$.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)&&tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],a,b,c,tp_inst)},onClose:function(a,b){tp_inst.timeDefined===!0&&""!==$input.val()&&tp_inst._updateDateTime(b),$.isFunction(tp_inst._defaults.evnts.onClose)&&tp_inst._defaults.evnts.onClose.call($input[0],a,b,tp_inst)}};for(i in overrides)overrides.hasOwnProperty(i)&&(fns[i]=opts[i]||this._defaults[i]||null);tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst}),tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(a){return a.toUpperCase()}),tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(a){return a.toUpperCase()}),tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:"")),"string"==typeof tp_inst._defaults.controlType?("slider"===tp_inst._defaults.controlType&&"undefined"==typeof $.ui.slider&&(tp_inst._defaults.controlType="select"),tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]):tp_inst.control=tp_inst._defaults.controlType;var timezoneList=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-270,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,525,540,570,600,630,660,690,720,765,780,840];null!==tp_inst._defaults.timezoneList&&(timezoneList=tp_inst._defaults.timezoneList);var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&"object"!=typeof timezoneList[0])for(;tzl>tzi;tzi++)tzv=timezoneList[tzi],timezoneList[tzi]={value:tzv,label:$.timepicker.timezoneOffsetString(tzv,tp_inst.support.iso8601)};return tp_inst._defaults.timezoneList=timezoneList,tp_inst.timezone=null!==tp_inst._defaults.timezone?$.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone):-1*(new Date).getTimezoneOffset(),tp_inst.hour=tp_inst._defaults.hour<tp_inst._defaults.hourMin?tp_inst._defaults.hourMin:tp_inst._defaults.hour>tp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour,tp_inst.minute=tp_inst._defaults.minute<tp_inst._defaults.minuteMin?tp_inst._defaults.minuteMin:tp_inst._defaults.minute>tp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute,tp_inst.second=tp_inst._defaults.second<tp_inst._defaults.secondMin?tp_inst._defaults.secondMin:tp_inst._defaults.second>tp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second,tp_inst.millisec=tp_inst._defaults.millisec<tp_inst._defaults.millisecMin?tp_inst._defaults.millisecMin:tp_inst._defaults.millisec>tp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec,tp_inst.microsec=tp_inst._defaults.microsec<tp_inst._defaults.microsecMin?tp_inst._defaults.microsecMin:tp_inst._defaults.microsec>tp_inst._defaults.microsecMax?tp_inst._defaults.microsecMax:tp_inst._defaults.microsec,tp_inst.ampm="",tp_inst.$input=$input,tp_inst._defaults.altField&&(tp_inst.$altInput=$(tp_inst._defaults.altField),tp_inst._defaults.altRedirectFocus===!0&&tp_inst.$altInput.css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})),(0===tp_inst._defaults.minDate||0===tp_inst._defaults.minDateTime)&&(tp_inst._defaults.minDate=new Date),(0===tp_inst._defaults.maxDate||0===tp_inst._defaults.maxDateTime)&&(tp_inst._defaults.maxDate=new Date),void 0!==tp_inst._defaults.minDate&&tp_inst._defaults.minDate instanceof Date&&(tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())),void 0!==tp_inst._defaults.minDateTime&&tp_inst._defaults.minDateTime instanceof Date&&(tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())),void 0!==tp_inst._defaults.maxDate&&tp_inst._defaults.maxDate instanceof Date&&(tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())),void 0!==tp_inst._defaults.maxDateTime&&tp_inst._defaults.maxDateTime instanceof Date&&(tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())),tp_inst.$input.bind("focus",function(){tp_inst._onFocus()}),tp_inst},_addTimePicker:function(a){var b=$.trim(this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val());this.timeDefined=this._parseTime(b),this._limitMinMaxDateTime(a,!1),this._injectTimePicker(),this._afterInject()},_parseTime:function(a,b){if(this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),b||!this._defaults.timeOnly){var c=$.datepicker._get(this.inst,"dateFormat");try{var d=parseDateTimeInternal(c,this._defaults.timeFormat,a,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!d.timeObj)return!1;$.extend(this,d.timeObj)}catch(e){return $.timepicker.log("Error parsing the date/time string: "+e+"\ndate/time string = "+a+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+c),!1}return!0}var f=$.datepicker.parseTime(this._defaults.timeFormat,a,this._defaults);return f?($.extend(this,f),!0):!1},_afterInject:function(){var a=this.inst.settings;$.isFunction(a.afterInject)&&a.afterInject.call(this)},_injectTimePicker:function(){var a=this.inst.dpDiv,b=this.inst.settings,c=this,d="",e="",f=null,g={},h={},i=null,j=0,k=0;if(0===a.find("div.ui-timepicker-div").length&&b.showTimepicker){var l=" ui_tpicker_unit_hide",m='<div class="ui-timepicker-div'+(b.isRTL?" ui-timepicker-rtl":"")+(b.oneLine&&"select"===b.controlType?" ui-timepicker-oneLine":"")+'"><dl><dt class="ui_tpicker_time_label'+(b.showTime?"":l)+'">'+b.timeText+'</dt><dd class="ui_tpicker_time '+(b.showTime?"":l)+'"><input class="ui_tpicker_time_input" '+(b.timeInput?"":"disabled")+"/></dd>";for(j=0,k=this.units.length;k>j;j++){if(d=this.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],g[d]=parseInt(b[d+"Max"]-(b[d+"Max"]-b[d+"Min"])%b["step"+e],10),h[d]=0,m+='<dt class="ui_tpicker_'+d+"_label"+(f?"":l)+'">'+b[d+"Text"]+'</dt><dd class="ui_tpicker_'+d+(f?"":l)+'"><div class="ui_tpicker_'+d+"_slider"+(f?"":l)+'"></div>',f&&b[d+"Grid"]>0){if(m+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>',"hour"===d)for(var n=b[d+"Min"];n<=g[d];n+=parseInt(b[d+"Grid"],10)){h[d]++;var o=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:n},b);m+='<td data-for="'+d+'">'+o+"</td>"}else for(var p=b[d+"Min"];p<=g[d];p+=parseInt(b[d+"Grid"],10))h[d]++,m+='<td data-for="'+d+'">'+(10>p?"0":"")+p+"</td>";m+="</tr></table></div>"}m+="</dd>"}var q=null!==b.showTimezone?b.showTimezone:this.support.timezone;m+='<dt class="ui_tpicker_timezone_label'+(q?"":l)+'">'+b.timezoneText+"</dt>",m+='<dd class="ui_tpicker_timezone'+(q?"":l)+'"></dd>',m+="</dl></div>";var r=$(m);for(b.timeOnly===!0&&(r.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+b.timeOnlyTitle+"</div></div>"),a.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()),j=0,k=c.units.length;k>j;j++)d=c.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],c[d+"_slider"]=c.control.create(c,r.find(".ui_tpicker_"+d+"_slider"),d,c[d],b[d+"Min"],g[d],b["step"+e]),f&&b[d+"Grid"]>0&&(i=100*h[d]*b[d+"Grid"]/(g[d]-b[d+"Min"]),r.find(".ui_tpicker_"+d+" table").css({width:i+"%",marginLeft:b.isRTL?"0":i/(-2*h[d])+"%",marginRight:b.isRTL?i/(-2*h[d])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(a){var b=$(this),e=b.html(),f=parseInt(e.replace(/[^0-9]/g),10),g=e.replace(/[^apm]/gi),h=b.data("for");"hour"===h&&(-1!==g.indexOf("p")&&12>f?f+=12:-1!==g.indexOf("a")&&12===f&&(f=0)),c.control.value(c,c[h+"_slider"],d,f),c._onTimeChange(),c._onSelectHandler()}).css({cursor:"pointer",width:100/h[d]+"%",textAlign:"center",overflow:"hidden"}));if(this.timezone_select=r.find(".ui_tpicker_timezone").append("<select></select>").find("select"),$.fn.append.apply(this.timezone_select,$.map(b.timezoneList,function(a,b){return $("<option />").val("object"==typeof a?a.value:a).text("object"==typeof a?a.label:a)})),"undefined"!=typeof this.timezone&&null!==this.timezone&&""!==this.timezone){var s=-1*new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12).getTimezoneOffset();s===this.timezone?selectLocalTimezone(c):this.timezone_select.val(this.timezone)}else"undefined"!=typeof this.hour&&null!==this.hour&&""!==this.hour?this.timezone_select.val(b.timezone):selectLocalTimezone(c);this.timezone_select.change(function(){c._onTimeChange(),c._onSelectHandler(),c._afterInject()});var t=a.find(".ui-datepicker-buttonpane");if(t.length?t.before(r):a.append(r),this.$timeObj=r.find(".ui_tpicker_time_input"),this.$timeObj.change(function(){var a=c.inst.settings.timeFormat,b=$.datepicker.parseTime(a,this.value),d=new Date;b?(d.setHours(b.hour),d.setMinutes(b.minute),d.setSeconds(b.second),$.datepicker._setTime(c.inst,d)):(this.value=c.formattedTime,this.blur())}),null!==this.inst){var u=this.timeDefined;this._onTimeChange(),this.timeDefined=u}if(this._defaults.addSliderAccess){var v=this._defaults.sliderAccessArgs,w=this._defaults.isRTL;v.isRTL=w,setTimeout(function(){if(0===r.find(".ui-slider-access").length){r.find(".ui-slider:visible").sliderAccess(v);var a=r.find(".ui-slider-access:eq(0)").outerWidth(!0);a&&r.find("table:visible").each(function(){var b=$(this),c=b.outerWidth(),d=b.css(w?"marginRight":"marginLeft").toString().replace("%",""),e=c-a,f=d*e/c+"%",g={width:e,marginRight:0,marginLeft:0};g[w?"marginRight":"marginLeft"]=f,b.css(g)})}},10)}c._limitMinMaxDateTime(this.inst,!0)}},_limitMinMaxDateTime:function(a,b){var c=this._defaults,d=new Date(a.selectedYear,a.selectedMonth,a.selectedDay);if(this._defaults.showTimepicker){if(null!==$.datepicker._get(a,"minDateTime")&&void 0!==$.datepicker._get(a,"minDateTime")&&d){var e=$.datepicker._get(a,"minDateTime"),f=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0);(null===this.hourMinOriginal||null===this.minuteMinOriginal||null===this.secondMinOriginal||null===this.millisecMinOriginal||null===this.microsecMinOriginal)&&(this.hourMinOriginal=c.hourMin,this.minuteMinOriginal=c.minuteMin,this.secondMinOriginal=c.secondMin,this.millisecMinOriginal=c.millisecMin,this.microsecMinOriginal=c.microsecMin),a.settings.timeOnly||f.getTime()===d.getTime()?(this._defaults.hourMin=e.getHours(),this.hour<=this._defaults.hourMin?(this.hour=this._defaults.hourMin,this._defaults.minuteMin=e.getMinutes(),this.minute<=this._defaults.minuteMin?(this.minute=this._defaults.minuteMin,this._defaults.secondMin=e.getSeconds(),this.second<=this._defaults.secondMin?(this.second=this._defaults.secondMin,this._defaults.millisecMin=e.getMilliseconds(),this.millisec<=this._defaults.millisecMin?(this.millisec=this._defaults.millisecMin,this._defaults.microsecMin=e.getMicroseconds()):(this.microsec<this._defaults.microsecMin&&(this.microsec=this._defaults.microsecMin),this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.hourMin=this.hourMinOriginal,this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)}if(null!==$.datepicker._get(a,"maxDateTime")&&void 0!==$.datepicker._get(a,"maxDateTime")&&d){var g=$.datepicker._get(a,"maxDateTime"),h=new Date(g.getFullYear(),g.getMonth(),g.getDate(),0,0,0,0);(null===this.hourMaxOriginal||null===this.minuteMaxOriginal||null===this.secondMaxOriginal||null===this.millisecMaxOriginal)&&(this.hourMaxOriginal=c.hourMax,this.minuteMaxOriginal=c.minuteMax,this.secondMaxOriginal=c.secondMax,this.millisecMaxOriginal=c.millisecMax,this.microsecMaxOriginal=c.microsecMax),a.settings.timeOnly||h.getTime()===d.getTime()?(this._defaults.hourMax=g.getHours(),this.hour>=this._defaults.hourMax?(this.hour=this._defaults.hourMax,this._defaults.minuteMax=g.getMinutes(),this.minute>=this._defaults.minuteMax?(this.minute=this._defaults.minuteMax,this._defaults.secondMax=g.getSeconds(),this.second>=this._defaults.secondMax?(this.second=this._defaults.secondMax,this._defaults.millisecMax=g.getMilliseconds(),this.millisec>=this._defaults.millisecMax?(this.millisec=this._defaults.millisecMax,this._defaults.microsecMax=g.getMicroseconds()):(this.microsec>this._defaults.microsecMax&&(this.microsec=this._defaults.microsecMax),this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.hourMax=this.hourMaxOriginal,this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)}if(null!==a.settings.minTime){var i=new Date("01/01/1970 "+a.settings.minTime);this.hour<i.getHours()?(this.hour=this._defaults.hourMin=i.getHours(),this.minute=this._defaults.minuteMin=i.getMinutes()):this.hour===i.getHours()&&this.minute<i.getMinutes()?this.minute=this._defaults.minuteMin=i.getMinutes():this._defaults.hourMin<i.getHours()?(this._defaults.hourMin=i.getHours(),this._defaults.minuteMin=i.getMinutes()):this._defaults.hourMin===i.getHours()===this.hour&&this._defaults.minuteMin<i.getMinutes()?this._defaults.minuteMin=i.getMinutes():this._defaults.minuteMin=0}if(null!==a.settings.maxTime){var j=new Date("01/01/1970 "+a.settings.maxTime);this.hour>j.getHours()?(this.hour=this._defaults.hourMax=j.getHours(),this.minute=this._defaults.minuteMax=j.getMinutes()):this.hour===j.getHours()&&this.minute>j.getMinutes()?this.minute=this._defaults.minuteMax=j.getMinutes():this._defaults.hourMax>j.getHours()?(this._defaults.hourMax=j.getHours(),this._defaults.minuteMax=j.getMinutes()):this._defaults.hourMax===j.getHours()===this.hour&&this._defaults.minuteMax>j.getMinutes()?this._defaults.minuteMax=j.getMinutes():this._defaults.minuteMax=59}if(void 0!==b&&b===!0){var k=parseInt(this._defaults.hourMax-(this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour,10),l=parseInt(this._defaults.minuteMax-(this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute,10),m=parseInt(this._defaults.secondMax-(this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond,10),n=parseInt(this._defaults.millisecMax-(this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec,10),o=parseInt(this._defaults.microsecMax-(this._defaults.microsecMax-this._defaults.microsecMin)%this._defaults.stepMicrosec,10);this.hour_slider&&(this.control.options(this,this.hour_slider,"hour",{min:this._defaults.hourMin,max:k,step:this._defaults.stepHour}),this.control.value(this,this.hour_slider,"hour",this.hour-this.hour%this._defaults.stepHour)),this.minute_slider&&(this.control.options(this,this.minute_slider,"minute",{min:this._defaults.minuteMin,max:l,step:this._defaults.stepMinute}),this.control.value(this,this.minute_slider,"minute",this.minute-this.minute%this._defaults.stepMinute)),this.second_slider&&(this.control.options(this,this.second_slider,"second",{min:this._defaults.secondMin,max:m,step:this._defaults.stepSecond}),this.control.value(this,this.second_slider,"second",this.second-this.second%this._defaults.stepSecond)),this.millisec_slider&&(this.control.options(this,this.millisec_slider,"millisec",{min:this._defaults.millisecMin,max:n,step:this._defaults.stepMillisec}),this.control.value(this,this.millisec_slider,"millisec",this.millisec-this.millisec%this._defaults.stepMillisec)),this.microsec_slider&&(this.control.options(this,this.microsec_slider,"microsec",{min:this._defaults.microsecMin,max:o,step:this._defaults.stepMicrosec}),this.control.value(this,this.microsec_slider,"microsec",this.microsec-this.microsec%this._defaults.stepMicrosec))}}},_onTimeChange:function(){if(this._defaults.showTimepicker){var a=this.hour_slider?this.control.value(this,this.hour_slider,"hour"):!1,b=this.minute_slider?this.control.value(this,this.minute_slider,"minute"):!1,c=this.second_slider?this.control.value(this,this.second_slider,"second"):!1,d=this.millisec_slider?this.control.value(this,this.millisec_slider,"millisec"):!1,e=this.microsec_slider?this.control.value(this,this.microsec_slider,"microsec"):!1,f=this.timezone_select?this.timezone_select.val():!1,g=this._defaults,h=g.pickerTimeFormat||g.timeFormat,i=g.pickerTimeSuffix||g.timeSuffix;"object"==typeof a&&(a=!1),"object"==typeof b&&(b=!1),"object"==typeof c&&(c=!1),"object"==typeof d&&(d=!1),"object"==typeof e&&(e=!1),"object"==typeof f&&(f=!1),a!==!1&&(a=parseInt(a,10)),b!==!1&&(b=parseInt(b,10)),c!==!1&&(c=parseInt(c,10)),d!==!1&&(d=parseInt(d,10)),e!==!1&&(e=parseInt(e,10)),f!==!1&&(f=f.toString());var j=g[12>a?"amNames":"pmNames"][0],k=a!==parseInt(this.hour,10)||b!==parseInt(this.minute,10)||c!==parseInt(this.second,10)||d!==parseInt(this.millisec,10)||e!==parseInt(this.microsec,10)||this.ampm.length>0&&12>a!=(-1!==$.inArray(this.ampm.toUpperCase(),this.amNames))||null!==this.timezone&&f!==this.timezone.toString();if(k&&(a!==!1&&(this.hour=a),b!==!1&&(this.minute=b),c!==!1&&(this.second=c),d!==!1&&(this.millisec=d),e!==!1&&(this.microsec=e),f!==!1&&(this.timezone=f),this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),this._limitMinMaxDateTime(this.inst,!0)),this.support.ampm&&(this.ampm=j),this.formattedTime=$.datepicker.formatTime(g.timeFormat,this,g),this.$timeObj&&(this.$timeObj.val(h===g.timeFormat?this.formattedTime+i:$.datepicker.formatTime(h,this,g)+i),this.$timeObj[0].setSelectionRange)){var l=this.$timeObj[0].selectionStart,m=this.$timeObj[0].selectionEnd;this.$timeObj[0].setSelectionRange(l,m)}this.timeDefined=!0,k&&this._updateDateTime()}},_onSelectHandler:function(){var a=this._defaults.onSelect||this.inst.settings.onSelect,b=this.$input?this.$input[0]:null;a&&b&&a.apply(b,[this.formattedDateTime,this])},_updateDateTime:function(a){a=this.inst||a;var b=a.currentYear>0?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(a.selectedYear,a.selectedMonth,a.selectedDay),c=$.datepicker._daylightSavingAdjust(b),d=$.datepicker._get(a,"dateFormat"),e=$.datepicker._getFormatConfig(a),f=null!==c&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(d,null===c?new Date:c,e);var g=this.formattedDate;if(""===a.lastVal&&(a.currentYear=a.selectedYear,a.currentMonth=a.selectedMonth,a.currentDay=a.selectedDay),this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!1?g=this.formattedTime:(this._defaults.timeOnly!==!0&&(this._defaults.alwaysSetTime||f)||this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!0)&&(g+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix),this.formattedDateTime=g,this._defaults.showTimepicker)if(this.$altInput&&this._defaults.timeOnly===!1&&this._defaults.altFieldTimeOnly===!0)this.$altInput.val(this.formattedTime),this.$input.val(this.formattedDate);else if(this.$altInput){this.$input.val(g);var h="",i=null!==this._defaults.altSeparator?this._defaults.altSeparator:this._defaults.separator,j=null!==this._defaults.altTimeSuffix?this._defaults.altTimeSuffix:this._defaults.timeSuffix;this._defaults.timeOnly||(h=this._defaults.altFormat?$.datepicker.formatDate(this._defaults.altFormat,null===c?new Date:c,e):this.formattedDate,h&&(h+=i)),h+=null!==this._defaults.altTimeFormat?$.datepicker.formatTime(this._defaults.altTimeFormat,this,this._defaults)+j:this.formattedTime+j,this.$altInput.val(h)}else this.$input.val(g);else this.$input.val(this.formattedDate);this.$input.trigger("change")},_onFocus:function(){if(!this.$input.val()&&this._defaults.defaultValue){this.$input.val(this._defaults.defaultValue);var a=$.datepicker._getInst(this.$input.get(0)),b=$.datepicker._get(a,"timepicker");if(b&&b._defaults.timeOnly&&a.input.val()!==a.lastVal)try{$.datepicker._updateDatepicker(a)}catch(c){$.timepicker.log(c)}}},_controls:{slider:{create:function(a,b,c,d,e,f,g){var h=a._defaults.isRTL;return b.prop("slide",null).slider({orientation:"horizontal",value:h?-1*d:d,min:h?-1*f:e,max:h?-1*e:f,step:g,slide:function(b,d){a.control.value(a,$(this),c,h?-1*d.value:d.value),a._onTimeChange()},stop:function(b,c){a._onSelectHandler()}})},options:function(a,b,c,d,e){if(a._defaults.isRTL){if("string"==typeof d)return"min"===d||"max"===d?void 0!==e?b.slider(d,-1*e):Math.abs(b.slider(d)):b.slider(d);var f=d.min,g=d.max;return d.min=d.max=null,void 0!==f&&(d.max=-1*f),void 0!==g&&(d.min=-1*g),b.slider(d)}return"string"==typeof d&&void 0!==e?b.slider(d,e):b.slider(d)},value:function(a,b,c,d){return a._defaults.isRTL?void 0!==d?b.slider("value",-1*d):Math.abs(b.slider("value")):void 0!==d?b.slider("value",d):b.slider("value")}},select:{create:function(a,b,c,d,e,f,g){for(var h='<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="'+c+'" data-min="'+e+'" data-max="'+f+'" data-step="'+g+'">',i=a._defaults.pickerTimeFormat||a._defaults.timeFormat,j=e;f>=j;j+=g)h+='<option value="'+j+'"'+(j===d?" selected":"")+">",h+="hour"===c?$.datepicker.formatTime($.trim(i.replace(/[^ht ]/gi,"")),{hour:j},a._defaults):"millisec"===c||"microsec"===c||j>=10?j:"0"+j.toString(),h+="</option>";return h+="</select>",b.children("select").remove(),$(h).appendTo(b).change(function(b){a._onTimeChange(),a._onSelectHandler(),a._afterInject()}),b},options:function(a,b,c,d,e){var f={},g=b.children("select");if("string"==typeof d){if(void 0===e)return g.data(d);f[d]=e}else f=d;return a.control.create(a,b,g.data("unit"),g.val(),f.min>=0?f.min:g.data("min"),f.max||g.data("max"),f.step||g.data("step"))},value:function(a,b,c,d){var e=b.children("select");return void 0!==d?e.val(d):e.val()}}}}),$.fn.extend({timepicker:function(a){a=a||{};var b=Array.prototype.slice.call(arguments);return"object"==typeof a&&(b[0]=$.extend(a,{timeOnly:!0})),$(this).each(function(){$.fn.datetimepicker.apply($(this),b)})},datetimepicker:function(a){a=a||{};var b=arguments;return"string"==typeof a?"getDate"===a||"option"===a&&2===b.length&&"string"==typeof b[1]?$.fn.datepicker.apply($(this[0]),b):this.each(function(){var a=$(this);a.datepicker.apply(a,b)}):this.each(function(){var b=$(this);b.datepicker($.timepicker._newInst(b,a)._defaults)})}}),$.datepicker.parseDateTime=function(a,b,c,d,e){var f=parseDateTimeInternal(a,b,c,d,e);if(f.timeObj){var g=f.timeObj;f.date.setHours(g.hour,g.minute,g.second,g.millisec),f.date.setMicroseconds(g.microsec)}return f.date},$.datepicker.parseTime=function(a,b,c){var d=extendRemove(extendRemove({},$.timepicker._defaults),c||{}),e=(-1!==a.replace(/\'.*?\'/g,"").indexOf("Z"),function(a,b,c){var d,e=function(a,b){var c=[];return a&&$.merge(c,a),b&&$.merge(c,b),c=$.map(c,function(a){return a.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")}),"("+c.join("|")+")?"},f=function(a){var b=a.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),c={h:-1,m:-1,s:-1,l:-1,c:-1,t:-1,z:-1};if(b)for(var d=0;d<b.length;d++)-1===c[b[d].toString().charAt(0)]&&(c[b[d].toString().charAt(0)]=d+1);return c},g="^"+a.toString().replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(a){var b=a.length;switch(a.charAt(0).toLowerCase()){case"h":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"m":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"s":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"l":return"(\\d?\\d?\\d)";case"c":return"(\\d?\\d?\\d)";case"z":return"(z|[-+]\\d\\d:?\\d\\d|\\S+)?";case"t":return e(c.amNames,c.pmNames);default:return"("+a.replace(/\'/g,"").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g,function(a){return"\\"+a})+")?"}}).replace(/\s/g,"\\s?")+c.timeSuffix+"$",h=f(a),i="";d=b.match(new RegExp(g,"i"));var j={hour:0,minute:0,second:0,millisec:0,microsec:0};return d?(-1!==h.t&&(void 0===d[h.t]||0===d[h.t].length?(i="",j.ampm=""):(i=-1!==$.inArray(d[h.t].toUpperCase(),$.map(c.amNames,function(a,b){return a.toUpperCase()}))?"AM":"PM",j.ampm=c["AM"===i?"amNames":"pmNames"][0])),-1!==h.h&&("AM"===i&&"12"===d[h.h]?j.hour=0:"PM"===i&&"12"!==d[h.h]?j.hour=parseInt(d[h.h],10)+12:j.hour=Number(d[h.h])),-1!==h.m&&(j.minute=Number(d[h.m])),-1!==h.s&&(j.second=Number(d[h.s])),-1!==h.l&&(j.millisec=Number(d[h.l])),-1!==h.c&&(j.microsec=Number(d[h.c])),-1!==h.z&&void 0!==d[h.z]&&(j.timezone=$.timepicker.timezoneOffsetNumber(d[h.z])),j):!1}),f=function(a,b,c){try{var d=new Date("2012-01-01 "+b);if(isNaN(d.getTime())&&(d=new Date("2012-01-01T"+b),isNaN(d.getTime())&&(d=new Date("01/01/2012 "+b),isNaN(d.getTime()))))throw"Unable to parse time with native Date: "+b;return{hour:d.getHours(),minute:d.getMinutes(),second:d.getSeconds(),millisec:d.getMilliseconds(),microsec:d.getMicroseconds(),timezone:-1*d.getTimezoneOffset()}}catch(f){try{return e(a,b,c)}catch(g){$.timepicker.log("Unable to parse \ntimeString: "+b+"\ntimeFormat: "+a)}}return!1};return"function"==typeof d.parse?d.parse(a,b,d):"loose"===d.parse?f(a,b,d):e(a,b,d)},$.datepicker.formatTime=function(a,b,c){c=c||{},c=$.extend({},$.timepicker._defaults,c),b=$.extend({hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null},b);var d=a,e=c.amNames[0],f=parseInt(b.hour,10);return f>11&&(e=c.pmNames[0]),d=d.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(a){switch(a){case"HH":return("0"+f).slice(-2);case"H":return f;case"hh":return("0"+convert24to12(f)).slice(-2);case"h":return convert24to12(f);case"mm":return("0"+b.minute).slice(-2);case"m":return b.minute;case"ss":return("0"+b.second).slice(-2);case"s":return b.second;case"l":return("00"+b.millisec).slice(-3);case"c":return("00"+b.microsec).slice(-3);case"z":return $.timepicker.timezoneOffsetString(null===b.timezone?c.timezone:b.timezone,!1);case"Z":return $.timepicker.timezoneOffsetString(null===b.timezone?c.timezone:b.timezone,!0);case"T":return e.charAt(0).toUpperCase();case"TT":return e.toUpperCase();case"t":return e.charAt(0).toLowerCase();case"tt":return e.toLowerCase();default:return a.replace(/'/g,"")}})},$.datepicker._base_selectDate=$.datepicker._selectDate,$.datepicker._selectDate=function(a,b){var c,d=this._getInst($(a)[0]),e=this._get(d,"timepicker");e&&d.settings.showTimepicker?(e._limitMinMaxDateTime(d,!0),c=d.inline,d.inline=d.stay_open=!0,this._base_selectDate(a,b),d.inline=c,d.stay_open=!1,this._notifyChange(d),this._updateDatepicker(d)):this._base_selectDate(a,b)},$.datepicker._base_updateDatepicker=$.datepicker._updateDatepicker,$.datepicker._updateDatepicker=function(a){var b=a.input[0];if(!($.datepicker._curInst&&$.datepicker._curInst!==a&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!==b||"boolean"==typeof a.stay_open&&a.stay_open!==!1)){this._base_updateDatepicker(a);var c=this._get(a,"timepicker");c&&c._addTimePicker(a)}},$.datepicker._base_doKeyPress=$.datepicker._doKeyPress,$.datepicker._doKeyPress=function(a){var b=$.datepicker._getInst(a.target),c=$.datepicker._get(b,"timepicker");if(c&&$.datepicker._get(b,"constrainInput")){var d=c.support.ampm,e=null!==c._defaults.showTimezone?c._defaults.showTimezone:c.support.timezone,f=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),g=c._defaults.timeFormat.toString().replace(/[hms]/g,"").replace(/TT/g,d?"APM":"").replace(/Tt/g,d?"AaPpMm":"").replace(/tT/g,d?"AaPpMm":"").replace(/T/g,d?"AP":"").replace(/tt/g,d?"apm":"").replace(/t/g,d?"ap":"")+" "+c._defaults.separator+c._defaults.timeSuffix+(e?c._defaults.timezoneList.join(""):"")+c._defaults.amNames.join("")+c._defaults.pmNames.join("")+f,h=String.fromCharCode(void 0===a.charCode?a.keyCode:a.charCode);return a.ctrlKey||" ">h||!f||g.indexOf(h)>-1}return $.datepicker._base_doKeyPress(a)},$.datepicker._base_updateAlternate=$.datepicker._updateAlternate,$.datepicker._updateAlternate=function(a){var b=this._get(a,"timepicker");if(b){var c=b._defaults.altField;if(c){var d=(b._defaults.altFormat||b._defaults.dateFormat,this._getDate(a)),e=$.datepicker._getFormatConfig(a),f="",g=b._defaults.altSeparator?b._defaults.altSeparator:b._defaults.separator,h=b._defaults.altTimeSuffix?b._defaults.altTimeSuffix:b._defaults.timeSuffix,i=null!==b._defaults.altTimeFormat?b._defaults.altTimeFormat:b._defaults.timeFormat;f+=$.datepicker.formatTime(i,b,b._defaults)+h,b._defaults.timeOnly||b._defaults.altFieldTimeOnly||null===d||(f=b._defaults.altFormat?$.datepicker.formatDate(b._defaults.altFormat,d,e)+g+f:b.formattedDate+g+f),$(c).val(a.input.val()?f:"")}}else $.datepicker._base_updateAlternate(a)},$.datepicker._base_doKeyUp=$.datepicker._doKeyUp,$.datepicker._doKeyUp=function(a){var b=$.datepicker._getInst(a.target),c=$.datepicker._get(b,"timepicker");
|
5 |
if(c&&c._defaults.timeOnly&&b.input.val()!==b.lastVal)try{$.datepicker._updateDatepicker(b)}catch(d){$.timepicker.log(d)}return $.datepicker._base_doKeyUp(a)},$.datepicker._base_gotoToday=$.datepicker._gotoToday,$.datepicker._gotoToday=function(a){var b=this._getInst($(a)[0]);this._base_gotoToday(a);var c=this._get(b,"timepicker");if(c){var d=$.timepicker.timezoneOffsetNumber(c.timezone),e=new Date;e.setMinutes(e.getMinutes()+e.getTimezoneOffset()+parseInt(d,10)),this._setTime(b,e),this._setDate(b,e),c._onSelectHandler()}},$.datepicker._disableTimepickerDatepicker=function(a){var b=this._getInst(a);if(b){var c=this._get(b,"timepicker");$(a).datepicker("getDate"),c&&(b.settings.showTimepicker=!1,c._defaults.showTimepicker=!1,c._updateDateTime(b))}},$.datepicker._enableTimepickerDatepicker=function(a){var b=this._getInst(a);if(b){var c=this._get(b,"timepicker");$(a).datepicker("getDate"),c&&(b.settings.showTimepicker=!0,c._defaults.showTimepicker=!0,c._addTimePicker(b),c._updateDateTime(b))}},$.datepicker._setTime=function(a,b){var c=this._get(a,"timepicker");if(c){var d=c._defaults;c.hour=b?b.getHours():d.hour,c.minute=b?b.getMinutes():d.minute,c.second=b?b.getSeconds():d.second,c.millisec=b?b.getMilliseconds():d.millisec,c.microsec=b?b.getMicroseconds():d.microsec,c._limitMinMaxDateTime(a,!0),c._onTimeChange(),c._updateDateTime(a)}},$.datepicker._setTimeDatepicker=function(a,b,c){var d=this._getInst(a);if(d){var e=this._get(d,"timepicker");if(e){this._setDateFromField(d);var f;b&&("string"==typeof b?(e._parseTime(b,c),f=new Date,f.setHours(e.hour,e.minute,e.second,e.millisec),f.setMicroseconds(e.microsec)):(f=new Date(b.getTime()),f.setMicroseconds(b.getMicroseconds())),"Invalid Date"===f.toString()&&(f=void 0),this._setTime(d,f))}}},$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker,$.datepicker._setDateDatepicker=function(a,b){var c=this._getInst(a),d=b;if(c){"string"==typeof b&&(d=new Date(b),d.getTime()||(this._base_setDateDatepicker.apply(this,arguments),d=$(a).datepicker("getDate")));var e,f=this._get(c,"timepicker");d instanceof Date?(e=new Date(d.getTime()),e.setMicroseconds(d.getMicroseconds())):e=d,f&&e&&(f.support.timezone||null!==f._defaults.timezone||(f.timezone=-1*e.getTimezoneOffset()),d=$.timepicker.timezoneAdjust(d,$.timepicker.timezoneOffsetString(-d.getTimezoneOffset()),f.timezone),e=$.timepicker.timezoneAdjust(e,$.timepicker.timezoneOffsetString(-e.getTimezoneOffset()),f.timezone)),this._updateDatepicker(c),this._base_setDateDatepicker.apply(this,arguments),this._setTimeDatepicker(a,e,!0)}},$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker,$.datepicker._getDateDatepicker=function(a,b){var c=this._getInst(a);if(c){var d=this._get(c,"timepicker");if(d){void 0===c.lastVal&&this._setDateFromField(c,b);var e=this._getDate(c),f=null;return f=d.$altInput&&d._defaults.altFieldTimeOnly?d.$input.val()+" "+d.$altInput.val():"INPUT"!==d.$input.get(0).tagName&&d.$altInput?d.$altInput.val():d.$input.val(),e&&d._parseTime(f,!c.settings.timeOnly)&&(e.setHours(d.hour,d.minute,d.second,d.millisec),e.setMicroseconds(d.microsec),null!=d.timezone&&(d.support.timezone||null!==d._defaults.timezone||(d.timezone=-1*e.getTimezoneOffset()),e=$.timepicker.timezoneAdjust(e,d.timezone,$.timepicker.timezoneOffsetString(-e.getTimezoneOffset())))),e}return this._base_getDateDatepicker(a,b)}},$.datepicker._base_parseDate=$.datepicker.parseDate,$.datepicker.parseDate=function(a,b,c){var d;try{d=this._base_parseDate(a,b,c)}catch(e){if(!(e.indexOf(":")>=0))throw e;d=this._base_parseDate(a,b.substring(0,b.length-(e.length-e.indexOf(":")-2)),c),$.timepicker.log("Error parsing the date string: "+e+"\ndate string = "+b+"\ndate format = "+a)}return d},$.datepicker._base_formatDate=$.datepicker._formatDate,$.datepicker._formatDate=function(a,b,c,d){var e=this._get(a,"timepicker");return e?(e._updateDateTime(a),e.$input.val()):this._base_formatDate(a)},$.datepicker._base_optionDatepicker=$.datepicker._optionDatepicker,$.datepicker._optionDatepicker=function(a,b,c){var d,e=this._getInst(a);if(!e)return null;var f=this._get(e,"timepicker");if(f){var g,h,i,j,k=null,l=null,m=null,n=f._defaults.evnts,o={};if("string"==typeof b){if("minDate"===b||"minDateTime"===b)k=c;else if("maxDate"===b||"maxDateTime"===b)l=c;else if("onSelect"===b)m=c;else if(n.hasOwnProperty(b)){if("undefined"==typeof c)return n[b];o[b]=c,d={}}}else if("object"==typeof b){b.minDate?k=b.minDate:b.minDateTime?k=b.minDateTime:b.maxDate?l=b.maxDate:b.maxDateTime&&(l=b.maxDateTime);for(g in n)n.hasOwnProperty(g)&&b[g]&&(o[g]=b[g])}for(g in o)o.hasOwnProperty(g)&&(n[g]=o[g],d||(d=$.extend({},b)),delete d[g]);if(d&&isEmptyObject(d))return;if(k?(k=0===k?new Date:new Date(k),f._defaults.minDate=k,f._defaults.minDateTime=k):l?(l=0===l?new Date:new Date(l),f._defaults.maxDate=l,f._defaults.maxDateTime=l):m&&(f._defaults.onSelect=m),k||l)return j=$(a),i=j.datetimepicker("getDate"),h=this._base_optionDatepicker.call($.datepicker,a,d||b,c),j.datetimepicker("setDate",i),h}return void 0===c?this._base_optionDatepicker.call($.datepicker,a,b):this._base_optionDatepicker.call($.datepicker,a,d||b,c)};var isEmptyObject=function(a){var b;for(b in a)if(a.hasOwnProperty(b))return!1;return!0},extendRemove=function(a,b){$.extend(a,b);for(var c in b)(null===b[c]||void 0===b[c])&&(a[c]=b[c]);return a},detectSupport=function(a){var b=a.replace(/'.*?'/g,"").toLowerCase(),c=function(a,b){return-1!==a.indexOf(b)?!0:!1};return{hour:c(b,"h"),minute:c(b,"m"),second:c(b,"s"),millisec:c(b,"l"),microsec:c(b,"c"),timezone:c(b,"z"),ampm:c(b,"t")&&c(a,"h"),iso8601:c(a,"Z")}},convert24to12=function(a){return a%=12,0===a&&(a=12),String(a)},computeEffectiveSetting=function(a,b){return a&&a[b]?a[b]:$.timepicker._defaults[b]},splitDateTime=function(a,b){var c=computeEffectiveSetting(b,"separator"),d=computeEffectiveSetting(b,"timeFormat"),e=d.split(c),f=e.length,g=a.split(c),h=g.length;return h>1?{dateString:g.splice(0,h-f).join(c),timeString:g.splice(0,f).join(c)}:{dateString:a,timeString:""}},parseDateTimeInternal=function(a,b,c,d,e){var f,g,h;if(g=splitDateTime(c,e),f=$.datepicker._base_parseDate(a,g.dateString,d),""===g.timeString)return{date:f};if(h=$.datepicker.parseTime(b,g.timeString,e),!h)throw"Wrong time format";return{date:f,timeObj:h}},selectLocalTimezone=function(a,b){if(a&&a.timezone_select){var c=b||new Date;a.timezone_select.val(-c.getTimezoneOffset())}};$.timepicker=new Timepicker,$.timepicker.timezoneOffsetString=function(a,b){if(isNaN(a)||a>840||-720>a)return a;var c=a,d=c%60,e=(c-d)/60,f=b?":":"",g=(c>=0?"+":"-")+("0"+Math.abs(e)).slice(-2)+f+("0"+Math.abs(d)).slice(-2);return"+00:00"===g?"Z":g},$.timepicker.timezoneOffsetNumber=function(a){var b=a.toString().replace(":","");return"Z"===b.toUpperCase()?0:/^(\-|\+)\d{4}$/.test(b)?("-"===b.substr(0,1)?-1:1)*(60*parseInt(b.substr(1,2),10)+parseInt(b.substr(3,2),10)):parseInt(a,10)},$.timepicker.timezoneAdjust=function(a,b,c){var d=$.timepicker.timezoneOffsetNumber(b),e=$.timepicker.timezoneOffsetNumber(c);return isNaN(e)||a.setMinutes(a.getMinutes()+-d- -e),a},$.timepicker.timeRange=function(a,b,c){return $.timepicker.handleRange("timepicker",a,b,c)},$.timepicker.datetimeRange=function(a,b,c){$.timepicker.handleRange("datetimepicker",a,b,c)},$.timepicker.dateRange=function(a,b,c){$.timepicker.handleRange("datepicker",a,b,c)},$.timepicker.handleRange=function(a,b,c,d){function e(e,f){var g=b[a]("getDate"),h=c[a]("getDate"),i=e[a]("getDate");if(null!==g){var j=new Date(g.getTime()),k=new Date(g.getTime());j.setMilliseconds(j.getMilliseconds()+d.minInterval),k.setMilliseconds(k.getMilliseconds()+d.maxInterval),d.minInterval>0&&j>h?c[a]("setDate",j):d.maxInterval>0&&h>k?c[a]("setDate",k):g>h&&f[a]("setDate",i)}}function f(b,c,e){if(b.val()){var f=b[a].call(b,"getDate");null!==f&&d.minInterval>0&&("minDate"===e&&f.setMilliseconds(f.getMilliseconds()+d.minInterval),"maxDate"===e&&f.setMilliseconds(f.getMilliseconds()-d.minInterval)),f.getTime&&c[a].call(c,"option",e,f)}}d=$.extend({},{minInterval:0,maxInterval:0,start:{},end:{}},d);var g=!1;return"timepicker"===a&&(g=!0,a="datetimepicker"),$.fn[a].call(b,$.extend({timeOnly:g,onClose:function(a,b){e($(this),c)},onSelect:function(a){f($(this),c,"minDate")}},d,d.start)),$.fn[a].call(c,$.extend({timeOnly:g,onClose:function(a,c){e($(this),b)},onSelect:function(a){f($(this),b,"maxDate")}},d,d.end)),e(b,c),f(b,c,"minDate"),f(c,b,"maxDate"),$([b.get(0),c.get(0)])},$.timepicker.log=function(){window.console&&window.console.log&&window.console.log.apply&&window.console.log.apply(window.console,Array.prototype.slice.call(arguments))},$.timepicker._util={_extendRemove:extendRemove,_isEmptyObject:isEmptyObject,_convert24to12:convert24to12,_detectSupport:detectSupport,_selectLocalTimezone:selectLocalTimezone,_computeEffectiveSetting:computeEffectiveSetting,_splitDateTime:splitDateTime,_parseDateTimeInternal:parseDateTimeInternal},Date.prototype.getMicroseconds||(Date.prototype.microseconds=0,Date.prototype.getMicroseconds=function(){return this.microseconds},Date.prototype.setMicroseconds=function(a){return this.setMilliseconds(this.getMilliseconds()+Math.floor(a/1e3)),this.microseconds=a%1e3,this}),$.timepicker.version="1.6.3"}});
|
assets/js/wp-bulk-delete-admin.js
CHANGED
@@ -1,302 +1,302 @@
|
|
1 |
-
(function( $ ) {
|
2 |
-
'use strict';
|
3 |
-
|
4 |
-
/**
|
5 |
-
* All of the code for your admin-facing JavaScript source
|
6 |
-
* should reside in this file.
|
7 |
-
*
|
8 |
-
* Note: It has been assumed you will write jQuery code here, so the
|
9 |
-
* $ function reference has been prepared for usage within the scope
|
10 |
-
* of this function.
|
11 |
-
*
|
12 |
-
* This enables you to define handlers, for when the DOM is ready:
|
13 |
-
*
|
14 |
-
* $(function() {
|
15 |
-
*
|
16 |
-
* });
|
17 |
-
*
|
18 |
-
* When the window is loaded:
|
19 |
-
*
|
20 |
-
* $( window ).load(function() {
|
21 |
-
*
|
22 |
-
* });
|
23 |
-
*
|
24 |
-
* ...and/or other possibilities.
|
25 |
-
*
|
26 |
-
* Ideally, it is not considered best practise to attach more than a
|
27 |
-
* single DOM-ready or window-load handler for a particular page.
|
28 |
-
* Although scripts in the WordPress core, Plugins and Themes may be
|
29 |
-
* practising this, we should strive to set a better example in our own work.
|
30 |
-
*/
|
31 |
-
jQuery(document).ready(function(){
|
32 |
-
jQuery('.delete_all_datepicker').datepicker({
|
33 |
-
changeMonth: true,
|
34 |
-
changeYear: true,
|
35 |
-
dateFormat: 'yy-mm-dd'
|
36 |
-
});
|
37 |
-
});
|
38 |
-
|
39 |
-
// Delete posts form handle.
|
40 |
-
jQuery(document).ready(function() {
|
41 |
-
jQuery('#delete_posts_submit').on( 'click', function() {
|
42 |
-
if(jQuery('input[name="delete_time"]:checked').val() === "scheduled"){
|
43 |
-
jQuery("#delete_posts_form").submit();
|
44 |
-
return;
|
45 |
-
}
|
46 |
-
var deleteform = jQuery("#delete_posts_form").serialize();
|
47 |
-
var data = {
|
48 |
-
'action': 'delete_posts_count',
|
49 |
-
'form': deleteform
|
50 |
-
};
|
51 |
-
jQuery(".spinner").addClass("is-active");
|
52 |
-
jQuery.post(ajaxurl, data, function(response) {
|
53 |
-
if( response != '' ){
|
54 |
-
var response = jQuery.parseJSON( response );
|
55 |
-
if( response.status == 0 ){
|
56 |
-
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
|
57 |
-
} else if( response.status == 2 ){
|
58 |
-
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
|
59 |
-
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
|
60 |
-
} else if( response.status == 1 ){
|
61 |
-
if ( confirm( response.post_count + ' posts will be delete. Would you like to proceed further?' ) ){
|
62 |
-
jQuery("#delete_posts_form").submit();
|
63 |
-
}
|
64 |
-
}
|
65 |
-
}
|
66 |
-
jQuery(".spinner").removeClass("is-active");
|
67 |
-
});
|
68 |
-
});
|
69 |
-
});
|
70 |
-
|
71 |
-
// Render Dynamic taxomony.
|
72 |
-
jQuery(document).ready(function() {
|
73 |
-
jQuery('#delete_post_type').on( 'change', function() {
|
74 |
-
var post_type = jQuery(this).val();
|
75 |
-
var data = {
|
76 |
-
'action': 'render_taxonomy_by_posttype',
|
77 |
-
'post_type': post_type
|
78 |
-
};
|
79 |
-
|
80 |
-
var taxomony_space = jQuery('.post_taxonomy');
|
81 |
-
jQuery('.taxo_terms_title').html('');
|
82 |
-
jQuery('.post_taxo_terms').html('');
|
83 |
-
taxomony_space.html('<span class="spinner is-active" style="float: none;"></span>');
|
84 |
-
// send ajax request.
|
85 |
-
jQuery.post(ajaxurl, data, function(response) {
|
86 |
-
if( response != '' ){
|
87 |
-
taxomony_space.html( response );
|
88 |
-
}else{
|
89 |
-
taxomony_space.html( '' );
|
90 |
-
}
|
91 |
-
});
|
92 |
-
});
|
93 |
-
});
|
94 |
-
|
95 |
-
// Render Dynamic Terms.
|
96 |
-
jQuery(document).ready(function() {
|
97 |
-
jQuery(document).on( 'change', '.post_taxonomy_radio', function() {
|
98 |
-
|
99 |
-
var post_taxomony = jQuery(this).val();
|
100 |
-
var xt_taxonomy_title = jQuery(this).attr( 'title' );
|
101 |
-
jQuery('.taxo_terms_title').html( xt_taxonomy_title + ':');
|
102 |
-
var data = {
|
103 |
-
'action': 'render_terms_by_taxonomy',
|
104 |
-
'post_taxomony': post_taxomony
|
105 |
-
};
|
106 |
-
|
107 |
-
var terms_space = jQuery('.post_taxo_terms');
|
108 |
-
terms_space.html('<span class="spinner is-active" style="float: none;"></span>');
|
109 |
-
// send ajax request.
|
110 |
-
jQuery.post(ajaxurl, data, function(response) {
|
111 |
-
if( response != '' ){
|
112 |
-
terms_space.html( response );
|
113 |
-
jQuery(".taxonomy_terms_select").chosen({placeholder_text_multiple:"Select "+xt_taxonomy_title });
|
114 |
-
}else{
|
115 |
-
terms_space.html( '' );
|
116 |
-
}
|
117 |
-
});
|
118 |
-
});
|
119 |
-
});
|
120 |
-
|
121 |
-
|
122 |
-
// Delete users form handle.
|
123 |
-
jQuery(document).ready(function() {
|
124 |
-
jQuery('#delete_users_submit').on( 'click', function() {
|
125 |
-
if(jQuery('input[name="delete_time"]:checked').val() === "scheduled"){
|
126 |
-
jQuery("#delete_users_form").submit();
|
127 |
-
return;
|
128 |
-
}
|
129 |
-
var deleteuserform = jQuery("#delete_users_form").serialize();
|
130 |
-
var data = {
|
131 |
-
'action': 'delete_users_count',
|
132 |
-
'form': deleteuserform
|
133 |
-
};
|
134 |
-
jQuery(".spinner").addClass("is-active");
|
135 |
-
jQuery.post(ajaxurl, data, function(response) {
|
136 |
-
if( response != '' ){
|
137 |
-
var response = jQuery.parseJSON( response );
|
138 |
-
if( response.status == 0 ){
|
139 |
-
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
|
140 |
-
} else if( response.status == 2 ){
|
141 |
-
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
|
142 |
-
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
|
143 |
-
} else if( response.status == 1 ){
|
144 |
-
if ( confirm( response.post_count + ' users will be delete. Would you like to proceed further?' ) ){
|
145 |
-
jQuery("#delete_users_form").submit();
|
146 |
-
}
|
147 |
-
}
|
148 |
-
}
|
149 |
-
jQuery(".spinner").removeClass("is-active");
|
150 |
-
});
|
151 |
-
});
|
152 |
-
});
|
153 |
-
|
154 |
-
// Delete comments form handle.
|
155 |
-
jQuery(document).ready(function() {
|
156 |
-
jQuery('#delete_comments_submit').on( 'click', function() {
|
157 |
-
if(jQuery('input[name="delete_time"]:checked').val() === "scheduled"){
|
158 |
-
jQuery("#delete_comments_form").submit();
|
159 |
-
return;
|
160 |
-
}
|
161 |
-
var deletecommentform = jQuery("#delete_comments_form").serialize();
|
162 |
-
var data = {
|
163 |
-
'action': 'delete_comments_count',
|
164 |
-
'form': deletecommentform
|
165 |
-
};
|
166 |
-
jQuery(".spinner").addClass("is-active");
|
167 |
-
jQuery.post(ajaxurl, data, function(response) {
|
168 |
-
if( response != '' ){
|
169 |
-
var response = jQuery.parseJSON( response );
|
170 |
-
if( response.status == 0 ){
|
171 |
-
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
|
172 |
-
} else if( response.status == 2 ){
|
173 |
-
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
|
174 |
-
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
|
175 |
-
} else if( response.status == 1 ){
|
176 |
-
if ( confirm( response.post_count + ' comments will be delete. Would you like to proceed further?' ) ){
|
177 |
-
jQuery("#delete_comments_form").submit();
|
178 |
-
}
|
179 |
-
}
|
180 |
-
}
|
181 |
-
jQuery(".spinner").removeClass("is-active");
|
182 |
-
});
|
183 |
-
});
|
184 |
-
});
|
185 |
-
|
186 |
-
// Delete meta form handle.
|
187 |
-
jQuery(document).ready(function() {
|
188 |
-
jQuery('#delete_meta_submit').on( 'click', function() {
|
189 |
-
if(jQuery('input[name="delete_time"]:checked').val() === "scheduled"){
|
190 |
-
jQuery("#delete_meta_form").submit();
|
191 |
-
return;
|
192 |
-
}
|
193 |
-
var metaform = jQuery("#delete_meta_form").serialize();
|
194 |
-
var data = {
|
195 |
-
'action': 'delete_meta_count',
|
196 |
-
'form': metaform
|
197 |
-
};
|
198 |
-
jQuery(".spinner").addClass("is-active");
|
199 |
-
jQuery.post(ajaxurl, data, function(response) {
|
200 |
-
if( response != '' ){
|
201 |
-
var response = jQuery.parseJSON( response );
|
202 |
-
if( response.status == 0 ){
|
203 |
-
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
|
204 |
-
} else if( response.status == 2 ){
|
205 |
-
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
|
206 |
-
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
|
207 |
-
} else if( response.status == 1 ){
|
208 |
-
if ( confirm( response.post_count + ' meta will be delete. Would you like to proceed further?' ) ){
|
209 |
-
jQuery("#delete_meta_form").submit();
|
210 |
-
}
|
211 |
-
}
|
212 |
-
}
|
213 |
-
jQuery(".spinner").removeClass("is-active");
|
214 |
-
});
|
215 |
-
});
|
216 |
-
});
|
217 |
-
|
218 |
-
|
219 |
-
// Delete meta form handle.
|
220 |
-
jQuery(document).ready(function() {
|
221 |
-
jQuery('#delete_terms_submit').on( 'click', function() {
|
222 |
-
var termform = jQuery("#delete_terms_form").serialize();
|
223 |
-
var data = {
|
224 |
-
'action': 'delete_terms_count',
|
225 |
-
'form': termform
|
226 |
-
};
|
227 |
-
jQuery(".spinner").addClass("is-active");
|
228 |
-
jQuery.post(ajaxurl, data, function(response) {
|
229 |
-
if( response != '' ){
|
230 |
-
var response = jQuery.parseJSON( response );
|
231 |
-
if( response.status == 0 ){
|
232 |
-
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
|
233 |
-
} else if( response.status == 2 ){
|
234 |
-
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
|
235 |
-
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
|
236 |
-
} else if( response.status == 1 ){
|
237 |
-
if ( confirm( response.post_count + ' Terms will be delete. Would you like to proceed further?' ) ){
|
238 |
-
jQuery("#delete_terms_form").submit();
|
239 |
-
}
|
240 |
-
}
|
241 |
-
}
|
242 |
-
jQuery(".spinner").removeClass("is-active");
|
243 |
-
});
|
244 |
-
});
|
245 |
-
});
|
246 |
-
|
247 |
-
//
|
248 |
-
jQuery(document).ready(function(){
|
249 |
-
jQuery("#reassign_user").chosen({max_selected_options: 1});
|
250 |
-
jQuery(".chosen_select").chosen({max_selected_options: 1});
|
251 |
-
});
|
252 |
-
|
253 |
-
// Render Dynamic post dropdown.
|
254 |
-
jQuery(document).ready(function() {
|
255 |
-
jQuery('#meta_post_type').on( 'change', function() {
|
256 |
-
var post_type = jQuery(this).val();
|
257 |
-
var data = {
|
258 |
-
'action': 'render_postdropdown_by_posttype',
|
259 |
-
'post_type': post_type
|
260 |
-
};
|
261 |
-
|
262 |
-
var postdropdown_space = jQuery('.postdropdown_space');
|
263 |
-
postdropdown_space.html('<span class="spinner is-active" style="float: none;"></span>');
|
264 |
-
// send ajax request.
|
265 |
-
jQuery.post(ajaxurl, data, function(response) {
|
266 |
-
if( response != '' ){
|
267 |
-
postdropdown_space.html( response );
|
268 |
-
jQuery(".post_for_meta").chosen({placeholder_text_multiple:"Select posts"});
|
269 |
-
}else{
|
270 |
-
postdropdown_space.html( '' );
|
271 |
-
}
|
272 |
-
});
|
273 |
-
});
|
274 |
-
|
275 |
-
jQuery('.date_type').on( 'change', function() {
|
276 |
-
var date_type = jQuery(this).val();
|
277 |
-
if(date_type === 'custom_date'){
|
278 |
-
jQuery(".wpbd_date_days").hide();
|
279 |
-
jQuery(".wpbd_custom_interval").show();
|
280 |
-
}else{
|
281 |
-
jQuery(".wpbd_custom_interval").hide();
|
282 |
-
jQuery(".wpbd_date_days").show();
|
283 |
-
}
|
284 |
-
});
|
285 |
-
|
286 |
-
jQuery('.delete_frequency').on( 'change', function() {
|
287 |
-
var date_type = jQuery(this).val();
|
288 |
-
if(date_type === 'not_repeat'){
|
289 |
-
jQuery(".wpbd_schedule_name_wrap").hide();
|
290 |
-
}else{
|
291 |
-
jQuery(".wpbd_schedule_name_wrap").show();
|
292 |
-
}
|
293 |
-
});
|
294 |
-
});
|
295 |
-
|
296 |
-
jQuery(document).ready(function(){
|
297 |
-
jQuery('.delete_all_datetimepicker').datetimepicker({
|
298 |
-
dateFormat: 'yy-mm-dd',
|
299 |
-
timeFormat: 'HH:mm:ss'
|
300 |
-
});
|
301 |
-
});
|
302 |
-
})( jQuery );
|
1 |
+
(function( $ ) {
|
2 |
+
'use strict';
|
3 |
+
|
4 |
+
/**
|
5 |
+
* All of the code for your admin-facing JavaScript source
|
6 |
+
* should reside in this file.
|
7 |
+
*
|
8 |
+
* Note: It has been assumed you will write jQuery code here, so the
|
9 |
+
* $ function reference has been prepared for usage within the scope
|
10 |
+
* of this function.
|
11 |
+
*
|
12 |
+
* This enables you to define handlers, for when the DOM is ready:
|
13 |
+
*
|
14 |
+
* $(function() {
|
15 |
+
*
|
16 |
+
* });
|
17 |
+
*
|
18 |
+
* When the window is loaded:
|
19 |
+
*
|
20 |
+
* $( window ).load(function() {
|
21 |
+
*
|
22 |
+
* });
|
23 |
+
*
|
24 |
+
* ...and/or other possibilities.
|
25 |
+
*
|
26 |
+
* Ideally, it is not considered best practise to attach more than a
|
27 |
+
* single DOM-ready or window-load handler for a particular page.
|
28 |
+
* Although scripts in the WordPress core, Plugins and Themes may be
|
29 |
+
* practising this, we should strive to set a better example in our own work.
|
30 |
+
*/
|
31 |
+
jQuery(document).ready(function(){
|
32 |
+
jQuery('.delete_all_datepicker').datepicker({
|
33 |
+
changeMonth: true,
|
34 |
+
changeYear: true,
|
35 |
+
dateFormat: 'yy-mm-dd'
|
36 |
+
});
|
37 |
+
});
|
38 |
+
|
39 |
+
// Delete posts form handle.
|
40 |
+
jQuery(document).ready(function() {
|
41 |
+
jQuery('#delete_posts_submit').on( 'click', function() {
|
42 |
+
if(jQuery('input[name="delete_time"]:checked').val() === "scheduled"){
|
43 |
+
jQuery("#delete_posts_form").submit();
|
44 |
+
return;
|
45 |
+
}
|
46 |
+
var deleteform = jQuery("#delete_posts_form").serialize();
|
47 |
+
var data = {
|
48 |
+
'action': 'delete_posts_count',
|
49 |
+
'form': deleteform
|
50 |
+
};
|
51 |
+
jQuery(".spinner").addClass("is-active");
|
52 |
+
jQuery.post(ajaxurl, data, function(response) {
|
53 |
+
if( response != '' ){
|
54 |
+
var response = jQuery.parseJSON( response );
|
55 |
+
if( response.status == 0 ){
|
56 |
+
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
|
57 |
+
} else if( response.status == 2 ){
|
58 |
+
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
|
59 |
+
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
|
60 |
+
} else if( response.status == 1 ){
|
61 |
+
if ( confirm( response.post_count + ' posts will be delete. Would you like to proceed further?' ) ){
|
62 |
+
jQuery("#delete_posts_form").submit();
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
66 |
+
jQuery(".spinner").removeClass("is-active");
|
67 |
+
});
|
68 |
+
});
|
69 |
+
});
|
70 |
+
|
71 |
+
// Render Dynamic taxomony.
|
72 |
+
jQuery(document).ready(function() {
|
73 |
+
jQuery('#delete_post_type').on( 'change', function() {
|
74 |
+
var post_type = jQuery(this).val();
|
75 |
+
var data = {
|
76 |
+
'action': 'render_taxonomy_by_posttype',
|
77 |
+
'post_type': post_type
|
78 |
+
};
|
79 |
+
|
80 |
+
var taxomony_space = jQuery('.post_taxonomy');
|
81 |
+
jQuery('.taxo_terms_title').html('');
|
82 |
+
jQuery('.post_taxo_terms').html('');
|
83 |
+
taxomony_space.html('<span class="spinner is-active" style="float: none;"></span>');
|
84 |
+
// send ajax request.
|
85 |
+
jQuery.post(ajaxurl, data, function(response) {
|
86 |
+
if( response != '' ){
|
87 |
+
taxomony_space.html( response );
|
88 |
+
}else{
|
89 |
+
taxomony_space.html( '' );
|
90 |
+
}
|
91 |
+
});
|
92 |
+
});
|
93 |
+
});
|
94 |
+
|
95 |
+
// Render Dynamic Terms.
|
96 |
+
jQuery(document).ready(function() {
|
97 |
+
jQuery(document).on( 'change', '.post_taxonomy_radio', function() {
|
98 |
+
|
99 |
+
var post_taxomony = jQuery(this).val();
|
100 |
+
var xt_taxonomy_title = jQuery(this).attr( 'title' );
|
101 |
+
jQuery('.taxo_terms_title').html( xt_taxonomy_title + ':');
|
102 |
+
var data = {
|
103 |
+
'action': 'render_terms_by_taxonomy',
|
104 |
+
'post_taxomony': post_taxomony
|
105 |
+
};
|
106 |
+
|
107 |
+
var terms_space = jQuery('.post_taxo_terms');
|
108 |
+
terms_space.html('<span class="spinner is-active" style="float: none;"></span>');
|
109 |
+
// send ajax request.
|
110 |
+
jQuery.post(ajaxurl, data, function(response) {
|
111 |
+
if( response != '' ){
|
112 |
+
terms_space.html( response );
|
113 |
+
jQuery(".taxonomy_terms_select").chosen({placeholder_text_multiple:"Select "+xt_taxonomy_title });
|
114 |
+
}else{
|
115 |
+
terms_space.html( '' );
|
116 |
+
}
|
117 |
+
});
|
118 |
+
});
|
119 |
+
});
|
120 |
+
|
121 |
+
|
122 |
+
// Delete users form handle.
|
123 |
+
jQuery(document).ready(function() {
|
124 |
+
jQuery('#delete_users_submit').on( 'click', function() {
|
125 |
+
if(jQuery('input[name="delete_time"]:checked').val() === "scheduled"){
|
126 |
+
jQuery("#delete_users_form").submit();
|
127 |
+
return;
|
128 |
+
}
|
129 |
+
var deleteuserform = jQuery("#delete_users_form").serialize();
|
130 |
+
var data = {
|
131 |
+
'action': 'delete_users_count',
|
132 |
+
'form': deleteuserform
|
133 |
+
};
|
134 |
+
jQuery(".spinner").addClass("is-active");
|
135 |
+
jQuery.post(ajaxurl, data, function(response) {
|
136 |
+
if( response != '' ){
|
137 |
+
var response = jQuery.parseJSON( response );
|
138 |
+
if( response.status == 0 ){
|
139 |
+
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
|
140 |
+
} else if( response.status == 2 ){
|
141 |
+
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
|
142 |
+
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
|
143 |
+
} else if( response.status == 1 ){
|
144 |
+
if ( confirm( response.post_count + ' users will be delete. Would you like to proceed further?' ) ){
|
145 |
+
jQuery("#delete_users_form").submit();
|
146 |
+
}
|
147 |
+
}
|
148 |
+
}
|
149 |
+
jQuery(".spinner").removeClass("is-active");
|
150 |
+
});
|
151 |
+
});
|
152 |
+
});
|
153 |
+
|
154 |
+
// Delete comments form handle.
|
155 |
+
jQuery(document).ready(function() {
|
156 |
+
jQuery('#delete_comments_submit').on( 'click', function() {
|
157 |
+
if(jQuery('input[name="delete_time"]:checked').val() === "scheduled"){
|
158 |
+
jQuery("#delete_comments_form").submit();
|
159 |
+
return;
|
160 |
+
}
|
161 |
+
var deletecommentform = jQuery("#delete_comments_form").serialize();
|
162 |
+
var data = {
|
163 |
+
'action': 'delete_comments_count',
|
164 |
+
'form': deletecommentform
|
165 |
+
};
|
166 |
+
jQuery(".spinner").addClass("is-active");
|
167 |
+
jQuery.post(ajaxurl, data, function(response) {
|
168 |
+
if( response != '' ){
|
169 |
+
var response = jQuery.parseJSON( response );
|
170 |
+
if( response.status == 0 ){
|
171 |
+
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
|
172 |
+
} else if( response.status == 2 ){
|
173 |
+
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
|
174 |
+
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
|
175 |
+
} else if( response.status == 1 ){
|
176 |
+
if ( confirm( response.post_count + ' comments will be delete. Would you like to proceed further?' ) ){
|
177 |
+
jQuery("#delete_comments_form").submit();
|
178 |
+
}
|
179 |
+
}
|
180 |
+
}
|
181 |
+
jQuery(".spinner").removeClass("is-active");
|
182 |
+
});
|
183 |
+
});
|
184 |
+
});
|
185 |
+
|
186 |
+
// Delete meta form handle.
|
187 |
+
jQuery(document).ready(function() {
|
188 |
+
jQuery('#delete_meta_submit').on( 'click', function() {
|
189 |
+
if(jQuery('input[name="delete_time"]:checked').val() === "scheduled"){
|
190 |
+
jQuery("#delete_meta_form").submit();
|
191 |
+
return;
|
192 |
+
}
|
193 |
+
var metaform = jQuery("#delete_meta_form").serialize();
|
194 |
+
var data = {
|
195 |
+
'action': 'delete_meta_count',
|
196 |
+
'form': metaform
|
197 |
+
};
|
198 |
+
jQuery(".spinner").addClass("is-active");
|
199 |
+
jQuery.post(ajaxurl, data, function(response) {
|
200 |
+
if( response != '' ){
|
201 |
+
var response = jQuery.parseJSON( response );
|
202 |
+
if( response.status == 0 ){
|
203 |
+
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
|
204 |
+
} else if( response.status == 2 ){
|
205 |
+
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
|
206 |
+
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
|
207 |
+
} else if( response.status == 1 ){
|
208 |
+
if ( confirm( response.post_count + ' meta will be delete. Would you like to proceed further?' ) ){
|
209 |
+
jQuery("#delete_meta_form").submit();
|
210 |
+
}
|
211 |
+
}
|
212 |
+
}
|
213 |
+
jQuery(".spinner").removeClass("is-active");
|
214 |
+
});
|
215 |
+
});
|
216 |
+
});
|
217 |
+
|
218 |
+
|
219 |
+
// Delete meta form handle.
|
220 |
+
jQuery(document).ready(function() {
|
221 |
+
jQuery('#delete_terms_submit').on( 'click', function() {
|
222 |
+
var termform = jQuery("#delete_terms_form").serialize();
|
223 |
+
var data = {
|
224 |
+
'action': 'delete_terms_count',
|
225 |
+
'form': termform
|
226 |
+
};
|
227 |
+
jQuery(".spinner").addClass("is-active");
|
228 |
+
jQuery.post(ajaxurl, data, function(response) {
|
229 |
+
if( response != '' ){
|
230 |
+
var response = jQuery.parseJSON( response );
|
231 |
+
if( response.status == 0 ){
|
232 |
+
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
|
233 |
+
} else if( response.status == 2 ){
|
234 |
+
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
|
235 |
+
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
|
236 |
+
} else if( response.status == 1 ){
|
237 |
+
if ( confirm( response.post_count + ' Terms will be delete. Would you like to proceed further?' ) ){
|
238 |
+
jQuery("#delete_terms_form").submit();
|
239 |
+
}
|
240 |
+
}
|
241 |
+
}
|
242 |
+
jQuery(".spinner").removeClass("is-active");
|
243 |
+
});
|
244 |
+
});
|
245 |
+
});
|
246 |
+
|
247 |
+
//
|
248 |
+
jQuery(document).ready(function(){
|
249 |
+
jQuery("#reassign_user").chosen({max_selected_options: 1});
|
250 |
+
jQuery(".chosen_select").chosen({max_selected_options: 1});
|
251 |
+
});
|
252 |
+
|
253 |
+
// Render Dynamic post dropdown.
|
254 |
+
jQuery(document).ready(function() {
|
255 |
+
jQuery('#meta_post_type').on( 'change', function() {
|
256 |
+
var post_type = jQuery(this).val();
|
257 |
+
var data = {
|
258 |
+
'action': 'render_postdropdown_by_posttype',
|
259 |
+
'post_type': post_type
|
260 |
+
};
|
261 |
+
|
262 |
+
var postdropdown_space = jQuery('.postdropdown_space');
|
263 |
+
postdropdown_space.html('<span class="spinner is-active" style="float: none;"></span>');
|
264 |
+
// send ajax request.
|
265 |
+
jQuery.post(ajaxurl, data, function(response) {
|
266 |
+
if( response != '' ){
|
267 |
+
postdropdown_space.html( response );
|
268 |
+
jQuery(".post_for_meta").chosen({placeholder_text_multiple:"Select posts"});
|
269 |
+
}else{
|
270 |
+
postdropdown_space.html( '' );
|
271 |
+
}
|
272 |
+
});
|
273 |
+
});
|
274 |
+
|
275 |
+
jQuery('.date_type').on( 'change', function() {
|
276 |
+
var date_type = jQuery(this).val();
|
277 |
+
if(date_type === 'custom_date'){
|
278 |
+
jQuery(".wpbd_date_days").hide();
|
279 |
+
jQuery(".wpbd_custom_interval").show();
|
280 |
+
}else{
|
281 |
+
jQuery(".wpbd_custom_interval").hide();
|
282 |
+
jQuery(".wpbd_date_days").show();
|
283 |
+
}
|
284 |
+
});
|
285 |
+
|
286 |
+
jQuery('.delete_frequency').on( 'change', function() {
|
287 |
+
var date_type = jQuery(this).val();
|
288 |
+
if(date_type === 'not_repeat'){
|
289 |
+
jQuery(".wpbd_schedule_name_wrap").hide();
|
290 |
+
}else{
|
291 |
+
jQuery(".wpbd_schedule_name_wrap").show();
|
292 |
+
}
|
293 |
+
});
|
294 |
+
});
|
295 |
+
|
296 |
+
jQuery(document).ready(function(){
|
297 |
+
jQuery('.delete_all_datetimepicker').datetimepicker({
|
298 |
+
dateFormat: 'yy-mm-dd',
|
299 |
+
timeFormat: 'HH:mm:ss'
|
300 |
+
});
|
301 |
+
});
|
302 |
+
})( jQuery );
|
includes/admin/admin-pages.php
CHANGED
@@ -1,40 +1,40 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Pages
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Admin/Pages
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Create the Admin menu and submenu and assign their links to global varibles.
|
17 |
-
*
|
18 |
-
* @since 1.0
|
19 |
-
* @return void
|
20 |
-
*/
|
21 |
-
function wpbd_add_menu_pages() {
|
22 |
-
global $xt_delete_posts_page, $xt_delete_comments_page, $xt_delete_users_page, $xt_delete_meta_page, $xt_delete_taxonomy_page;
|
23 |
-
add_menu_page( __( 'WP Bulk Delete', 'wp-bulk-delete' ), __( 'WP Bulk Delete', 'wp-bulk-delete' ), 'manage_options', 'delete_all_posts',
|
24 |
-
'wpbd_delete_posts_page', 'dashicons-trash', '30' );
|
25 |
-
|
26 |
-
$xt_delete_posts_page = add_submenu_page( 'delete_all_posts', __( 'Delete Posts', 'wp-bulk-delete' ), __( 'Delete Posts', 'wp-bulk-delete' ), 'manage_options', 'delete_all_posts', 'wpbd_delete_posts_page' );
|
27 |
-
|
28 |
-
$xt_delete_comments_page = add_submenu_page( 'delete_all_posts', __( 'Delete Comments', 'wp-bulk-delete' ), __( 'Delete Comments', 'wp-bulk-delete' ), 'manage_options', 'delete_all_comments', 'wpbd_delete_comments_page' );
|
29 |
-
|
30 |
-
$xt_delete_users_page = add_submenu_page( 'delete_all_posts', __( 'Delete Users', 'wp-bulk-delete' ), __( 'Delete Users', 'wp-bulk-delete' ), 'manage_options', 'delete_all_users', 'wpbd_delete_users_page' );
|
31 |
-
|
32 |
-
$xt_delete_meta_page = add_submenu_page( 'delete_all_posts', __( 'Delete Meta Fields', 'wp-bulk-delete' ), __( 'Delete Meta Fields', 'wp-bulk-delete' ), 'manage_options', 'delete_all_meta', 'wpbd_delete_meta_page' );
|
33 |
-
|
34 |
-
$xt_delete_taxonomy_page = add_submenu_page( 'delete_all_posts', __( 'Delete Terms', 'wp-bulk-delete' ), __( 'Delete Terms', 'wp-bulk-delete' ), 'manage_options', 'wpbd_delete_terms', 'wpbd_delete_terms_page' );
|
35 |
-
|
36 |
-
$xt_delete_taxonomy_page = add_submenu_page( 'delete_all_posts', __( 'Cleanup', 'wp-bulk-delete' ), __( 'Cleanup', 'wp-bulk-delete' ), 'manage_options', 'wpbd_cleanup', 'wpbd_render_cleanup_page' );
|
37 |
-
|
38 |
-
$xt_delete_support_page = add_submenu_page( 'delete_all_posts', __( 'Support & Help', 'wp-bulk-delete' ), __( 'Support & Help', 'wp-bulk-delete' ), 'manage_options', 'wpbd_support', 'wpbd_render_support_page' );
|
39 |
-
}
|
40 |
add_action( 'admin_menu', 'wpbd_add_menu_pages', 10 );
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Pages
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Admin/Pages
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Create the Admin menu and submenu and assign their links to global varibles.
|
17 |
+
*
|
18 |
+
* @since 1.0
|
19 |
+
* @return void
|
20 |
+
*/
|
21 |
+
function wpbd_add_menu_pages() {
|
22 |
+
global $xt_delete_posts_page, $xt_delete_comments_page, $xt_delete_users_page, $xt_delete_meta_page, $xt_delete_taxonomy_page;
|
23 |
+
add_menu_page( __( 'WP Bulk Delete', 'wp-bulk-delete' ), __( 'WP Bulk Delete', 'wp-bulk-delete' ), 'manage_options', 'delete_all_posts',
|
24 |
+
'wpbd_delete_posts_page', 'dashicons-trash', '30' );
|
25 |
+
|
26 |
+
$xt_delete_posts_page = add_submenu_page( 'delete_all_posts', __( 'Delete Posts', 'wp-bulk-delete' ), __( 'Delete Posts', 'wp-bulk-delete' ), 'manage_options', 'delete_all_posts', 'wpbd_delete_posts_page' );
|
27 |
+
|
28 |
+
$xt_delete_comments_page = add_submenu_page( 'delete_all_posts', __( 'Delete Comments', 'wp-bulk-delete' ), __( 'Delete Comments', 'wp-bulk-delete' ), 'manage_options', 'delete_all_comments', 'wpbd_delete_comments_page' );
|
29 |
+
|
30 |
+
$xt_delete_users_page = add_submenu_page( 'delete_all_posts', __( 'Delete Users', 'wp-bulk-delete' ), __( 'Delete Users', 'wp-bulk-delete' ), 'manage_options', 'delete_all_users', 'wpbd_delete_users_page' );
|
31 |
+
|
32 |
+
$xt_delete_meta_page = add_submenu_page( 'delete_all_posts', __( 'Delete Meta Fields', 'wp-bulk-delete' ), __( 'Delete Meta Fields', 'wp-bulk-delete' ), 'manage_options', 'delete_all_meta', 'wpbd_delete_meta_page' );
|
33 |
+
|
34 |
+
$xt_delete_taxonomy_page = add_submenu_page( 'delete_all_posts', __( 'Delete Terms', 'wp-bulk-delete' ), __( 'Delete Terms', 'wp-bulk-delete' ), 'manage_options', 'wpbd_delete_terms', 'wpbd_delete_terms_page' );
|
35 |
+
|
36 |
+
$xt_delete_taxonomy_page = add_submenu_page( 'delete_all_posts', __( 'Cleanup', 'wp-bulk-delete' ), __( 'Cleanup', 'wp-bulk-delete' ), 'manage_options', 'wpbd_cleanup', 'wpbd_render_cleanup_page' );
|
37 |
+
|
38 |
+
$xt_delete_support_page = add_submenu_page( 'delete_all_posts', __( 'Support & Help', 'wp-bulk-delete' ), __( 'Support & Help', 'wp-bulk-delete' ), 'manage_options', 'wpbd_support', 'wpbd_render_support_page' );
|
39 |
+
}
|
40 |
add_action( 'admin_menu', 'wpbd_add_menu_pages', 10 );
|
includes/admin/admin-sidebar.php
CHANGED
@@ -1,51 +1,51 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sidebar for Admin Pages
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Admin/Pages
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Render Sidebar for Admin Pages.
|
17 |
-
*
|
18 |
-
* @since 1.1.0
|
19 |
-
* @return void
|
20 |
-
*/
|
21 |
-
function wpbd_admin_sidebar() {
|
22 |
-
if(!wpbd_is_pro()){
|
23 |
-
?>
|
24 |
-
<div class="upgrade_to_pro">
|
25 |
-
<h2><?php esc_html_e( 'Upgrade to Pro','wp-bulk-delete'); ?></h2>
|
26 |
-
<p><?php esc_html_e( 'Unlock more power to bulk delete operation, Upgrade today!!','wp-bulk-delete'); ?></p>
|
27 |
-
<a class="button button-primary upgrade_button" href="<?php echo esc_url(WPBD_PLUGIN_BUY_NOW_URL); ?>" target="_blank">
|
28 |
-
<?php esc_html_e( 'Upgrade to Pro','wp-bulk-delete'); ?>
|
29 |
-
</a>
|
30 |
-
</div>
|
31 |
-
|
32 |
-
<div class="upgrade_to_pro">
|
33 |
-
<h2><?php esc_html_e( 'Custom WordPress Development Services','wp-bulk-delete'); ?></h2>
|
34 |
-
<p><?php esc_html_e( "From small blog to complex web apps, we push the limits of what's possible with WordPress.","wp-bulk-delete" ); ?></p>
|
35 |
-
<a class="button button-primary upgrade_button" href="<?php echo esc_url('https://xylusthemes.com/contact/?utm_source=insideplugin&utm_medium=web&utm_content=sidebar&utm_campaign=freeplugin'); ?>" target="_blank">
|
36 |
-
<?php esc_html_e( 'Hire Us','wp-bulk-delete'); ?>
|
37 |
-
</a>
|
38 |
-
</div>
|
39 |
-
|
40 |
-
<div>
|
41 |
-
<p style="text-align:center">
|
42 |
-
<strong><?php esc_html_e( 'Would you like to remove these ads?','wp-bulk-delete'); ?></strong><br>
|
43 |
-
<a href="<?php echo esc_url(WPBD_PLUGIN_BUY_NOW_URL); ?>" target="_blank">
|
44 |
-
<?php esc_html_e( 'Get Premium','wp-bulk-delete'); ?>
|
45 |
-
</a>
|
46 |
-
</p>
|
47 |
-
</div>
|
48 |
-
<?php
|
49 |
-
}
|
50 |
-
}
|
51 |
add_action( 'wpbd_admin_sidebar', 'wpbd_admin_sidebar', 10 );
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Sidebar for Admin Pages
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Admin/Pages
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Render Sidebar for Admin Pages.
|
17 |
+
*
|
18 |
+
* @since 1.1.0
|
19 |
+
* @return void
|
20 |
+
*/
|
21 |
+
function wpbd_admin_sidebar() {
|
22 |
+
if(!wpbd_is_pro()){
|
23 |
+
?>
|
24 |
+
<div class="upgrade_to_pro">
|
25 |
+
<h2><?php esc_html_e( 'Upgrade to Pro','wp-bulk-delete'); ?></h2>
|
26 |
+
<p><?php esc_html_e( 'Unlock more power to bulk delete operation, Upgrade today!!','wp-bulk-delete'); ?></p>
|
27 |
+
<a class="button button-primary upgrade_button" href="<?php echo esc_url(WPBD_PLUGIN_BUY_NOW_URL); ?>" target="_blank">
|
28 |
+
<?php esc_html_e( 'Upgrade to Pro','wp-bulk-delete'); ?>
|
29 |
+
</a>
|
30 |
+
</div>
|
31 |
+
|
32 |
+
<div class="upgrade_to_pro">
|
33 |
+
<h2><?php esc_html_e( 'Custom WordPress Development Services','wp-bulk-delete'); ?></h2>
|
34 |
+
<p><?php esc_html_e( "From small blog to complex web apps, we push the limits of what's possible with WordPress.","wp-bulk-delete" ); ?></p>
|
35 |
+
<a class="button button-primary upgrade_button" href="<?php echo esc_url('https://xylusthemes.com/contact/?utm_source=insideplugin&utm_medium=web&utm_content=sidebar&utm_campaign=freeplugin'); ?>" target="_blank">
|
36 |
+
<?php esc_html_e( 'Hire Us','wp-bulk-delete'); ?>
|
37 |
+
</a>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<div>
|
41 |
+
<p style="text-align:center">
|
42 |
+
<strong><?php esc_html_e( 'Would you like to remove these ads?','wp-bulk-delete'); ?></strong><br>
|
43 |
+
<a href="<?php echo esc_url(WPBD_PLUGIN_BUY_NOW_URL); ?>" target="_blank">
|
44 |
+
<?php esc_html_e( 'Get Premium','wp-bulk-delete'); ?>
|
45 |
+
</a>
|
46 |
+
</p>
|
47 |
+
</div>
|
48 |
+
<?php
|
49 |
+
}
|
50 |
+
}
|
51 |
add_action( 'wpbd_admin_sidebar', 'wpbd_admin_sidebar', 10 );
|
includes/admin/cleanup/cleanup-form.php
CHANGED
@@ -1,99 +1,99 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Cleanup form
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Admin/Pages
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Cleanup form
|
16 |
-
*
|
17 |
-
* Render the Cleanup form
|
18 |
-
*
|
19 |
-
* @since 1.1.0
|
20 |
-
* @return void
|
21 |
-
*/
|
22 |
-
function wpbd_cleanup_form( $type = 'general' ){
|
23 |
-
|
24 |
-
if( ! empty( $_POST ) && isset( $_POST['run_post_cleanup'] ) ){
|
25 |
-
$messages = $error = array();
|
26 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
27 |
-
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
28 |
-
}
|
29 |
-
|
30 |
-
if ( isset( $_POST['_run_post_cleanup_wpnonce'] ) && wp_verify_nonce( $_POST['_run_post_cleanup_wpnonce'], 'run_post_cleanup_nonce' ) && empty( $error ) ) {
|
31 |
-
$cleanups = $_POST['cleanup_post_type'];
|
32 |
-
if( ! empty( $cleanups ) ){
|
33 |
-
foreach ($cleanups as $cleanuptype ) {
|
34 |
-
$messages[] = wpbulkdelete()->api->run_cleanup( $cleanuptype );
|
35 |
-
}
|
36 |
-
}
|
37 |
-
}else{
|
38 |
-
wp_die( esc_html__( 'Sorry, Your nonce did not verify.', 'wp-bulk-delete' ) );
|
39 |
-
}
|
40 |
-
|
41 |
-
if( !empty( $error ) ){
|
42 |
-
foreach ( $error as $err ) {
|
43 |
-
?>
|
44 |
-
<div class="notice notice-error">
|
45 |
-
<p><strong><?php echo $err; ?></strong></p>
|
46 |
-
</div>
|
47 |
-
<?php
|
48 |
-
}
|
49 |
-
}
|
50 |
-
if( ! empty( $messages ) ){
|
51 |
-
if (strlen(implode($messages)) == 0 ){
|
52 |
-
?>
|
53 |
-
<div class="notice notice-success">
|
54 |
-
<p><strong><?php esc_html_e( 'Nothing to cleanup!!', 'wp-bulk-delete' ); ?></strong></p>
|
55 |
-
</div>
|
56 |
-
<?php
|
57 |
-
}else{
|
58 |
-
foreach ( $messages as $message ) {
|
59 |
-
if( $message != '' ){
|
60 |
-
?>
|
61 |
-
<div class="notice notice-success">
|
62 |
-
<p><strong><?php echo $message; ?></strong></p>
|
63 |
-
</div>
|
64 |
-
<?php
|
65 |
-
}
|
66 |
-
}
|
67 |
-
}
|
68 |
-
}
|
69 |
-
}
|
70 |
-
?>
|
71 |
-
<form method="post" id="cleanup">
|
72 |
-
<table class="form-table">
|
73 |
-
<tbody>
|
74 |
-
<?php
|
75 |
-
if( 'general' == $type ) {
|
76 |
-
|
77 |
-
wpbd_render_post_cleanup();
|
78 |
-
wpbd_render_meta_cleanup();
|
79 |
-
|
80 |
-
}elseif( 'post' == $type ) {
|
81 |
-
|
82 |
-
wpbd_render_post_cleanup();
|
83 |
-
|
84 |
-
}elseif( 'meta' == $type ) {
|
85 |
-
|
86 |
-
wpbd_render_meta_cleanup();
|
87 |
-
|
88 |
-
}
|
89 |
-
wp_nonce_field('run_post_cleanup_nonce', '_run_post_cleanup_wpnonce' );
|
90 |
-
|
91 |
-
?>
|
92 |
-
</tbody>
|
93 |
-
</table>
|
94 |
-
<?php
|
95 |
-
submit_button( __('Run Cleanup','wp-bulk-delete'), 'primary','run_post_cleanup');
|
96 |
-
?>
|
97 |
-
</form>
|
98 |
-
<?php
|
99 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Cleanup form
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Admin/Pages
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Cleanup form
|
16 |
+
*
|
17 |
+
* Render the Cleanup form
|
18 |
+
*
|
19 |
+
* @since 1.1.0
|
20 |
+
* @return void
|
21 |
+
*/
|
22 |
+
function wpbd_cleanup_form( $type = 'general' ){
|
23 |
+
|
24 |
+
if( ! empty( $_POST ) && isset( $_POST['run_post_cleanup'] ) ){
|
25 |
+
$messages = $error = array();
|
26 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
27 |
+
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
28 |
+
}
|
29 |
+
|
30 |
+
if ( isset( $_POST['_run_post_cleanup_wpnonce'] ) && wp_verify_nonce( $_POST['_run_post_cleanup_wpnonce'], 'run_post_cleanup_nonce' ) && empty( $error ) ) {
|
31 |
+
$cleanups = $_POST['cleanup_post_type'];
|
32 |
+
if( ! empty( $cleanups ) ){
|
33 |
+
foreach ($cleanups as $cleanuptype ) {
|
34 |
+
$messages[] = wpbulkdelete()->api->run_cleanup( $cleanuptype );
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}else{
|
38 |
+
wp_die( esc_html__( 'Sorry, Your nonce did not verify.', 'wp-bulk-delete' ) );
|
39 |
+
}
|
40 |
+
|
41 |
+
if( !empty( $error ) ){
|
42 |
+
foreach ( $error as $err ) {
|
43 |
+
?>
|
44 |
+
<div class="notice notice-error">
|
45 |
+
<p><strong><?php echo $err; ?></strong></p>
|
46 |
+
</div>
|
47 |
+
<?php
|
48 |
+
}
|
49 |
+
}
|
50 |
+
if( ! empty( $messages ) ){
|
51 |
+
if (strlen(implode($messages)) == 0 ){
|
52 |
+
?>
|
53 |
+
<div class="notice notice-success">
|
54 |
+
<p><strong><?php esc_html_e( 'Nothing to cleanup!!', 'wp-bulk-delete' ); ?></strong></p>
|
55 |
+
</div>
|
56 |
+
<?php
|
57 |
+
}else{
|
58 |
+
foreach ( $messages as $message ) {
|
59 |
+
if( $message != '' ){
|
60 |
+
?>
|
61 |
+
<div class="notice notice-success">
|
62 |
+
<p><strong><?php echo $message; ?></strong></p>
|
63 |
+
</div>
|
64 |
+
<?php
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
}
|
70 |
+
?>
|
71 |
+
<form method="post" id="cleanup">
|
72 |
+
<table class="form-table">
|
73 |
+
<tbody>
|
74 |
+
<?php
|
75 |
+
if( 'general' == $type ) {
|
76 |
+
|
77 |
+
wpbd_render_post_cleanup();
|
78 |
+
wpbd_render_meta_cleanup();
|
79 |
+
|
80 |
+
}elseif( 'post' == $type ) {
|
81 |
+
|
82 |
+
wpbd_render_post_cleanup();
|
83 |
+
|
84 |
+
}elseif( 'meta' == $type ) {
|
85 |
+
|
86 |
+
wpbd_render_meta_cleanup();
|
87 |
+
|
88 |
+
}
|
89 |
+
wp_nonce_field('run_post_cleanup_nonce', '_run_post_cleanup_wpnonce' );
|
90 |
+
|
91 |
+
?>
|
92 |
+
</tbody>
|
93 |
+
</table>
|
94 |
+
<?php
|
95 |
+
submit_button( __('Run Cleanup','wp-bulk-delete'), 'primary','run_post_cleanup');
|
96 |
+
?>
|
97 |
+
</form>
|
98 |
+
<?php
|
99 |
+
}
|
includes/admin/cleanup/cleanup-page.php
CHANGED
@@ -1,50 +1,50 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Cleanup page
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Admin/Pages
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Cleanup Page
|
16 |
-
*
|
17 |
-
* Render the Cleanup page
|
18 |
-
*
|
19 |
-
* @since 1.1.0
|
20 |
-
* @return void
|
21 |
-
*/
|
22 |
-
function wpbd_render_cleanup_page(){
|
23 |
-
?>
|
24 |
-
<div class="wrap">
|
25 |
-
<h2><?php esc_html_e('Cleanup','wp-bulk-delete'); ?></h2>
|
26 |
-
<div id="poststuff">
|
27 |
-
<div id="post-body" class="metabox-holder columns-2">
|
28 |
-
|
29 |
-
<div class="notice notice-warning">
|
30 |
-
<p><strong><?php _e( 'WARNING: Before you Cleanup any data please first take Backup, any delete operation done is irreversible. Please use it with caution!', 'wp-bulk-delete' ); ?></strong></p>
|
31 |
-
</div>
|
32 |
-
|
33 |
-
<div class="delete_notice"></div>
|
34 |
-
|
35 |
-
<div id="postbox-container-1" class="postbox-container">
|
36 |
-
<?php do_action('wpbd_admin_sidebar'); ?>
|
37 |
-
</div>
|
38 |
-
|
39 |
-
<div id="postbox-container-2" class="postbox-container">
|
40 |
-
<?php
|
41 |
-
wpbd_cleanup_form( 'general' );
|
42 |
-
?>
|
43 |
-
</div>
|
44 |
-
</div>
|
45 |
-
<br class="clear">
|
46 |
-
</div>
|
47 |
-
|
48 |
-
</div><!-- /.wrap -->
|
49 |
-
<?php
|
50 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Cleanup page
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Admin/Pages
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Cleanup Page
|
16 |
+
*
|
17 |
+
* Render the Cleanup page
|
18 |
+
*
|
19 |
+
* @since 1.1.0
|
20 |
+
* @return void
|
21 |
+
*/
|
22 |
+
function wpbd_render_cleanup_page(){
|
23 |
+
?>
|
24 |
+
<div class="wrap">
|
25 |
+
<h2><?php esc_html_e('Cleanup','wp-bulk-delete'); ?></h2>
|
26 |
+
<div id="poststuff">
|
27 |
+
<div id="post-body" class="metabox-holder columns-2">
|
28 |
+
|
29 |
+
<div class="notice notice-warning">
|
30 |
+
<p><strong><?php _e( 'WARNING: Before you Cleanup any data please first take Backup, any delete operation done is irreversible. Please use it with caution!', 'wp-bulk-delete' ); ?></strong></p>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
<div class="delete_notice"></div>
|
34 |
+
|
35 |
+
<div id="postbox-container-1" class="postbox-container">
|
36 |
+
<?php do_action('wpbd_admin_sidebar'); ?>
|
37 |
+
</div>
|
38 |
+
|
39 |
+
<div id="postbox-container-2" class="postbox-container">
|
40 |
+
<?php
|
41 |
+
wpbd_cleanup_form( 'general' );
|
42 |
+
?>
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
<br class="clear">
|
46 |
+
</div>
|
47 |
+
|
48 |
+
</div><!-- /.wrap -->
|
49 |
+
<?php
|
50 |
+
}
|
includes/admin/comments/display-delete-comments.php
CHANGED
@@ -1,74 +1,74 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Delete Comments
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Admin/Pages
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Delete Comments Page.
|
17 |
-
*
|
18 |
-
* Render the delete comments page contents.
|
19 |
-
*
|
20 |
-
* @since 1.1.0
|
21 |
-
* @return void
|
22 |
-
*/
|
23 |
-
function wpbd_delete_comments_page(){
|
24 |
-
|
25 |
-
if( ! empty( $_POST ) && isset( $_POST['_delete_comments_wpnonce'] ) ){
|
26 |
-
|
27 |
-
// Get comment_result for delete based on user input.
|
28 |
-
$comment_result = xt_delete_comments_form_process( $_POST );
|
29 |
-
wpbd_display_admin_notice( $comment_result );
|
30 |
-
|
31 |
-
}
|
32 |
-
?>
|
33 |
-
<div class="wrap">
|
34 |
-
<h2><?php esc_html_e('Delete Comments','wp-bulk-delete'); ?></h2>
|
35 |
-
<div id="poststuff">
|
36 |
-
<div id="post-body" class="metabox-holder columns-2">
|
37 |
-
|
38 |
-
<div class="notice notice-warning">
|
39 |
-
<p><strong><?php _e( 'WARNING: Before you delete any comment please first take Backup, any delete operation done is irreversible. Please use it with caution!', 'wp-bulk-delete' ); ?></strong></p>
|
40 |
-
</div>
|
41 |
-
|
42 |
-
<div class="delete_notice"></div>
|
43 |
-
|
44 |
-
<div id="postbox-container-1" class="postbox-container">
|
45 |
-
<?php do_action('wpbd_admin_sidebar'); ?>
|
46 |
-
</div>
|
47 |
-
|
48 |
-
<div id="postbox-container-2" class="postbox-container">
|
49 |
-
|
50 |
-
<form method="post" id="delete_comments_form">
|
51 |
-
<table class="form-table">
|
52 |
-
<?php
|
53 |
-
do_action( 'wpbd_delete_comments_form' );
|
54 |
-
|
55 |
-
wpbd_render_delete_time();
|
56 |
-
?>
|
57 |
-
</table>
|
58 |
-
<?php
|
59 |
-
echo wp_nonce_field('delete_comments_nonce', '_delete_comments_wpnonce' );
|
60 |
-
?>
|
61 |
-
<p class="submit">
|
62 |
-
<input name="delete_comments_submit" id="delete_comments_submit" class="button button-primary" value="<?php esc_html_e('Delete Comments', 'wp-bulk-delete');?>" type="button">
|
63 |
-
<span class="spinner" style="float: none;"></span>
|
64 |
-
</p>
|
65 |
-
</form>
|
66 |
-
|
67 |
-
</div>
|
68 |
-
</div>
|
69 |
-
<br class="clear">
|
70 |
-
</div>
|
71 |
-
|
72 |
-
</div><!-- /.wrap -->
|
73 |
-
<?php
|
74 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Delete Comments
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Admin/Pages
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Delete Comments Page.
|
17 |
+
*
|
18 |
+
* Render the delete comments page contents.
|
19 |
+
*
|
20 |
+
* @since 1.1.0
|
21 |
+
* @return void
|
22 |
+
*/
|
23 |
+
function wpbd_delete_comments_page(){
|
24 |
+
|
25 |
+
if( ! empty( $_POST ) && isset( $_POST['_delete_comments_wpnonce'] ) ){
|
26 |
+
|
27 |
+
// Get comment_result for delete based on user input.
|
28 |
+
$comment_result = xt_delete_comments_form_process( $_POST );
|
29 |
+
wpbd_display_admin_notice( $comment_result );
|
30 |
+
|
31 |
+
}
|
32 |
+
?>
|
33 |
+
<div class="wrap">
|
34 |
+
<h2><?php esc_html_e('Delete Comments','wp-bulk-delete'); ?></h2>
|
35 |
+
<div id="poststuff">
|
36 |
+
<div id="post-body" class="metabox-holder columns-2">
|
37 |
+
|
38 |
+
<div class="notice notice-warning">
|
39 |
+
<p><strong><?php _e( 'WARNING: Before you delete any comment please first take Backup, any delete operation done is irreversible. Please use it with caution!', 'wp-bulk-delete' ); ?></strong></p>
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<div class="delete_notice"></div>
|
43 |
+
|
44 |
+
<div id="postbox-container-1" class="postbox-container">
|
45 |
+
<?php do_action('wpbd_admin_sidebar'); ?>
|
46 |
+
</div>
|
47 |
+
|
48 |
+
<div id="postbox-container-2" class="postbox-container">
|
49 |
+
|
50 |
+
<form method="post" id="delete_comments_form">
|
51 |
+
<table class="form-table">
|
52 |
+
<?php
|
53 |
+
do_action( 'wpbd_delete_comments_form' );
|
54 |
+
|
55 |
+
wpbd_render_delete_time();
|
56 |
+
?>
|
57 |
+
</table>
|
58 |
+
<?php
|
59 |
+
echo wp_nonce_field('delete_comments_nonce', '_delete_comments_wpnonce' );
|
60 |
+
?>
|
61 |
+
<p class="submit">
|
62 |
+
<input name="delete_comments_submit" id="delete_comments_submit" class="button button-primary" value="<?php esc_html_e('Delete Comments', 'wp-bulk-delete');?>" type="button">
|
63 |
+
<span class="spinner" style="float: none;"></span>
|
64 |
+
</p>
|
65 |
+
</form>
|
66 |
+
|
67 |
+
</div>
|
68 |
+
</div>
|
69 |
+
<br class="clear">
|
70 |
+
</div>
|
71 |
+
|
72 |
+
</div><!-- /.wrap -->
|
73 |
+
<?php
|
74 |
}
|
includes/admin/meta/display-delete-meta.php
CHANGED
@@ -1,73 +1,73 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Delete Meta
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Admin/Pages
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Delete Meta Page.
|
17 |
-
*
|
18 |
-
* Render the delete meta page contents.
|
19 |
-
*
|
20 |
-
* @since 1.0
|
21 |
-
* @return void
|
22 |
-
*/
|
23 |
-
function wpbd_delete_meta_page(){
|
24 |
-
?>
|
25 |
-
<div class="wrap">
|
26 |
-
<h2><?php esc_html_e('Delete Meta','wp-bulk-delete'); ?></h2>
|
27 |
-
<?php
|
28 |
-
// Set Default Tab to Cleanup
|
29 |
-
$active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'cleanup';
|
30 |
-
?>
|
31 |
-
<div id="poststuff">
|
32 |
-
<div id="post-body" class="metabox-holder columns-2">
|
33 |
-
|
34 |
-
<div class="notice notice-warning">
|
35 |
-
<p><strong><?php _e( 'WARNING: Before you delete any meta please first take Backup, any delete operation done is irreversible. Please use it with caution!', 'wp-bulk-delete' ); ?></strong></p>
|
36 |
-
</div>
|
37 |
-
|
38 |
-
<div class="delete_notice"></div>
|
39 |
-
|
40 |
-
<div id="postbox-container-1" class="postbox-container">
|
41 |
-
<?php do_action('wpbd_admin_sidebar'); ?>
|
42 |
-
</div>
|
43 |
-
|
44 |
-
<div id="postbox-container-2" class="postbox-container">
|
45 |
-
<h1 class="nav-tab-wrapper" style="padding-bottom: 0px">
|
46 |
-
<a href="?page=delete_all_meta&tab=cleanup" class="nav-tab <?php echo $active_tab == 'cleanup' ? 'nav-tab-active' : ''; ?>">
|
47 |
-
<?php esc_attr_e( 'Cleanup', 'wp-bulk-delete' ); ?>
|
48 |
-
</a>
|
49 |
-
<a href="?page=delete_all_meta&tab=postmeta" class="nav-tab <?php echo $active_tab == 'postmeta' ? 'nav-tab-active' : ''; ?>">
|
50 |
-
<?php esc_attr_e( 'Post Meta', 'wp-bulk-delete' ); ?>
|
51 |
-
</a>
|
52 |
-
<a href="?page=delete_all_meta&tab=usermeta" class="nav-tab <?php echo $active_tab == 'usermeta' ? 'nav-tab-active' : ''; ?>">
|
53 |
-
<?php esc_attr_e( 'User Meta', 'wp-bulk-delete' ); ?>
|
54 |
-
</a>
|
55 |
-
<a href="?page=delete_all_meta&tab=commentmeta" class="nav-tab <?php echo $active_tab == 'commentmeta' ? 'nav-tab-active' : ''; ?>">
|
56 |
-
<?php esc_attr_e( 'Comment Meta', 'wp-bulk-delete' ); ?>
|
57 |
-
</a>
|
58 |
-
</h1>
|
59 |
-
|
60 |
-
<?php
|
61 |
-
if( $active_tab == 'postmeta' || $active_tab == 'usermeta' || $active_tab == 'commentmeta' ) {
|
62 |
-
require_once WPBD_PLUGIN_DIR . 'includes/admin/meta/wp-bulk-delete-meta.php';
|
63 |
-
}elseif( $active_tab == 'cleanup' ){
|
64 |
-
wpbd_cleanup_form( 'meta' );
|
65 |
-
}
|
66 |
-
?>
|
67 |
-
</div>
|
68 |
-
</div>
|
69 |
-
<br class="clear">
|
70 |
-
</div>
|
71 |
-
</div><!-- /.wrap -->
|
72 |
-
<?php
|
73 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Delete Meta
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Admin/Pages
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Delete Meta Page.
|
17 |
+
*
|
18 |
+
* Render the delete meta page contents.
|
19 |
+
*
|
20 |
+
* @since 1.0
|
21 |
+
* @return void
|
22 |
+
*/
|
23 |
+
function wpbd_delete_meta_page(){
|
24 |
+
?>
|
25 |
+
<div class="wrap">
|
26 |
+
<h2><?php esc_html_e('Delete Meta','wp-bulk-delete'); ?></h2>
|
27 |
+
<?php
|
28 |
+
// Set Default Tab to Cleanup
|
29 |
+
$active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'cleanup';
|
30 |
+
?>
|
31 |
+
<div id="poststuff">
|
32 |
+
<div id="post-body" class="metabox-holder columns-2">
|
33 |
+
|
34 |
+
<div class="notice notice-warning">
|
35 |
+
<p><strong><?php _e( 'WARNING: Before you delete any meta please first take Backup, any delete operation done is irreversible. Please use it with caution!', 'wp-bulk-delete' ); ?></strong></p>
|
36 |
+
</div>
|
37 |
+
|
38 |
+
<div class="delete_notice"></div>
|
39 |
+
|
40 |
+
<div id="postbox-container-1" class="postbox-container">
|
41 |
+
<?php do_action('wpbd_admin_sidebar'); ?>
|
42 |
+
</div>
|
43 |
+
|
44 |
+
<div id="postbox-container-2" class="postbox-container">
|
45 |
+
<h1 class="nav-tab-wrapper" style="padding-bottom: 0px">
|
46 |
+
<a href="?page=delete_all_meta&tab=cleanup" class="nav-tab <?php echo $active_tab == 'cleanup' ? 'nav-tab-active' : ''; ?>">
|
47 |
+
<?php esc_attr_e( 'Cleanup', 'wp-bulk-delete' ); ?>
|
48 |
+
</a>
|
49 |
+
<a href="?page=delete_all_meta&tab=postmeta" class="nav-tab <?php echo $active_tab == 'postmeta' ? 'nav-tab-active' : ''; ?>">
|
50 |
+
<?php esc_attr_e( 'Post Meta', 'wp-bulk-delete' ); ?>
|
51 |
+
</a>
|
52 |
+
<a href="?page=delete_all_meta&tab=usermeta" class="nav-tab <?php echo $active_tab == 'usermeta' ? 'nav-tab-active' : ''; ?>">
|
53 |
+
<?php esc_attr_e( 'User Meta', 'wp-bulk-delete' ); ?>
|
54 |
+
</a>
|
55 |
+
<a href="?page=delete_all_meta&tab=commentmeta" class="nav-tab <?php echo $active_tab == 'commentmeta' ? 'nav-tab-active' : ''; ?>">
|
56 |
+
<?php esc_attr_e( 'Comment Meta', 'wp-bulk-delete' ); ?>
|
57 |
+
</a>
|
58 |
+
</h1>
|
59 |
+
|
60 |
+
<?php
|
61 |
+
if( $active_tab == 'postmeta' || $active_tab == 'usermeta' || $active_tab == 'commentmeta' ) {
|
62 |
+
require_once WPBD_PLUGIN_DIR . 'includes/admin/meta/wp-bulk-delete-meta.php';
|
63 |
+
}elseif( $active_tab == 'cleanup' ){
|
64 |
+
wpbd_cleanup_form( 'meta' );
|
65 |
+
}
|
66 |
+
?>
|
67 |
+
</div>
|
68 |
+
</div>
|
69 |
+
<br class="clear">
|
70 |
+
</div>
|
71 |
+
</div><!-- /.wrap -->
|
72 |
+
<?php
|
73 |
}
|
includes/admin/meta/wp-bulk-delete-meta.php
CHANGED
@@ -1,52 +1,52 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Delete Posts General Tab
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Admin/Pages
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
$active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'cleanup';
|
14 |
-
|
15 |
-
if( ! empty( $_POST ) && isset( $_POST['meta_type'] ) ){
|
16 |
-
|
17 |
-
// Get meta_result for delete based on user input.
|
18 |
-
$meta_result = wpbd_delete_meta_form_process( $_POST );
|
19 |
-
wpbd_display_admin_notice( $meta_result );
|
20 |
-
|
21 |
-
}
|
22 |
-
|
23 |
-
?>
|
24 |
-
<form method="post" id="delete_meta_form">
|
25 |
-
<table class="form-table">
|
26 |
-
<tbody>
|
27 |
-
<?php
|
28 |
-
if ( 'postmeta' == $active_tab ){
|
29 |
-
do_action( 'render_postmeta_form' );
|
30 |
-
?><input type="hidden" name="meta_type" value="postmeta" ><?php
|
31 |
-
|
32 |
-
} elseif ( 'usermeta' == $active_tab ){
|
33 |
-
do_action( 'render_usermeta_form' );
|
34 |
-
?><input type="hidden" name="meta_type" value="usermeta" ><?php
|
35 |
-
|
36 |
-
} elseif ( 'commentmeta' == $active_tab ){
|
37 |
-
do_action( 'render_commentmeta_form' );
|
38 |
-
?><input type="hidden" name="meta_type" value="commentmeta" ><?php
|
39 |
-
|
40 |
-
}
|
41 |
-
wpbd_render_delete_time();
|
42 |
-
wp_nonce_field('delete_meta_nonce', '_delete_meta_wpnonce' );
|
43 |
-
?>
|
44 |
-
</tbody>
|
45 |
-
</table>
|
46 |
-
<p class="submit">
|
47 |
-
<input name="delete_meta_submit" id="delete_meta_submit" class="button button-primary" value="Delete Meta" type="button">
|
48 |
-
<span class="spinner" style="float: none;"></span>
|
49 |
-
</p>
|
50 |
-
</form>
|
51 |
-
<?php
|
52 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Delete Posts General Tab
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Admin/Pages
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
$active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'cleanup';
|
14 |
+
|
15 |
+
if( ! empty( $_POST ) && isset( $_POST['meta_type'] ) ){
|
16 |
+
|
17 |
+
// Get meta_result for delete based on user input.
|
18 |
+
$meta_result = wpbd_delete_meta_form_process( $_POST );
|
19 |
+
wpbd_display_admin_notice( $meta_result );
|
20 |
+
|
21 |
+
}
|
22 |
+
|
23 |
+
?>
|
24 |
+
<form method="post" id="delete_meta_form">
|
25 |
+
<table class="form-table">
|
26 |
+
<tbody>
|
27 |
+
<?php
|
28 |
+
if ( 'postmeta' == $active_tab ){
|
29 |
+
do_action( 'render_postmeta_form' );
|
30 |
+
?><input type="hidden" name="meta_type" value="postmeta" ><?php
|
31 |
+
|
32 |
+
} elseif ( 'usermeta' == $active_tab ){
|
33 |
+
do_action( 'render_usermeta_form' );
|
34 |
+
?><input type="hidden" name="meta_type" value="usermeta" ><?php
|
35 |
+
|
36 |
+
} elseif ( 'commentmeta' == $active_tab ){
|
37 |
+
do_action( 'render_commentmeta_form' );
|
38 |
+
?><input type="hidden" name="meta_type" value="commentmeta" ><?php
|
39 |
+
|
40 |
+
}
|
41 |
+
wpbd_render_delete_time();
|
42 |
+
wp_nonce_field('delete_meta_nonce', '_delete_meta_wpnonce' );
|
43 |
+
?>
|
44 |
+
</tbody>
|
45 |
+
</table>
|
46 |
+
<p class="submit">
|
47 |
+
<input name="delete_meta_submit" id="delete_meta_submit" class="button button-primary" value="Delete Meta" type="button">
|
48 |
+
<span class="spinner" style="float: none;"></span>
|
49 |
+
</p>
|
50 |
+
</form>
|
51 |
+
<?php
|
52 |
+
|
includes/admin/posts/display-delete-posts.php
CHANGED
@@ -1,86 +1,86 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Delete Posts
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Admin/Pages
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Delete Posts Page.
|
17 |
-
*
|
18 |
-
* Render the delete posts page contents.
|
19 |
-
*
|
20 |
-
* @since 1.0
|
21 |
-
* @return void
|
22 |
-
*/
|
23 |
-
function wpbd_delete_posts_page(){
|
24 |
-
?>
|
25 |
-
<div class="wrap">
|
26 |
-
<h2><?php esc_html_e('Delete Posts','wp-bulk-delete'); ?></h2>
|
27 |
-
<?php
|
28 |
-
// Set Default Tab to Cleanup
|
29 |
-
$active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'cleanup';
|
30 |
-
?>
|
31 |
-
<div id="poststuff">
|
32 |
-
<div id="post-body" class="metabox-holder columns-2">
|
33 |
-
|
34 |
-
<div class="notice notice-warning">
|
35 |
-
<p><strong><?php _e( 'WARNING: Before you delete any post please first take Backup, any delete operation done is irreversible. Please use it with caution!', 'wp-bulk-delete' ); ?></strong></p>
|
36 |
-
</div>
|
37 |
-
|
38 |
-
<div class="delete_notice"></div>
|
39 |
-
|
40 |
-
<div id="postbox-container-1" class="postbox-container">
|
41 |
-
<?php do_action('wpbd_admin_sidebar'); ?>
|
42 |
-
</div>
|
43 |
-
|
44 |
-
<div id="postbox-container-2" class="postbox-container">
|
45 |
-
|
46 |
-
<h1 class="nav-tab-wrapper" style="padding-bottom: 0px">
|
47 |
-
<a href="?page=delete_all_posts&tab=cleanup" class="nav-tab <?php echo $active_tab == 'cleanup' ? 'nav-tab-active' : ''; ?>">
|
48 |
-
<?php esc_attr_e( 'Cleanup', 'wp-bulk-delete' ); ?>
|
49 |
-
</a>
|
50 |
-
<a href="?page=delete_all_posts&tab=by_posttype" class="nav-tab <?php echo $active_tab == 'by_posttype' ? 'nav-tab-active' : ''; ?>">
|
51 |
-
<?php esc_attr_e( 'By Posttype', 'wp-bulk-delete' ); ?>
|
52 |
-
</a>
|
53 |
-
<a href="?page=delete_all_posts&tab=by_taxonomy" class="nav-tab <?php echo $active_tab == 'by_taxonomy' ? 'nav-tab-active' : ''; ?>">
|
54 |
-
<?php esc_attr_e( 'By Taxonomy', 'wp-bulk-delete' ); ?>
|
55 |
-
</a>
|
56 |
-
<a href="?page=delete_all_posts&tab=by_author" class="nav-tab <?php echo $active_tab == 'by_author' ? 'nav-tab-active' : ''; ?>">
|
57 |
-
<?php esc_attr_e( 'By Author', 'wp-bulk-delete' ); ?>
|
58 |
-
</a>
|
59 |
-
<a href="?page=delete_all_posts&tab=by_title" class="nav-tab <?php echo $active_tab == 'by_title' ? 'nav-tab-active' : ''; ?>">
|
60 |
-
<?php esc_attr_e( 'By Title or Content', 'wp-bulk-delete' ); ?>
|
61 |
-
</a>
|
62 |
-
<a href="?page=delete_all_posts&tab=by_customfield" class="nav-tab <?php echo $active_tab == 'by_customfield' ? 'nav-tab-active' : ''; ?>">
|
63 |
-
<?php esc_attr_e( 'By Custom fields', 'wp-bulk-delete' ); ?>
|
64 |
-
</a>
|
65 |
-
<a href="?page=delete_all_posts&tab=general" class="nav-tab <?php echo $active_tab == 'general' ? 'nav-tab-active' : ''; ?>">
|
66 |
-
<?php esc_attr_e( 'General (By All)', 'wp-bulk-delete' ); ?>
|
67 |
-
</a>
|
68 |
-
</h1>
|
69 |
-
|
70 |
-
<?php
|
71 |
-
if( $active_tab == 'general' || $active_tab == 'by_taxonomy' || $active_tab == 'by_author' || $active_tab == 'by_title' || $active_tab == 'by_posttype' || $active_tab == 'by_customfield' ) {
|
72 |
-
// load General Post Delete Form
|
73 |
-
require_once WPBD_PLUGIN_DIR . 'includes/admin/posts/wp-bulk-delete-posts.php';
|
74 |
-
}
|
75 |
-
if( $active_tab == 'cleanup' ){
|
76 |
-
wpbd_cleanup_form( 'post' );
|
77 |
-
}
|
78 |
-
?>
|
79 |
-
</div>
|
80 |
-
</div>
|
81 |
-
<br class="clear">
|
82 |
-
</div>
|
83 |
-
|
84 |
-
</div><!-- /.wrap -->
|
85 |
-
<?php
|
86 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Delete Posts
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Admin/Pages
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Delete Posts Page.
|
17 |
+
*
|
18 |
+
* Render the delete posts page contents.
|
19 |
+
*
|
20 |
+
* @since 1.0
|
21 |
+
* @return void
|
22 |
+
*/
|
23 |
+
function wpbd_delete_posts_page(){
|
24 |
+
?>
|
25 |
+
<div class="wrap">
|
26 |
+
<h2><?php esc_html_e('Delete Posts','wp-bulk-delete'); ?></h2>
|
27 |
+
<?php
|
28 |
+
// Set Default Tab to Cleanup
|
29 |
+
$active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'cleanup';
|
30 |
+
?>
|
31 |
+
<div id="poststuff">
|
32 |
+
<div id="post-body" class="metabox-holder columns-2">
|
33 |
+
|
34 |
+
<div class="notice notice-warning">
|
35 |
+
<p><strong><?php _e( 'WARNING: Before you delete any post please first take Backup, any delete operation done is irreversible. Please use it with caution!', 'wp-bulk-delete' ); ?></strong></p>
|
36 |
+
</div>
|
37 |
+
|
38 |
+
<div class="delete_notice"></div>
|
39 |
+
|
40 |
+
<div id="postbox-container-1" class="postbox-container">
|
41 |
+
<?php do_action('wpbd_admin_sidebar'); ?>
|
42 |
+
</div>
|
43 |
+
|
44 |
+
<div id="postbox-container-2" class="postbox-container">
|
45 |
+
|
46 |
+
<h1 class="nav-tab-wrapper" style="padding-bottom: 0px">
|
47 |
+
<a href="?page=delete_all_posts&tab=cleanup" class="nav-tab <?php echo $active_tab == 'cleanup' ? 'nav-tab-active' : ''; ?>">
|
48 |
+
<?php esc_attr_e( 'Cleanup', 'wp-bulk-delete' ); ?>
|
49 |
+
</a>
|
50 |
+
<a href="?page=delete_all_posts&tab=by_posttype" class="nav-tab <?php echo $active_tab == 'by_posttype' ? 'nav-tab-active' : ''; ?>">
|
51 |
+
<?php esc_attr_e( 'By Posttype', 'wp-bulk-delete' ); ?>
|
52 |
+
</a>
|
53 |
+
<a href="?page=delete_all_posts&tab=by_taxonomy" class="nav-tab <?php echo $active_tab == 'by_taxonomy' ? 'nav-tab-active' : ''; ?>">
|
54 |
+
<?php esc_attr_e( 'By Taxonomy', 'wp-bulk-delete' ); ?>
|
55 |
+
</a>
|
56 |
+
<a href="?page=delete_all_posts&tab=by_author" class="nav-tab <?php echo $active_tab == 'by_author' ? 'nav-tab-active' : ''; ?>">
|
57 |
+
<?php esc_attr_e( 'By Author', 'wp-bulk-delete' ); ?>
|
58 |
+
</a>
|
59 |
+
<a href="?page=delete_all_posts&tab=by_title" class="nav-tab <?php echo $active_tab == 'by_title' ? 'nav-tab-active' : ''; ?>">
|
60 |
+
<?php esc_attr_e( 'By Title or Content', 'wp-bulk-delete' ); ?>
|
61 |
+
</a>
|
62 |
+
<a href="?page=delete_all_posts&tab=by_customfield" class="nav-tab <?php echo $active_tab == 'by_customfield' ? 'nav-tab-active' : ''; ?>">
|
63 |
+
<?php esc_attr_e( 'By Custom fields', 'wp-bulk-delete' ); ?>
|
64 |
+
</a>
|
65 |
+
<a href="?page=delete_all_posts&tab=general" class="nav-tab <?php echo $active_tab == 'general' ? 'nav-tab-active' : ''; ?>">
|
66 |
+
<?php esc_attr_e( 'General (By All)', 'wp-bulk-delete' ); ?>
|
67 |
+
</a>
|
68 |
+
</h1>
|
69 |
+
|
70 |
+
<?php
|
71 |
+
if( $active_tab == 'general' || $active_tab == 'by_taxonomy' || $active_tab == 'by_author' || $active_tab == 'by_title' || $active_tab == 'by_posttype' || $active_tab == 'by_customfield' ) {
|
72 |
+
// load General Post Delete Form
|
73 |
+
require_once WPBD_PLUGIN_DIR . 'includes/admin/posts/wp-bulk-delete-posts.php';
|
74 |
+
}
|
75 |
+
if( $active_tab == 'cleanup' ){
|
76 |
+
wpbd_cleanup_form( 'post' );
|
77 |
+
}
|
78 |
+
?>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
<br class="clear">
|
82 |
+
</div>
|
83 |
+
|
84 |
+
</div><!-- /.wrap -->
|
85 |
+
<?php
|
86 |
}
|
includes/admin/posts/wp-bulk-delete-posts.php
CHANGED
@@ -1,62 +1,62 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Delete Posts General Tab
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Admin/Pages
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
$post_by_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'general';
|
15 |
-
|
16 |
-
if( ! empty( $_POST ) && isset( $_POST['delete_post_type'] ) ){
|
17 |
-
|
18 |
-
// Get post_result for delete based on user input.
|
19 |
-
$post_result = xt_delete_posts_form_process( $_POST );
|
20 |
-
wpbd_display_admin_notice( $post_result );
|
21 |
-
|
22 |
-
}
|
23 |
-
?>
|
24 |
-
<form method="post" id="delete_posts_form">
|
25 |
-
<table class="form-table">
|
26 |
-
<tbody>
|
27 |
-
<?php
|
28 |
-
if ( 'by_posttype' == $post_by_tab ){
|
29 |
-
|
30 |
-
do_action( 'render_form_by_posttype' );
|
31 |
-
|
32 |
-
} elseif ( 'by_author' == $post_by_tab ){
|
33 |
-
|
34 |
-
do_action( 'render_form_by_author' );
|
35 |
-
|
36 |
-
} elseif ( 'by_title' == $post_by_tab ){
|
37 |
-
|
38 |
-
do_action( 'render_form_by_title' );
|
39 |
-
|
40 |
-
} elseif( 'by_taxonomy' == $post_by_tab ){
|
41 |
-
|
42 |
-
do_action( 'render_form_by_taxonomy' );
|
43 |
-
|
44 |
-
} elseif( 'general' == $post_by_tab ){
|
45 |
-
|
46 |
-
do_action( 'render_form_general' );
|
47 |
-
|
48 |
-
} elseif( 'by_customfield' == $post_by_tab ){
|
49 |
-
|
50 |
-
do_action( 'render_form_by_custom_fields' );
|
51 |
-
|
52 |
-
}
|
53 |
-
wp_nonce_field('delete_posts_nonce', '_delete_all_posts_wpnonce' );
|
54 |
-
|
55 |
-
?>
|
56 |
-
</tbody>
|
57 |
-
</table>
|
58 |
-
<p class="submit">
|
59 |
-
<input name="delete_posts_submit" id="delete_posts_submit" class="button button-primary" value="Delete Posts" type="button">
|
60 |
-
<span class="spinner" style="float: none;"></span>
|
61 |
-
</p>
|
62 |
-
</form>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Delete Posts General Tab
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Admin/Pages
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
$post_by_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'general';
|
15 |
+
|
16 |
+
if( ! empty( $_POST ) && isset( $_POST['delete_post_type'] ) ){
|
17 |
+
|
18 |
+
// Get post_result for delete based on user input.
|
19 |
+
$post_result = xt_delete_posts_form_process( $_POST );
|
20 |
+
wpbd_display_admin_notice( $post_result );
|
21 |
+
|
22 |
+
}
|
23 |
+
?>
|
24 |
+
<form method="post" id="delete_posts_form">
|
25 |
+
<table class="form-table">
|
26 |
+
<tbody>
|
27 |
+
<?php
|
28 |
+
if ( 'by_posttype' == $post_by_tab ){
|
29 |
+
|
30 |
+
do_action( 'render_form_by_posttype' );
|
31 |
+
|
32 |
+
} elseif ( 'by_author' == $post_by_tab ){
|
33 |
+
|
34 |
+
do_action( 'render_form_by_author' );
|
35 |
+
|
36 |
+
} elseif ( 'by_title' == $post_by_tab ){
|
37 |
+
|
38 |
+
do_action( 'render_form_by_title' );
|
39 |
+
|
40 |
+
} elseif( 'by_taxonomy' == $post_by_tab ){
|
41 |
+
|
42 |
+
do_action( 'render_form_by_taxonomy' );
|
43 |
+
|
44 |
+
} elseif( 'general' == $post_by_tab ){
|
45 |
+
|
46 |
+
do_action( 'render_form_general' );
|
47 |
+
|
48 |
+
} elseif( 'by_customfield' == $post_by_tab ){
|
49 |
+
|
50 |
+
do_action( 'render_form_by_custom_fields' );
|
51 |
+
|
52 |
+
}
|
53 |
+
wp_nonce_field('delete_posts_nonce', '_delete_all_posts_wpnonce' );
|
54 |
+
|
55 |
+
?>
|
56 |
+
</tbody>
|
57 |
+
</table>
|
58 |
+
<p class="submit">
|
59 |
+
<input name="delete_posts_submit" id="delete_posts_submit" class="button button-primary" value="Delete Posts" type="button">
|
60 |
+
<span class="spinner" style="float: none;"></span>
|
61 |
+
</p>
|
62 |
+
</form>
|
includes/admin/support-page.php
CHANGED
@@ -1,127 +1,127 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Support & help page
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Admin/Pages
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.1.1
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Support & help Page
|
16 |
-
*
|
17 |
-
* Render the Support & help page
|
18 |
-
*
|
19 |
-
* @since 1.1.1
|
20 |
-
* @return void
|
21 |
-
*/
|
22 |
-
function wpbd_render_support_page(){
|
23 |
-
$open_source_support_url = 'https://wordpress.org/support/plugin/wp-bulk-delete/';
|
24 |
-
$support_url = 'https://xylusthemes.com/support/?utm_source=insideplugin&utm_medium=web&utm_content=sidebar&utm_campaign=freeplugin';
|
25 |
-
|
26 |
-
$review_url = 'https://wordpress.org/support/plugin/wp-bulk-delete/reviews/?rate=5#new-post';
|
27 |
-
$facebook_url = 'https://www.facebook.com/xylusinfo/';
|
28 |
-
$twitter_url = 'https://twitter.com/XylusThemes/';
|
29 |
-
?>
|
30 |
-
<div class="wrap">
|
31 |
-
<h2><?php esc_html_e('Support & Help','wp-bulk-delete'); ?></h2>
|
32 |
-
<div id="poststuff">
|
33 |
-
<div id="post-body" class="metabox-holder columns-2">
|
34 |
-
|
35 |
-
<div id="postbox-container-1" class="postbox-container">
|
36 |
-
<?php do_action('wpbd_admin_sidebar'); ?>
|
37 |
-
</div>
|
38 |
-
|
39 |
-
<div id="postbox-container-2" class="postbox-container">
|
40 |
-
|
41 |
-
<div class="wpbd_well">
|
42 |
-
<h3><?php esc_attr_e( 'Getting Support', 'wp-bulk-delete' ); ?></h3>
|
43 |
-
<p><?php _e( 'Thanks you for using Import Facebook Events, We are sincerely appreciate your support and we’re excited to see you using our plugins.','wp-bulk-delete' ); ?> </p>
|
44 |
-
<p><?php _e( 'Our support team is always around to help you.','wp-bulk-delete' ); ?></p>
|
45 |
-
|
46 |
-
<p><strong><?php _e( 'Looking for free support?','wp-bulk-delete' ); ?></strong></p>
|
47 |
-
<a class="button button-secondary" href="<?php echo $open_source_support_url; ?>" target="_blank" >
|
48 |
-
<?php _e( 'Open-source forum on WordPress.org','wp-bulk-delete' ); ?>
|
49 |
-
</a>
|
50 |
-
|
51 |
-
<p><strong><?php _e( 'Looking for more immediate support?','wp-bulk-delete' ); ?></strong></p>
|
52 |
-
<p><?php _e( 'We offer premium support on our website with the purchase of our premium plugins.','wp-bulk-delete' ); ?>
|
53 |
-
</p>
|
54 |
-
|
55 |
-
<a class="button button-primary" href="<?php echo $support_url; ?>" target="_blank" >
|
56 |
-
<?php _e( 'Contact us directly (Premium Support)','wp-bulk-delete' ); ?>
|
57 |
-
</a>
|
58 |
-
|
59 |
-
<p><strong><?php _e( 'Enjoying Import Facebook Events or have feedback?','wp-bulk-delete' ); ?></strong></p>
|
60 |
-
<a class="button button-secondary" href="<?php echo $review_url; ?>" target="_blank"
|
61 |
-
<a class="button button-secondary" href="<?php echo $twitter_url; ?>" target="_blank"
|
62 |
-
<a class="button button-secondary" href="<?php echo $facebook_url; ?>" target="_blank"
|
63 |
-
</div>
|
64 |
-
|
65 |
-
<?php
|
66 |
-
$plugins = array();
|
67 |
-
$plugin_list = wpbulkdelete()->api->get_xyuls_themes_plugins();
|
68 |
-
if( !empty( $plugin_list ) ){
|
69 |
-
foreach ($plugin_list as $key => $value) {
|
70 |
-
$plugins[] = wpbulkdelete()->api->get_wporg_plugin( $key );
|
71 |
-
}
|
72 |
-
}
|
73 |
-
?>
|
74 |
-
<div class="" style="margin-top: 20px;">
|
75 |
-
<h3 class="setting_bar"><?php _e( 'Plugins you should try','
|
76 |
-
<?php
|
77 |
-
if( !empty( $plugins ) ){
|
78 |
-
foreach ($plugins as $plugin ) {
|
79 |
-
?>
|
80 |
-
<div class="plugin_box">
|
81 |
-
<?php if( $plugin->banners['low'] != '' ){ ?>
|
82 |
-
<img src="<?php echo $plugin->banners['low']; ?>" class="plugin_img" title="<?php echo $plugin->name; ?>">
|
83 |
-
<?php } ?>
|
84 |
-
<div class="plugin_content">
|
85 |
-
<h3><?php echo $plugin->name; ?></h3>
|
86 |
-
|
87 |
-
<?php wp_star_rating( array(
|
88 |
-
'rating' => $plugin->rating,
|
89 |
-
'type' => 'percent',
|
90 |
-
'number' => $plugin->num_ratings,
|
91 |
-
) );?>
|
92 |
-
|
93 |
-
<?php if( $plugin->version != '' ){ ?>
|
94 |
-
<p><strong><?php _e( 'Version:','
|
95 |
-
<?php } ?>
|
96 |
-
|
97 |
-
<?php if( $plugin->requires != '' ){ ?>
|
98 |
-
<p><strong><?php _e( 'Requires:','
|
99 |
-
<?php } ?>
|
100 |
-
|
101 |
-
<?php if( $plugin->active_installs != '' ){ ?>
|
102 |
-
<p><strong><?php _e( 'Active Installs:','
|
103 |
-
<?php } ?>
|
104 |
-
|
105 |
-
<a class="button button-secondary" href="<?php echo admin_url( 'plugin-install.php?tab=plugin-information&plugin='. $plugin->slug.'&TB_iframe=1&width=772&height=600'); ?>" target="_blank">
|
106 |
-
<?php _e( 'Install Now','
|
107 |
-
</a>
|
108 |
-
<a class="button button-primary" href="<?php echo $plugin->homepage . '?utm_source=crosssell&utm_medium=web&utm_content=supportpage&utm_campaign=freeplugin'; ?>" target="_blank">
|
109 |
-
<?php _e( 'Buy Now','
|
110 |
-
</a>
|
111 |
-
</div>
|
112 |
-
</div>
|
113 |
-
<?php
|
114 |
-
}
|
115 |
-
}
|
116 |
-
?>
|
117 |
-
<div style="clear: both;">
|
118 |
-
</div>
|
119 |
-
|
120 |
-
</div>
|
121 |
-
</div>
|
122 |
-
<br class="clear">
|
123 |
-
</div>
|
124 |
-
|
125 |
-
</div><!-- /.wrap -->
|
126 |
-
<?php
|
127 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Support & help page
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Admin/Pages
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.1.1
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Support & help Page
|
16 |
+
*
|
17 |
+
* Render the Support & help page
|
18 |
+
*
|
19 |
+
* @since 1.1.1
|
20 |
+
* @return void
|
21 |
+
*/
|
22 |
+
function wpbd_render_support_page(){
|
23 |
+
$open_source_support_url = 'https://wordpress.org/support/plugin/wp-bulk-delete/';
|
24 |
+
$support_url = 'https://xylusthemes.com/support/?utm_source=insideplugin&utm_medium=web&utm_content=sidebar&utm_campaign=freeplugin';
|
25 |
+
|
26 |
+
$review_url = 'https://wordpress.org/support/plugin/wp-bulk-delete/reviews/?rate=5#new-post';
|
27 |
+
$facebook_url = 'https://www.facebook.com/xylusinfo/';
|
28 |
+
$twitter_url = 'https://twitter.com/XylusThemes/';
|
29 |
+
?>
|
30 |
+
<div class="wrap">
|
31 |
+
<h2><?php esc_html_e('Support & Help','wp-bulk-delete'); ?></h2>
|
32 |
+
<div id="poststuff">
|
33 |
+
<div id="post-body" class="metabox-holder columns-2">
|
34 |
+
|
35 |
+
<div id="postbox-container-1" class="postbox-container">
|
36 |
+
<?php do_action('wpbd_admin_sidebar'); ?>
|
37 |
+
</div>
|
38 |
+
|
39 |
+
<div id="postbox-container-2" class="postbox-container">
|
40 |
+
|
41 |
+
<div class="wpbd_well">
|
42 |
+
<h3><?php esc_attr_e( 'Getting Support', 'wp-bulk-delete' ); ?></h3>
|
43 |
+
<p><?php _e( 'Thanks you for using Import Facebook Events, We are sincerely appreciate your support and we’re excited to see you using our plugins.','wp-bulk-delete' ); ?> </p>
|
44 |
+
<p><?php _e( 'Our support team is always around to help you.','wp-bulk-delete' ); ?></p>
|
45 |
+
|
46 |
+
<p><strong><?php _e( 'Looking for free support?','wp-bulk-delete' ); ?></strong></p>
|
47 |
+
<a class="button button-secondary" href="<?php echo $open_source_support_url; ?>" target="_blank" >
|
48 |
+
<?php _e( 'Open-source forum on WordPress.org','wp-bulk-delete' ); ?>
|
49 |
+
</a>
|
50 |
+
|
51 |
+
<p><strong><?php _e( 'Looking for more immediate support?','wp-bulk-delete' ); ?></strong></p>
|
52 |
+
<p><?php _e( 'We offer premium support on our website with the purchase of our premium plugins.','wp-bulk-delete' ); ?>
|
53 |
+
</p>
|
54 |
+
|
55 |
+
<a class="button button-primary" href="<?php echo $support_url; ?>" target="_blank" >
|
56 |
+
<?php _e( 'Contact us directly (Premium Support)','wp-bulk-delete' ); ?>
|
57 |
+
</a>
|
58 |
+
|
59 |
+
<p><strong><?php _e( 'Enjoying Import Facebook Events or have feedback?','wp-bulk-delete' ); ?></strong></p>
|
60 |
+
<a class="button button-secondary" href="<?php echo $review_url; ?>" target="_blank" ><?php _e( 'Leave us a review','wp-bulk-delete' ); ?></a>
|
61 |
+
<a class="button button-secondary" href="<?php echo $twitter_url; ?>" target="_blank" ><?php _e( 'Follow us on Twitter','wp-bulk-delete' ); ?></a>
|
62 |
+
<a class="button button-secondary" href="<?php echo $facebook_url; ?>" target="_blank" ><?php _e( 'Like us on Facebook','wp-bulk-delete' ); ?></a>
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<?php
|
66 |
+
$plugins = array();
|
67 |
+
$plugin_list = wpbulkdelete()->api->get_xyuls_themes_plugins();
|
68 |
+
if( !empty( $plugin_list ) ){
|
69 |
+
foreach ($plugin_list as $key => $value) {
|
70 |
+
$plugins[] = wpbulkdelete()->api->get_wporg_plugin( $key );
|
71 |
+
}
|
72 |
+
}
|
73 |
+
?>
|
74 |
+
<div class="" style="margin-top: 20px;">
|
75 |
+
<h3 class="setting_bar"><?php _e( 'Plugins you should try','wp-bulk-delete' ); ?></h3>
|
76 |
+
<?php
|
77 |
+
if( !empty( $plugins ) ){
|
78 |
+
foreach ($plugins as $plugin ) {
|
79 |
+
?>
|
80 |
+
<div class="plugin_box">
|
81 |
+
<?php if( $plugin->banners['low'] != '' ){ ?>
|
82 |
+
<img src="<?php echo $plugin->banners['low']; ?>" class="plugin_img" title="<?php echo $plugin->name; ?>">
|
83 |
+
<?php } ?>
|
84 |
+
<div class="plugin_content">
|
85 |
+
<h3><?php echo $plugin->name; ?></h3>
|
86 |
+
|
87 |
+
<?php wp_star_rating( array(
|
88 |
+
'rating' => $plugin->rating,
|
89 |
+
'type' => 'percent',
|
90 |
+
'number' => $plugin->num_ratings,
|
91 |
+
) );?>
|
92 |
+
|
93 |
+
<?php if( $plugin->version != '' ){ ?>
|
94 |
+
<p><strong><?php _e( 'Version:','wp-bulk-delete' ); ?> </strong><?php echo $plugin->version; ?></p>
|
95 |
+
<?php } ?>
|
96 |
+
|
97 |
+
<?php if( $plugin->requires != '' ){ ?>
|
98 |
+
<p><strong><?php _e( 'Requires:','wp-bulk-delete' ); ?> </strong> <?php _e( 'WordPress ','wp-bulk-delete' ); echo $plugin->requires; ?>+</p>
|
99 |
+
<?php } ?>
|
100 |
+
|
101 |
+
<?php if( $plugin->active_installs != '' ){ ?>
|
102 |
+
<p><strong><?php _e( 'Active Installs:','wp-bulk-delete' ); ?> </strong><?php echo $plugin->active_installs; ?>+</p>
|
103 |
+
<?php } ?>
|
104 |
+
|
105 |
+
<a class="button button-secondary" href="<?php echo admin_url( 'plugin-install.php?tab=plugin-information&plugin='. $plugin->slug.'&TB_iframe=1&width=772&height=600'); ?>" target="_blank">
|
106 |
+
<?php _e( 'Install Now','wp-bulk-delete' ); ?>
|
107 |
+
</a>
|
108 |
+
<a class="button button-primary" href="<?php echo $plugin->homepage . '?utm_source=crosssell&utm_medium=web&utm_content=supportpage&utm_campaign=freeplugin'; ?>" target="_blank">
|
109 |
+
<?php _e( 'Buy Now','wp-bulk-delete' ); ?>
|
110 |
+
</a>
|
111 |
+
</div>
|
112 |
+
</div>
|
113 |
+
<?php
|
114 |
+
}
|
115 |
+
}
|
116 |
+
?>
|
117 |
+
<div style="clear: both;">
|
118 |
+
</div>
|
119 |
+
|
120 |
+
</div>
|
121 |
+
</div>
|
122 |
+
<br class="clear">
|
123 |
+
</div>
|
124 |
+
|
125 |
+
</div><!-- /.wrap -->
|
126 |
+
<?php
|
127 |
+
}
|
includes/admin/terms/display-delete-terms.php
CHANGED
@@ -1,69 +1,69 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Delete Taxonomy Terms
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Admin/Pages
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Delete Taxonomy Page.
|
17 |
-
*
|
18 |
-
* Render the delete taxonomy page contents.
|
19 |
-
*
|
20 |
-
* @since 1.0
|
21 |
-
* @return void
|
22 |
-
*/
|
23 |
-
function wpbd_delete_terms_page(){
|
24 |
-
|
25 |
-
if( ! empty( $_POST ) && isset( $_POST['_delete_terms_wpnonce'] ) ){
|
26 |
-
|
27 |
-
// Get terms_result for delete based on user input.
|
28 |
-
$terms_result = xt_delete_terms_form_process( $_POST );
|
29 |
-
wpbd_display_admin_notice( $terms_result );
|
30 |
-
}
|
31 |
-
?>
|
32 |
-
<div class="wrap">
|
33 |
-
<h2><?php esc_html_e('Delete Taxonomy Terms','wp-bulk-delete'); ?></h2>
|
34 |
-
<div id="poststuff">
|
35 |
-
<div id="post-body" class="metabox-holder columns-2">
|
36 |
-
|
37 |
-
<div class="notice notice-warning">
|
38 |
-
<p><strong><?php _e( 'WARNING: Before you delete any terms please first take Backup, any delete operation done is irreversible. Please use it with caution!', 'wp-bulk-delete' ); ?></strong></p>
|
39 |
-
</div>
|
40 |
-
|
41 |
-
<div class="delete_notice"></div>
|
42 |
-
|
43 |
-
<div id="postbox-container-1" class="postbox-container">
|
44 |
-
<?php do_action('wpbd_admin_sidebar'); ?>
|
45 |
-
</div>
|
46 |
-
|
47 |
-
<div id="postbox-container-2" class="postbox-container">
|
48 |
-
|
49 |
-
<form method="post" id="delete_terms_form">
|
50 |
-
<table class="form-table">
|
51 |
-
<?php do_action( 'wpbd_delete_terms_form' ); ?>
|
52 |
-
</table>
|
53 |
-
<?php
|
54 |
-
echo wp_nonce_field('delete_terms_nonce', '_delete_terms_wpnonce' );
|
55 |
-
?>
|
56 |
-
<p class="submit">
|
57 |
-
<input name="delete_terms_submit" id="delete_terms_submit" class="button button-primary" value="<?php esc_html_e('Delete Terms', 'wp-bulk-delete');?>" type="button">
|
58 |
-
<span class="spinner" style="float: none;"></span>
|
59 |
-
</p>
|
60 |
-
</form>
|
61 |
-
|
62 |
-
</div>
|
63 |
-
</div>
|
64 |
-
<br class="clear">
|
65 |
-
</div>
|
66 |
-
|
67 |
-
</div><!-- /.wrap -->
|
68 |
-
<?php
|
69 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Delete Taxonomy Terms
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Admin/Pages
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Delete Taxonomy Page.
|
17 |
+
*
|
18 |
+
* Render the delete taxonomy page contents.
|
19 |
+
*
|
20 |
+
* @since 1.0
|
21 |
+
* @return void
|
22 |
+
*/
|
23 |
+
function wpbd_delete_terms_page(){
|
24 |
+
|
25 |
+
if( ! empty( $_POST ) && isset( $_POST['_delete_terms_wpnonce'] ) ){
|
26 |
+
|
27 |
+
// Get terms_result for delete based on user input.
|
28 |
+
$terms_result = xt_delete_terms_form_process( $_POST );
|
29 |
+
wpbd_display_admin_notice( $terms_result );
|
30 |
+
}
|
31 |
+
?>
|
32 |
+
<div class="wrap">
|
33 |
+
<h2><?php esc_html_e('Delete Taxonomy Terms','wp-bulk-delete'); ?></h2>
|
34 |
+
<div id="poststuff">
|
35 |
+
<div id="post-body" class="metabox-holder columns-2">
|
36 |
+
|
37 |
+
<div class="notice notice-warning">
|
38 |
+
<p><strong><?php _e( 'WARNING: Before you delete any terms please first take Backup, any delete operation done is irreversible. Please use it with caution!', 'wp-bulk-delete' ); ?></strong></p>
|
39 |
+
</div>
|
40 |
+
|
41 |
+
<div class="delete_notice"></div>
|
42 |
+
|
43 |
+
<div id="postbox-container-1" class="postbox-container">
|
44 |
+
<?php do_action('wpbd_admin_sidebar'); ?>
|
45 |
+
</div>
|
46 |
+
|
47 |
+
<div id="postbox-container-2" class="postbox-container">
|
48 |
+
|
49 |
+
<form method="post" id="delete_terms_form">
|
50 |
+
<table class="form-table">
|
51 |
+
<?php do_action( 'wpbd_delete_terms_form' ); ?>
|
52 |
+
</table>
|
53 |
+
<?php
|
54 |
+
echo wp_nonce_field('delete_terms_nonce', '_delete_terms_wpnonce' );
|
55 |
+
?>
|
56 |
+
<p class="submit">
|
57 |
+
<input name="delete_terms_submit" id="delete_terms_submit" class="button button-primary" value="<?php esc_html_e('Delete Terms', 'wp-bulk-delete');?>" type="button">
|
58 |
+
<span class="spinner" style="float: none;"></span>
|
59 |
+
</p>
|
60 |
+
</form>
|
61 |
+
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
<br class="clear">
|
65 |
+
</div>
|
66 |
+
|
67 |
+
</div><!-- /.wrap -->
|
68 |
+
<?php
|
69 |
}
|
includes/admin/users/display-delete-users.php
CHANGED
@@ -1,69 +1,69 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Delete Users
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Admin/Pages
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Delete Users Page.
|
17 |
-
*
|
18 |
-
* Render the delete users page contents.
|
19 |
-
*
|
20 |
-
* @since 1.0
|
21 |
-
* @return void
|
22 |
-
*/
|
23 |
-
function wpbd_delete_users_page(){
|
24 |
-
|
25 |
-
if( ! empty( $_POST ) && isset( $_POST['_delete_users_wpnonce'] ) ){
|
26 |
-
// Get user_result for delete based on user input.
|
27 |
-
$user_result = xt_delete_users_form_process( $_POST );
|
28 |
-
wpbd_display_admin_notice( $user_result );
|
29 |
-
}
|
30 |
-
?>
|
31 |
-
<div class="wrap">
|
32 |
-
<h2><?php esc_html_e('Delete Users','wp-bulk-delete'); ?></h2>
|
33 |
-
<div id="poststuff">
|
34 |
-
<div id="post-body" class="metabox-holder columns-2">
|
35 |
-
|
36 |
-
<div class="notice notice-warning">
|
37 |
-
<p><strong><?php _e( 'WARNING: Before you delete any users please first take Backup, any delete operation done is irreversible. Please use it with caution!', 'wp-bulk-delete' ); ?></strong></p>
|
38 |
-
</div>
|
39 |
-
|
40 |
-
<div class="delete_notice"></div>
|
41 |
-
|
42 |
-
<div id="postbox-container-1" class="postbox-container">
|
43 |
-
<?php do_action('wpbd_admin_sidebar'); ?>
|
44 |
-
</div>
|
45 |
-
|
46 |
-
<div id="postbox-container-2" class="postbox-container">
|
47 |
-
<form method="post" id="delete_users_form">
|
48 |
-
<table class="form-table">
|
49 |
-
<?php
|
50 |
-
do_action( 'wpbd_delete_users_form' );
|
51 |
-
wpbd_render_delete_time();
|
52 |
-
?>
|
53 |
-
</table>
|
54 |
-
<?php
|
55 |
-
echo wp_nonce_field('delete_users_nonce', '_delete_users_wpnonce' );
|
56 |
-
?>
|
57 |
-
<p class="submit">
|
58 |
-
<input name="delete_users_submit" id="delete_users_submit" class="button button-primary" value="<?php esc_html_e('Delete Users', 'wp-bulk-delete');?>" type="button">
|
59 |
-
<span class="spinner" style="float: none;"></span>
|
60 |
-
</p>
|
61 |
-
</form>
|
62 |
-
</div>
|
63 |
-
</div>
|
64 |
-
<br class="clear">
|
65 |
-
</div>
|
66 |
-
|
67 |
-
</div><!-- /.wrap -->
|
68 |
-
<?php
|
69 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Delete Users
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Admin/Pages
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Delete Users Page.
|
17 |
+
*
|
18 |
+
* Render the delete users page contents.
|
19 |
+
*
|
20 |
+
* @since 1.0
|
21 |
+
* @return void
|
22 |
+
*/
|
23 |
+
function wpbd_delete_users_page(){
|
24 |
+
|
25 |
+
if( ! empty( $_POST ) && isset( $_POST['_delete_users_wpnonce'] ) ){
|
26 |
+
// Get user_result for delete based on user input.
|
27 |
+
$user_result = xt_delete_users_form_process( $_POST );
|
28 |
+
wpbd_display_admin_notice( $user_result );
|
29 |
+
}
|
30 |
+
?>
|
31 |
+
<div class="wrap">
|
32 |
+
<h2><?php esc_html_e('Delete Users','wp-bulk-delete'); ?></h2>
|
33 |
+
<div id="poststuff">
|
34 |
+
<div id="post-body" class="metabox-holder columns-2">
|
35 |
+
|
36 |
+
<div class="notice notice-warning">
|
37 |
+
<p><strong><?php _e( 'WARNING: Before you delete any users please first take Backup, any delete operation done is irreversible. Please use it with caution!', 'wp-bulk-delete' ); ?></strong></p>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<div class="delete_notice"></div>
|
41 |
+
|
42 |
+
<div id="postbox-container-1" class="postbox-container">
|
43 |
+
<?php do_action('wpbd_admin_sidebar'); ?>
|
44 |
+
</div>
|
45 |
+
|
46 |
+
<div id="postbox-container-2" class="postbox-container">
|
47 |
+
<form method="post" id="delete_users_form">
|
48 |
+
<table class="form-table">
|
49 |
+
<?php
|
50 |
+
do_action( 'wpbd_delete_users_form' );
|
51 |
+
wpbd_render_delete_time();
|
52 |
+
?>
|
53 |
+
</table>
|
54 |
+
<?php
|
55 |
+
echo wp_nonce_field('delete_users_nonce', '_delete_users_wpnonce' );
|
56 |
+
?>
|
57 |
+
<p class="submit">
|
58 |
+
<input name="delete_users_submit" id="delete_users_submit" class="button button-primary" value="<?php esc_html_e('Delete Users', 'wp-bulk-delete');?>" type="button">
|
59 |
+
<span class="spinner" style="float: none;"></span>
|
60 |
+
</p>
|
61 |
+
</form>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
<br class="clear">
|
65 |
+
</div>
|
66 |
+
|
67 |
+
</div><!-- /.wrap -->
|
68 |
+
<?php
|
69 |
}
|
includes/ajax-functions.php
CHANGED
@@ -1,423 +1,423 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Ajax Functions
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Ajax Functions
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Get delete posts count for delete confirmation.
|
17 |
-
*
|
18 |
-
* @since 1.0
|
19 |
-
* @return array
|
20 |
-
*/
|
21 |
-
function wpbd_delete_posts_count() {
|
22 |
-
$data = $error = $return = array();
|
23 |
-
parse_str($_POST['form'], $data);
|
24 |
-
if( ! empty( $data ) ){
|
25 |
-
|
26 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
27 |
-
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
28 |
-
}
|
29 |
-
|
30 |
-
if ( isset( $data['_delete_all_posts_wpnonce'] ) && wp_verify_nonce( $data['_delete_all_posts_wpnonce'], 'delete_posts_nonce' ) ) {
|
31 |
-
|
32 |
-
if( empty( $error ) ){
|
33 |
-
|
34 |
-
// Get post_ids for delete based on user input.
|
35 |
-
$post_ids = wpbulkdelete()->api->get_delete_posts_ids( $data );
|
36 |
-
|
37 |
-
if ( ! empty( $post_ids ) && count( $post_ids ) > 0 ) {
|
38 |
-
$return = array(
|
39 |
-
'status' => 1,
|
40 |
-
'post_count' => count( $post_ids ),
|
41 |
-
);
|
42 |
-
} else {
|
43 |
-
$return = array(
|
44 |
-
'status' => 2,
|
45 |
-
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
46 |
-
);
|
47 |
-
}
|
48 |
-
|
49 |
-
} else {
|
50 |
-
$return = array(
|
51 |
-
'status' => 0,
|
52 |
-
'messages' => $error[0],
|
53 |
-
);
|
54 |
-
}
|
55 |
-
|
56 |
-
} else {
|
57 |
-
$error[] = esc_html__('Sorry, Your nonce did not verify.', 'wp-bulk-delete' );
|
58 |
-
$return = array(
|
59 |
-
'status' => 0,
|
60 |
-
'messages' => $error[0],
|
61 |
-
);
|
62 |
-
}
|
63 |
-
}
|
64 |
-
echo json_encode( $return );
|
65 |
-
wp_die(); // this is required to terminate immediately and return a proper response
|
66 |
-
}
|
67 |
-
add_action( 'wp_ajax_delete_posts_count', 'wpbd_delete_posts_count' );
|
68 |
-
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Render Taxonomy based on Post type Selection.
|
72 |
-
*
|
73 |
-
* @since 1.0
|
74 |
-
* @return void
|
75 |
-
*/
|
76 |
-
function wpbd_render_taxonomy_by_posttype() {
|
77 |
-
|
78 |
-
$post_type = $_REQUEST['post_type'];
|
79 |
-
$taxonomies = array();
|
80 |
-
if ( $post_type != '' ) {
|
81 |
-
$taxonomies = wpbd_get_taxonomy_by_posttype( $post_type );
|
82 |
-
}
|
83 |
-
if( ! empty( $taxonomies ) ){
|
84 |
-
foreach ($taxonomies as $slug => $name ) {
|
85 |
-
?>
|
86 |
-
<input type="radio" name="post_taxonomy" value="<?php echo $slug;?>" class="post_taxonomy_radio" title="<?php echo $name; ?>"><?php echo $name; ?> <br />
|
87 |
-
<?php
|
88 |
-
}
|
89 |
-
}
|
90 |
-
wp_die();
|
91 |
-
}
|
92 |
-
add_action( 'wp_ajax_render_taxonomy_by_posttype', 'wpbd_render_taxonomy_by_posttype' );
|
93 |
-
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Render Taxonomy Terms based on Texonomy Selection.
|
97 |
-
*
|
98 |
-
* @since 1.0
|
99 |
-
* @return void
|
100 |
-
*/
|
101 |
-
function wpbd_render_terms_by_taxonomy() {
|
102 |
-
|
103 |
-
$post_taxo = esc_attr( $_REQUEST['post_taxomony'] );
|
104 |
-
$terms = array();
|
105 |
-
if ( $post_taxo != '' ) {
|
106 |
-
if( taxonomy_exists( $post_taxo ) ){
|
107 |
-
$terms = get_terms( $post_taxo, array( 'hide_empty' => true ) );
|
108 |
-
}
|
109 |
-
}
|
110 |
-
if( ! empty( $terms ) ){
|
111 |
-
?>
|
112 |
-
<select name="post_taxonomy_terms[]" class="taxonomy_terms_select" multiple="multiple">
|
113 |
-
<?php
|
114 |
-
foreach ($terms as $term ) {
|
115 |
-
?>
|
116 |
-
<option value="<?php echo $term->term_id ?>"><?php echo $term->name; ?></option>
|
117 |
-
<?php
|
118 |
-
} ?>
|
119 |
-
</select>
|
120 |
-
<?php
|
121 |
-
}
|
122 |
-
wp_die();
|
123 |
-
}
|
124 |
-
add_action( 'wp_ajax_render_terms_by_taxonomy', 'wpbd_render_terms_by_taxonomy' );
|
125 |
-
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Delete Users count for delete confirmation.
|
129 |
-
*
|
130 |
-
* @since 1.1.0
|
131 |
-
* @return array
|
132 |
-
*/
|
133 |
-
function wpbd_delete_users_count() {
|
134 |
-
$data = $error = $return = array();
|
135 |
-
parse_str($_POST['form'], $data);
|
136 |
-
if( ! empty( $data ) ){
|
137 |
-
|
138 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
139 |
-
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
140 |
-
}
|
141 |
-
|
142 |
-
if ( isset( $data['_delete_users_wpnonce'] ) && wp_verify_nonce( $data['_delete_users_wpnonce'], 'delete_users_nonce' ) ) {
|
143 |
-
|
144 |
-
if( empty( $error ) ){
|
145 |
-
// Get post_ids for delete based on user input.
|
146 |
-
$post_ids = wpbulkdelete()->api->get_delete_user_ids( $data );
|
147 |
-
|
148 |
-
if ( ! empty( $post_ids ) && count( $post_ids ) > 0 ) {
|
149 |
-
$return = array(
|
150 |
-
'status' => 1,
|
151 |
-
'post_count' => count( $post_ids ),
|
152 |
-
);
|
153 |
-
} else {
|
154 |
-
$return = array(
|
155 |
-
'status' => 2,
|
156 |
-
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
157 |
-
);
|
158 |
-
}
|
159 |
-
|
160 |
-
} else {
|
161 |
-
$return = array(
|
162 |
-
'status' => 0,
|
163 |
-
'messages' => $error[0],
|
164 |
-
);
|
165 |
-
}
|
166 |
-
|
167 |
-
} else {
|
168 |
-
$error[] = esc_html__('Sorry, Your nonce did not verify.', 'wp-bulk-delete' );
|
169 |
-
$return = array(
|
170 |
-
'status' => 0,
|
171 |
-
'messages' => $error[0],
|
172 |
-
);
|
173 |
-
}
|
174 |
-
}
|
175 |
-
echo json_encode( $return );
|
176 |
-
wp_die(); // this is required to terminate immediately and return a proper response
|
177 |
-
}
|
178 |
-
add_action( 'wp_ajax_delete_users_count', 'wpbd_delete_users_count' );
|
179 |
-
|
180 |
-
/**
|
181 |
-
* Delete comments count for delete confirmation.
|
182 |
-
*
|
183 |
-
* @since 1.1.0
|
184 |
-
* @return array
|
185 |
-
*/
|
186 |
-
function wpbd_delete_comments_count() {
|
187 |
-
$data = $error = $return = array();
|
188 |
-
parse_str($_POST['form'], $data);
|
189 |
-
if( ! empty( $data ) ){
|
190 |
-
|
191 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
192 |
-
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
193 |
-
}
|
194 |
-
|
195 |
-
if( empty( $data['delete_comment_status'] ) ){
|
196 |
-
$error[] = esc_html__('Please select Comment status for proceed delete operation.', 'wp-bulk-delete' );
|
197 |
-
}
|
198 |
-
|
199 |
-
if ( isset( $data['_delete_comments_wpnonce'] ) && wp_verify_nonce( $data['_delete_comments_wpnonce'], 'delete_comments_nonce' ) ) {
|
200 |
-
|
201 |
-
if( empty( $error ) ){
|
202 |
-
|
203 |
-
// Get delete comment count based on form data
|
204 |
-
$deletecomment_count = wpbulkdelete()->api->get_delete_comment_count( $data );
|
205 |
-
|
206 |
-
if( false === $deletecomment_count ){
|
207 |
-
$return = array(
|
208 |
-
'status' => 0,
|
209 |
-
'messages' => array( esc_html__( 'Something went wrong pelase try again!!', 'wp-bulk-delete' ) ),
|
210 |
-
);
|
211 |
-
}
|
212 |
-
|
213 |
-
if ( $deletecomment_count > 0 ) {
|
214 |
-
$return = array(
|
215 |
-
'status' => 1,
|
216 |
-
'post_count' => $deletecomment_count,
|
217 |
-
);
|
218 |
-
} else {
|
219 |
-
$return = array(
|
220 |
-
'status' => 2,
|
221 |
-
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
222 |
-
);
|
223 |
-
}
|
224 |
-
|
225 |
-
} else {
|
226 |
-
$return = array(
|
227 |
-
'status' => 0,
|
228 |
-
'messages' => $error[0],
|
229 |
-
);
|
230 |
-
}
|
231 |
-
|
232 |
-
} else {
|
233 |
-
$error[] = esc_html__('Sorry, Your nonce did not verify.', 'wp-bulk-delete' );
|
234 |
-
$return = array(
|
235 |
-
'status' => 0,
|
236 |
-
'messages' => $error[0],
|
237 |
-
);
|
238 |
-
}
|
239 |
-
}
|
240 |
-
echo json_encode( $return );
|
241 |
-
wp_die(); // this is required to terminate immediately and return a proper response
|
242 |
-
}
|
243 |
-
add_action( 'wp_ajax_delete_comments_count', 'wpbd_delete_comments_count' );
|
244 |
-
|
245 |
-
|
246 |
-
/**
|
247 |
-
* Get delete meta count for delete confirmation.
|
248 |
-
*
|
249 |
-
* @since 1.0
|
250 |
-
* @return array
|
251 |
-
*/
|
252 |
-
function wpbd_delete_meta_count() {
|
253 |
-
$data = $error = $return = array();
|
254 |
-
parse_str($_POST['form'], $data);
|
255 |
-
if( ! empty( $data ) ){
|
256 |
-
|
257 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
258 |
-
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
259 |
-
}
|
260 |
-
|
261 |
-
if( $data['custom_field_key'] == '' ){
|
262 |
-
$error[] = esc_html__('Please select all required fields.', 'wp-bulk-delete' );
|
263 |
-
}
|
264 |
-
|
265 |
-
if( $data['meta_type'] == 'postmeta' ){
|
266 |
-
if( $data['meta_post_type'] == '' ){
|
267 |
-
$error[] = esc_html__('Please select all required fields.', 'wp-bulk-delete' );
|
268 |
-
}
|
269 |
-
}
|
270 |
-
|
271 |
-
if( $data['meta_type'] == 'usermeta' ){
|
272 |
-
if( empty( $data['delete_user_roles'] ) ){
|
273 |
-
$error[] = esc_html__('Please select all required fields.', 'wp-bulk-delete' );
|
274 |
-
}
|
275 |
-
}
|
276 |
-
|
277 |
-
if ( isset( $data['_delete_meta_wpnonce'] ) && wp_verify_nonce( $data['_delete_meta_wpnonce'], 'delete_meta_nonce' ) ) {
|
278 |
-
|
279 |
-
if( empty( $error ) ){
|
280 |
-
// Get meta_ids for delete based on user input.
|
281 |
-
$meta_ids = array();
|
282 |
-
if( 'postmeta' == $data['meta_type'] ) {
|
283 |
-
$meta_ids = wpbulkdelete()->api->get_delete_postmeta_ids( $data );
|
284 |
-
|
285 |
-
} elseif('usermeta' == $data['meta_type'] ) {
|
286 |
-
$meta_ids = wpbulkdelete()->api->get_delete_usermeta_ids( $data );
|
287 |
-
|
288 |
-
} elseif('commentmeta' == $data['meta_type'] ) {
|
289 |
-
$meta_ids = wpbulkdelete()->api->get_delete_commentmeta_ids( $data );
|
290 |
-
}
|
291 |
-
|
292 |
-
if ( ! empty( $meta_ids ) && count( $meta_ids ) > 0 ) {
|
293 |
-
$return = array(
|
294 |
-
'status' => 1,
|
295 |
-
'post_count' => count( $meta_ids ),
|
296 |
-
);
|
297 |
-
} else {
|
298 |
-
$return = array(
|
299 |
-
'status' => 2,
|
300 |
-
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
301 |
-
);
|
302 |
-
}
|
303 |
-
|
304 |
-
} else {
|
305 |
-
$return = array(
|
306 |
-
'status' => 0,
|
307 |
-
'messages' => $error[0],
|
308 |
-
);
|
309 |
-
}
|
310 |
-
|
311 |
-
} else {
|
312 |
-
$error[] = esc_html__('Sorry, Your nonce did not verify.', 'wp-bulk-delete' );
|
313 |
-
$return = array(
|
314 |
-
'status' => 0,
|
315 |
-
'messages' => $error[0],
|
316 |
-
);
|
317 |
-
}
|
318 |
-
}
|
319 |
-
echo json_encode( $return );
|
320 |
-
wp_die(); // this is required to terminate immediately and return a proper response
|
321 |
-
}
|
322 |
-
add_action( 'wp_ajax_delete_meta_count', 'wpbd_delete_meta_count' );
|
323 |
-
|
324 |
-
|
325 |
-
/**
|
326 |
-
* Delete comments count for delete confirmation.
|
327 |
-
*
|
328 |
-
* @since 1.1.0
|
329 |
-
* @return array
|
330 |
-
*/
|
331 |
-
function wpbd_delete_terms_count() {
|
332 |
-
$data = $error = $return = array();
|
333 |
-
parse_str($_POST['form'], $data);
|
334 |
-
if( ! empty( $data ) ){
|
335 |
-
|
336 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
337 |
-
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
338 |
-
}
|
339 |
-
|
340 |
-
if( $data['delete_post_type'] == '' || $data['post_taxonomy'] == '' ){
|
341 |
-
$error[] = esc_html__('Please select required fields for proceed delete operation.', 'wp-bulk-delete' );
|
342 |
-
}
|
343 |
-
|
344 |
-
if ( isset( $data['_delete_terms_wpnonce'] ) && wp_verify_nonce( $data['_delete_terms_wpnonce'], 'delete_terms_nonce' ) ) {
|
345 |
-
|
346 |
-
if( empty( $error ) ){
|
347 |
-
|
348 |
-
// Get delete comment count based on form data
|
349 |
-
$deleteterms_count = wpbulkdelete()->api->get_delete_term_count( $data );
|
350 |
-
|
351 |
-
if( false === $deleteterms_count ){
|
352 |
-
$return = array(
|
353 |
-
'status' => 0,
|
354 |
-
'messages' => array( esc_html__( 'Something went wrong pelase try again!!', 'wp-bulk-delete' ) ),
|
355 |
-
);
|
356 |
-
}
|
357 |
-
|
358 |
-
if ( $deleteterms_count > 0 ) {
|
359 |
-
$return = array(
|
360 |
-
'status' => 1,
|
361 |
-
'post_count' => $deleteterms_count,
|
362 |
-
);
|
363 |
-
} else {
|
364 |
-
$return = array(
|
365 |
-
'status' => 2,
|
366 |
-
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
367 |
-
);
|
368 |
-
}
|
369 |
-
|
370 |
-
} else {
|
371 |
-
$return = array(
|
372 |
-
'status' => 0,
|
373 |
-
'messages' => $error[0],
|
374 |
-
);
|
375 |
-
}
|
376 |
-
|
377 |
-
} else {
|
378 |
-
$error[] = esc_html__('Sorry, Your nonce did not verify.', 'wp-bulk-delete' );
|
379 |
-
$return = array(
|
380 |
-
'status' => 0,
|
381 |
-
'messages' => $error[0],
|
382 |
-
);
|
383 |
-
}
|
384 |
-
}
|
385 |
-
echo json_encode( $return );
|
386 |
-
wp_die(); // this is required to terminate immediately and return a proper response
|
387 |
-
}
|
388 |
-
add_action( 'wp_ajax_delete_terms_count', 'wpbd_delete_terms_count' );
|
389 |
-
|
390 |
-
|
391 |
-
/**
|
392 |
-
* Render Taxonomy based on Post type Selection.
|
393 |
-
*
|
394 |
-
* @since 1.0
|
395 |
-
* @return void
|
396 |
-
*/
|
397 |
-
function wpbd_render_postdropdown_by_posttype() {
|
398 |
-
|
399 |
-
$post_type = $_REQUEST['post_type'];
|
400 |
-
$posts = array();
|
401 |
-
if ( $post_type != '' ) {
|
402 |
-
$posts = get_posts(
|
403 |
-
array(
|
404 |
-
'post_type' => $post_type,
|
405 |
-
'numberposts' => -1,
|
406 |
-
)
|
407 |
-
);
|
408 |
-
}
|
409 |
-
if( ! empty( $posts ) ){
|
410 |
-
?>
|
411 |
-
<select name="post_for_meta[]" class="post_for_meta" multiple="multiple">
|
412 |
-
<?php
|
413 |
-
foreach ($posts as $post ) {
|
414 |
-
?>
|
415 |
-
<option value="<?php echo $post->ID; ?>"><?php echo $post->post_title; ?></option>
|
416 |
-
<?php
|
417 |
-
} ?>
|
418 |
-
</select>
|
419 |
-
<?php
|
420 |
-
}
|
421 |
-
wp_die();
|
422 |
-
}
|
423 |
add_action( 'wp_ajax_render_postdropdown_by_posttype', 'wpbd_render_postdropdown_by_posttype' );
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Ajax Functions
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Ajax Functions
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Get delete posts count for delete confirmation.
|
17 |
+
*
|
18 |
+
* @since 1.0
|
19 |
+
* @return array
|
20 |
+
*/
|
21 |
+
function wpbd_delete_posts_count() {
|
22 |
+
$data = $error = $return = array();
|
23 |
+
parse_str($_POST['form'], $data);
|
24 |
+
if( ! empty( $data ) ){
|
25 |
+
|
26 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
27 |
+
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
28 |
+
}
|
29 |
+
|
30 |
+
if ( isset( $data['_delete_all_posts_wpnonce'] ) && wp_verify_nonce( $data['_delete_all_posts_wpnonce'], 'delete_posts_nonce' ) ) {
|
31 |
+
|
32 |
+
if( empty( $error ) ){
|
33 |
+
|
34 |
+
// Get post_ids for delete based on user input.
|
35 |
+
$post_ids = wpbulkdelete()->api->get_delete_posts_ids( $data );
|
36 |
+
|
37 |
+
if ( ! empty( $post_ids ) && count( $post_ids ) > 0 ) {
|
38 |
+
$return = array(
|
39 |
+
'status' => 1,
|
40 |
+
'post_count' => count( $post_ids ),
|
41 |
+
);
|
42 |
+
} else {
|
43 |
+
$return = array(
|
44 |
+
'status' => 2,
|
45 |
+
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
46 |
+
);
|
47 |
+
}
|
48 |
+
|
49 |
+
} else {
|
50 |
+
$return = array(
|
51 |
+
'status' => 0,
|
52 |
+
'messages' => $error[0],
|
53 |
+
);
|
54 |
+
}
|
55 |
+
|
56 |
+
} else {
|
57 |
+
$error[] = esc_html__('Sorry, Your nonce did not verify.', 'wp-bulk-delete' );
|
58 |
+
$return = array(
|
59 |
+
'status' => 0,
|
60 |
+
'messages' => $error[0],
|
61 |
+
);
|
62 |
+
}
|
63 |
+
}
|
64 |
+
echo json_encode( $return );
|
65 |
+
wp_die(); // this is required to terminate immediately and return a proper response
|
66 |
+
}
|
67 |
+
add_action( 'wp_ajax_delete_posts_count', 'wpbd_delete_posts_count' );
|
68 |
+
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Render Taxonomy based on Post type Selection.
|
72 |
+
*
|
73 |
+
* @since 1.0
|
74 |
+
* @return void
|
75 |
+
*/
|
76 |
+
function wpbd_render_taxonomy_by_posttype() {
|
77 |
+
|
78 |
+
$post_type = $_REQUEST['post_type'];
|
79 |
+
$taxonomies = array();
|
80 |
+
if ( $post_type != '' ) {
|
81 |
+
$taxonomies = wpbd_get_taxonomy_by_posttype( $post_type );
|
82 |
+
}
|
83 |
+
if( ! empty( $taxonomies ) ){
|
84 |
+
foreach ($taxonomies as $slug => $name ) {
|
85 |
+
?>
|
86 |
+
<input type="radio" name="post_taxonomy" value="<?php echo $slug;?>" class="post_taxonomy_radio" title="<?php echo $name; ?>"><?php echo $name; ?> <br />
|
87 |
+
<?php
|
88 |
+
}
|
89 |
+
}
|
90 |
+
wp_die();
|
91 |
+
}
|
92 |
+
add_action( 'wp_ajax_render_taxonomy_by_posttype', 'wpbd_render_taxonomy_by_posttype' );
|
93 |
+
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Render Taxonomy Terms based on Texonomy Selection.
|
97 |
+
*
|
98 |
+
* @since 1.0
|
99 |
+
* @return void
|
100 |
+
*/
|
101 |
+
function wpbd_render_terms_by_taxonomy() {
|
102 |
+
|
103 |
+
$post_taxo = esc_attr( $_REQUEST['post_taxomony'] );
|
104 |
+
$terms = array();
|
105 |
+
if ( $post_taxo != '' ) {
|
106 |
+
if( taxonomy_exists( $post_taxo ) ){
|
107 |
+
$terms = get_terms( $post_taxo, array( 'hide_empty' => true ) );
|
108 |
+
}
|
109 |
+
}
|
110 |
+
if( ! empty( $terms ) ){
|
111 |
+
?>
|
112 |
+
<select name="post_taxonomy_terms[]" class="taxonomy_terms_select" multiple="multiple">
|
113 |
+
<?php
|
114 |
+
foreach ($terms as $term ) {
|
115 |
+
?>
|
116 |
+
<option value="<?php echo $term->term_id ?>"><?php echo $term->name; ?></option>
|
117 |
+
<?php
|
118 |
+
} ?>
|
119 |
+
</select>
|
120 |
+
<?php
|
121 |
+
}
|
122 |
+
wp_die();
|
123 |
+
}
|
124 |
+
add_action( 'wp_ajax_render_terms_by_taxonomy', 'wpbd_render_terms_by_taxonomy' );
|
125 |
+
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Delete Users count for delete confirmation.
|
129 |
+
*
|
130 |
+
* @since 1.1.0
|
131 |
+
* @return array
|
132 |
+
*/
|
133 |
+
function wpbd_delete_users_count() {
|
134 |
+
$data = $error = $return = array();
|
135 |
+
parse_str($_POST['form'], $data);
|
136 |
+
if( ! empty( $data ) ){
|
137 |
+
|
138 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
139 |
+
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
140 |
+
}
|
141 |
+
|
142 |
+
if ( isset( $data['_delete_users_wpnonce'] ) && wp_verify_nonce( $data['_delete_users_wpnonce'], 'delete_users_nonce' ) ) {
|
143 |
+
|
144 |
+
if( empty( $error ) ){
|
145 |
+
// Get post_ids for delete based on user input.
|
146 |
+
$post_ids = wpbulkdelete()->api->get_delete_user_ids( $data );
|
147 |
+
|
148 |
+
if ( ! empty( $post_ids ) && count( $post_ids ) > 0 ) {
|
149 |
+
$return = array(
|
150 |
+
'status' => 1,
|
151 |
+
'post_count' => count( $post_ids ),
|
152 |
+
);
|
153 |
+
} else {
|
154 |
+
$return = array(
|
155 |
+
'status' => 2,
|
156 |
+
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
157 |
+
);
|
158 |
+
}
|
159 |
+
|
160 |
+
} else {
|
161 |
+
$return = array(
|
162 |
+
'status' => 0,
|
163 |
+
'messages' => $error[0],
|
164 |
+
);
|
165 |
+
}
|
166 |
+
|
167 |
+
} else {
|
168 |
+
$error[] = esc_html__('Sorry, Your nonce did not verify.', 'wp-bulk-delete' );
|
169 |
+
$return = array(
|
170 |
+
'status' => 0,
|
171 |
+
'messages' => $error[0],
|
172 |
+
);
|
173 |
+
}
|
174 |
+
}
|
175 |
+
echo json_encode( $return );
|
176 |
+
wp_die(); // this is required to terminate immediately and return a proper response
|
177 |
+
}
|
178 |
+
add_action( 'wp_ajax_delete_users_count', 'wpbd_delete_users_count' );
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Delete comments count for delete confirmation.
|
182 |
+
*
|
183 |
+
* @since 1.1.0
|
184 |
+
* @return array
|
185 |
+
*/
|
186 |
+
function wpbd_delete_comments_count() {
|
187 |
+
$data = $error = $return = array();
|
188 |
+
parse_str($_POST['form'], $data);
|
189 |
+
if( ! empty( $data ) ){
|
190 |
+
|
191 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
192 |
+
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
193 |
+
}
|
194 |
+
|
195 |
+
if( empty( $data['delete_comment_status'] ) ){
|
196 |
+
$error[] = esc_html__('Please select Comment status for proceed delete operation.', 'wp-bulk-delete' );
|
197 |
+
}
|
198 |
+
|
199 |
+
if ( isset( $data['_delete_comments_wpnonce'] ) && wp_verify_nonce( $data['_delete_comments_wpnonce'], 'delete_comments_nonce' ) ) {
|
200 |
+
|
201 |
+
if( empty( $error ) ){
|
202 |
+
|
203 |
+
// Get delete comment count based on form data
|
204 |
+
$deletecomment_count = wpbulkdelete()->api->get_delete_comment_count( $data );
|
205 |
+
|
206 |
+
if( false === $deletecomment_count ){
|
207 |
+
$return = array(
|
208 |
+
'status' => 0,
|
209 |
+
'messages' => array( esc_html__( 'Something went wrong pelase try again!!', 'wp-bulk-delete' ) ),
|
210 |
+
);
|
211 |
+
}
|
212 |
+
|
213 |
+
if ( $deletecomment_count > 0 ) {
|
214 |
+
$return = array(
|
215 |
+
'status' => 1,
|
216 |
+
'post_count' => $deletecomment_count,
|
217 |
+
);
|
218 |
+
} else {
|
219 |
+
$return = array(
|
220 |
+
'status' => 2,
|
221 |
+
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
222 |
+
);
|
223 |
+
}
|
224 |
+
|
225 |
+
} else {
|
226 |
+
$return = array(
|
227 |
+
'status' => 0,
|
228 |
+
'messages' => $error[0],
|
229 |
+
);
|
230 |
+
}
|
231 |
+
|
232 |
+
} else {
|
233 |
+
$error[] = esc_html__('Sorry, Your nonce did not verify.', 'wp-bulk-delete' );
|
234 |
+
$return = array(
|
235 |
+
'status' => 0,
|
236 |
+
'messages' => $error[0],
|
237 |
+
);
|
238 |
+
}
|
239 |
+
}
|
240 |
+
echo json_encode( $return );
|
241 |
+
wp_die(); // this is required to terminate immediately and return a proper response
|
242 |
+
}
|
243 |
+
add_action( 'wp_ajax_delete_comments_count', 'wpbd_delete_comments_count' );
|
244 |
+
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Get delete meta count for delete confirmation.
|
248 |
+
*
|
249 |
+
* @since 1.0
|
250 |
+
* @return array
|
251 |
+
*/
|
252 |
+
function wpbd_delete_meta_count() {
|
253 |
+
$data = $error = $return = array();
|
254 |
+
parse_str($_POST['form'], $data);
|
255 |
+
if( ! empty( $data ) ){
|
256 |
+
|
257 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
258 |
+
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
259 |
+
}
|
260 |
+
|
261 |
+
if( $data['custom_field_key'] == '' ){
|
262 |
+
$error[] = esc_html__('Please select all required fields.', 'wp-bulk-delete' );
|
263 |
+
}
|
264 |
+
|
265 |
+
if( $data['meta_type'] == 'postmeta' ){
|
266 |
+
if( $data['meta_post_type'] == '' ){
|
267 |
+
$error[] = esc_html__('Please select all required fields.', 'wp-bulk-delete' );
|
268 |
+
}
|
269 |
+
}
|
270 |
+
|
271 |
+
if( $data['meta_type'] == 'usermeta' ){
|
272 |
+
if( empty( $data['delete_user_roles'] ) ){
|
273 |
+
$error[] = esc_html__('Please select all required fields.', 'wp-bulk-delete' );
|
274 |
+
}
|
275 |
+
}
|
276 |
+
|
277 |
+
if ( isset( $data['_delete_meta_wpnonce'] ) && wp_verify_nonce( $data['_delete_meta_wpnonce'], 'delete_meta_nonce' ) ) {
|
278 |
+
|
279 |
+
if( empty( $error ) ){
|
280 |
+
// Get meta_ids for delete based on user input.
|
281 |
+
$meta_ids = array();
|
282 |
+
if( 'postmeta' == $data['meta_type'] ) {
|
283 |
+
$meta_ids = wpbulkdelete()->api->get_delete_postmeta_ids( $data );
|
284 |
+
|
285 |
+
} elseif('usermeta' == $data['meta_type'] ) {
|
286 |
+
$meta_ids = wpbulkdelete()->api->get_delete_usermeta_ids( $data );
|
287 |
+
|
288 |
+
} elseif('commentmeta' == $data['meta_type'] ) {
|
289 |
+
$meta_ids = wpbulkdelete()->api->get_delete_commentmeta_ids( $data );
|
290 |
+
}
|
291 |
+
|
292 |
+
if ( ! empty( $meta_ids ) && count( $meta_ids ) > 0 ) {
|
293 |
+
$return = array(
|
294 |
+
'status' => 1,
|
295 |
+
'post_count' => count( $meta_ids ),
|
296 |
+
);
|
297 |
+
} else {
|
298 |
+
$return = array(
|
299 |
+
'status' => 2,
|
300 |
+
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
301 |
+
);
|
302 |
+
}
|
303 |
+
|
304 |
+
} else {
|
305 |
+
$return = array(
|
306 |
+
'status' => 0,
|
307 |
+
'messages' => $error[0],
|
308 |
+
);
|
309 |
+
}
|
310 |
+
|
311 |
+
} else {
|
312 |
+
$error[] = esc_html__('Sorry, Your nonce did not verify.', 'wp-bulk-delete' );
|
313 |
+
$return = array(
|
314 |
+
'status' => 0,
|
315 |
+
'messages' => $error[0],
|
316 |
+
);
|
317 |
+
}
|
318 |
+
}
|
319 |
+
echo json_encode( $return );
|
320 |
+
wp_die(); // this is required to terminate immediately and return a proper response
|
321 |
+
}
|
322 |
+
add_action( 'wp_ajax_delete_meta_count', 'wpbd_delete_meta_count' );
|
323 |
+
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Delete comments count for delete confirmation.
|
327 |
+
*
|
328 |
+
* @since 1.1.0
|
329 |
+
* @return array
|
330 |
+
*/
|
331 |
+
function wpbd_delete_terms_count() {
|
332 |
+
$data = $error = $return = array();
|
333 |
+
parse_str($_POST['form'], $data);
|
334 |
+
if( ! empty( $data ) ){
|
335 |
+
|
336 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
337 |
+
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
338 |
+
}
|
339 |
+
|
340 |
+
if( $data['delete_post_type'] == '' || $data['post_taxonomy'] == '' ){
|
341 |
+
$error[] = esc_html__('Please select required fields for proceed delete operation.', 'wp-bulk-delete' );
|
342 |
+
}
|
343 |
+
|
344 |
+
if ( isset( $data['_delete_terms_wpnonce'] ) && wp_verify_nonce( $data['_delete_terms_wpnonce'], 'delete_terms_nonce' ) ) {
|
345 |
+
|
346 |
+
if( empty( $error ) ){
|
347 |
+
|
348 |
+
// Get delete comment count based on form data
|
349 |
+
$deleteterms_count = wpbulkdelete()->api->get_delete_term_count( $data );
|
350 |
+
|
351 |
+
if( false === $deleteterms_count ){
|
352 |
+
$return = array(
|
353 |
+
'status' => 0,
|
354 |
+
'messages' => array( esc_html__( 'Something went wrong pelase try again!!', 'wp-bulk-delete' ) ),
|
355 |
+
);
|
356 |
+
}
|
357 |
+
|
358 |
+
if ( $deleteterms_count > 0 ) {
|
359 |
+
$return = array(
|
360 |
+
'status' => 1,
|
361 |
+
'post_count' => $deleteterms_count,
|
362 |
+
);
|
363 |
+
} else {
|
364 |
+
$return = array(
|
365 |
+
'status' => 2,
|
366 |
+
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
367 |
+
);
|
368 |
+
}
|
369 |
+
|
370 |
+
} else {
|
371 |
+
$return = array(
|
372 |
+
'status' => 0,
|
373 |
+
'messages' => $error[0],
|
374 |
+
);
|
375 |
+
}
|
376 |
+
|
377 |
+
} else {
|
378 |
+
$error[] = esc_html__('Sorry, Your nonce did not verify.', 'wp-bulk-delete' );
|
379 |
+
$return = array(
|
380 |
+
'status' => 0,
|
381 |
+
'messages' => $error[0],
|
382 |
+
);
|
383 |
+
}
|
384 |
+
}
|
385 |
+
echo json_encode( $return );
|
386 |
+
wp_die(); // this is required to terminate immediately and return a proper response
|
387 |
+
}
|
388 |
+
add_action( 'wp_ajax_delete_terms_count', 'wpbd_delete_terms_count' );
|
389 |
+
|
390 |
+
|
391 |
+
/**
|
392 |
+
* Render Taxonomy based on Post type Selection.
|
393 |
+
*
|
394 |
+
* @since 1.0
|
395 |
+
* @return void
|
396 |
+
*/
|
397 |
+
function wpbd_render_postdropdown_by_posttype() {
|
398 |
+
|
399 |
+
$post_type = $_REQUEST['post_type'];
|
400 |
+
$posts = array();
|
401 |
+
if ( $post_type != '' ) {
|
402 |
+
$posts = get_posts(
|
403 |
+
array(
|
404 |
+
'post_type' => $post_type,
|
405 |
+
'numberposts' => -1,
|
406 |
+
)
|
407 |
+
);
|
408 |
+
}
|
409 |
+
if( ! empty( $posts ) ){
|
410 |
+
?>
|
411 |
+
<select name="post_for_meta[]" class="post_for_meta" multiple="multiple">
|
412 |
+
<?php
|
413 |
+
foreach ($posts as $post ) {
|
414 |
+
?>
|
415 |
+
<option value="<?php echo $post->ID; ?>"><?php echo $post->post_title; ?></option>
|
416 |
+
<?php
|
417 |
+
} ?>
|
418 |
+
</select>
|
419 |
+
<?php
|
420 |
+
}
|
421 |
+
wp_die();
|
422 |
+
}
|
423 |
add_action( 'wp_ajax_render_postdropdown_by_posttype', 'wpbd_render_postdropdown_by_posttype' );
|
includes/class-delete-api.php
CHANGED
@@ -1,1215 +1,1215 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Scripts
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Delerte API
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* WPBD_Delete_API class
|
16 |
-
*
|
17 |
-
* @since 1.0.0
|
18 |
-
*/
|
19 |
-
class WPBD_Delete_API {
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Get things going
|
23 |
-
*
|
24 |
-
* @since 1.0.0
|
25 |
-
*/
|
26 |
-
public function __construct() { /* */ }
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Get posts Ids.
|
30 |
-
*
|
31 |
-
* @access public
|
32 |
-
* @since 1.0
|
33 |
-
* @param array $data Delete posts form data.
|
34 |
-
* @return array | Posts Id.
|
35 |
-
*/
|
36 |
-
public function get_delete_posts_ids( $data = array() ) {
|
37 |
-
if( wpbd_is_pro() && class_exists('WPBD_Delete_API_Pro', false) ){
|
38 |
-
$wpbdpro = new WPBD_Delete_API_Pro();
|
39 |
-
return $wpbdpro->get_delete_posts_ids( $data );
|
40 |
-
}
|
41 |
-
global $wpdb;
|
42 |
-
if( ! empty( $data['delete_post_type'] ) && ! empty( $data['delete_post_status'] ) ){
|
43 |
-
|
44 |
-
$post_types = isset( $data['delete_post_type'] ) ? $data['delete_post_type'] : array();
|
45 |
-
if( ! is_array( $post_types ) ){
|
46 |
-
$post_types = array( $post_types );
|
47 |
-
}
|
48 |
-
$post_types = array_map('esc_sql', $post_types );
|
49 |
-
|
50 |
-
$post_status = isset( $data['delete_post_status'] ) ? array_map('esc_sql', $data['delete_post_status'] ) : array();
|
51 |
-
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
52 |
-
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
53 |
-
$delete_authors = isset( $data['delete_authors'] ) ? array_map( 'intval', $data['delete_authors'] ) : array();
|
54 |
-
$delete_type = isset( $data['delete_type'] ) ? $data['delete_type'] : 'trash';
|
55 |
-
$limit_post = isset( $data['limit_post'] ) ? absint( $data['limit_post'] ) : '';
|
56 |
-
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
57 |
-
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
58 |
-
if( $date_type === 'older_than') {
|
59 |
-
$delete_start_date = $delete_end_date = '';
|
60 |
-
if( $input_days === "0" || $input_days > 0){
|
61 |
-
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
62 |
-
}
|
63 |
-
} else if( $date_type === 'within_last') {
|
64 |
-
$delete_start_date = $delete_end_date = '';
|
65 |
-
if( $input_days === "0" || $input_days > 0){
|
66 |
-
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
67 |
-
}
|
68 |
-
}
|
69 |
-
|
70 |
-
// BY Taxonomy.
|
71 |
-
$post_taxonomy = isset( $data['post_taxonomy'] ) ? esc_sql( $data['post_taxonomy'] ) : '';
|
72 |
-
$post_taxonomy_terms = isset( $data['post_taxonomy_terms'] ) ? array_map( 'intval', $data['post_taxonomy_terms'] ) : array();
|
73 |
-
|
74 |
-
if( empty( $post_types ) || empty( $post_status ) ){
|
75 |
-
return array();
|
76 |
-
}
|
77 |
-
|
78 |
-
// Query Generation.
|
79 |
-
$query = "SELECT DISTINCT $wpdb->posts.ID FROM $wpdb->posts ";
|
80 |
-
|
81 |
-
if( $post_taxonomy != '' && ! empty( $post_taxonomy_terms ) ) {
|
82 |
-
|
83 |
-
$query .= " LEFT JOIN $wpdb->term_relationships ON( $wpdb->posts.ID = $wpdb->term_relationships.object_id )";
|
84 |
-
$query .= " LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)";
|
85 |
-
$query .= " LEFT JOIN $wpdb->terms ON($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id)";
|
86 |
-
}
|
87 |
-
|
88 |
-
$query .= " WHERE $wpdb->posts.post_type IN ( '" . implode( "', '", $post_types ) . "' )";
|
89 |
-
|
90 |
-
if( $post_taxonomy != '' && ! empty( $post_taxonomy_terms ) ) {
|
91 |
-
$query .= " AND ( $wpdb->terms.term_id IN ( " . implode( ", ", $post_taxonomy_terms ). " )";
|
92 |
-
$query .= " AND $wpdb->term_taxonomy.taxonomy = '{$post_taxonomy}' )";
|
93 |
-
}
|
94 |
-
|
95 |
-
if( !empty( $post_status ) ){
|
96 |
-
$query .= " AND $wpdb->posts.post_status IN ( '" . implode( "', '", $post_status ) . "' )";
|
97 |
-
}
|
98 |
-
if( $delete_start_date != ''){
|
99 |
-
$query .= " AND $wpdb->posts.post_date >= '{$delete_start_date} 00:00:00'";
|
100 |
-
}
|
101 |
-
if( $delete_end_date != ''){
|
102 |
-
$query .= " AND $wpdb->posts.post_date <= '{$delete_end_date} 23:59:59'";
|
103 |
-
}
|
104 |
-
|
105 |
-
if( !empty( $delete_authors ) ){
|
106 |
-
$query .= " AND $wpdb->posts.post_author IN ( " . implode( ",", $delete_authors ). " )";
|
107 |
-
}
|
108 |
-
|
109 |
-
if( $limit_post != '' ){
|
110 |
-
if( is_numeric( $limit_post ) ){
|
111 |
-
$query .= " LIMIT " . $limit_post;
|
112 |
-
}
|
113 |
-
}
|
114 |
-
|
115 |
-
$posts = $wpdb->get_col( $query );
|
116 |
-
return $posts;
|
117 |
-
|
118 |
-
}else{
|
119 |
-
return array();
|
120 |
-
}
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
* Do Delete operation on posts.
|
125 |
-
*
|
126 |
-
* @access public
|
127 |
-
* @since 1.0
|
128 |
-
* @param array $data Posts Id.
|
129 |
-
* @return array | deleted posts count.
|
130 |
-
*/
|
131 |
-
public function do_delete_posts( $post_ids = array(), $force_delete = false ) {
|
132 |
-
$post_delete_count = 0;
|
133 |
-
|
134 |
-
if ( ! empty( $post_ids ) ){
|
135 |
-
|
136 |
-
foreach ($post_ids as $post_id ) {
|
137 |
-
wp_delete_post( $post_id, $force_delete );
|
138 |
-
}
|
139 |
-
$post_delete_count = count( $post_ids );
|
140 |
-
|
141 |
-
}
|
142 |
-
return $post_delete_count;
|
143 |
-
}
|
144 |
-
|
145 |
-
/**
|
146 |
-
* Get Post Count by Posttype
|
147 |
-
*
|
148 |
-
* @access public
|
149 |
-
* @since 1.0
|
150 |
-
* @param array $post_type Post type.
|
151 |
-
* @return int | posts count.
|
152 |
-
*/
|
153 |
-
public function get_post_count( $counttype = '' ) {
|
154 |
-
global $wpdb;
|
155 |
-
|
156 |
-
$count = 0;
|
157 |
-
|
158 |
-
switch( $counttype ) {
|
159 |
-
case 'revision':
|
160 |
-
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_type = %s", 'revision' ) );
|
161 |
-
break;
|
162 |
-
case 'auto_drafts':
|
163 |
-
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_status = %s", 'auto-draft' ) );
|
164 |
-
break;
|
165 |
-
case 'trash':
|
166 |
-
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_status = %s", 'trash' ) );
|
167 |
-
break;
|
168 |
-
case 'orphan_postmeta':
|
169 |
-
$count = $wpdb->get_var( "SELECT COUNT(meta_id) FROM $wpdb->postmeta WHERE post_id NOT IN (SELECT ID FROM $wpdb->posts)" );
|
170 |
-
break;
|
171 |
-
case 'orphan_commentmeta':
|
172 |
-
$count = $wpdb->get_var( "SELECT COUNT(meta_id) FROM $wpdb->commentmeta WHERE comment_id NOT IN (SELECT comment_ID FROM $wpdb->comments)" );
|
173 |
-
break;
|
174 |
-
case 'orphan_usermeta':
|
175 |
-
$count = $wpdb->get_var( "SELECT COUNT(umeta_id) FROM $wpdb->usermeta WHERE user_id NOT IN (SELECT ID FROM $wpdb->users)" );
|
176 |
-
break;
|
177 |
-
case 'orphan_termmeta':
|
178 |
-
$count = $wpdb->get_var( "SELECT COUNT(meta_id) FROM $wpdb->termmeta WHERE term_id NOT IN (SELECT term_id FROM $wpdb->terms)" );
|
179 |
-
break;
|
180 |
-
|
181 |
-
case 'duplicated_postmeta':
|
182 |
-
$query = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT(meta_id) AS count FROM $wpdb->postmeta GROUP BY post_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
183 |
-
if( is_array( $query ) ) {
|
184 |
-
$count = array_sum( array_map( 'intval', $query ) );
|
185 |
-
}
|
186 |
-
break;
|
187 |
-
case 'duplicated_commentmeta':
|
188 |
-
$query = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT(meta_id) AS count FROM $wpdb->commentmeta GROUP BY comment_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
189 |
-
if( is_array( $query ) ) {
|
190 |
-
$count = array_sum( array_map( 'intval', $query ) );
|
191 |
-
}
|
192 |
-
break;
|
193 |
-
case 'duplicated_usermeta':
|
194 |
-
$query = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT(umeta_id) AS count FROM $wpdb->usermeta GROUP BY user_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
195 |
-
if( is_array( $query ) ) {
|
196 |
-
$count = array_sum( array_map( 'intval', $query ) );
|
197 |
-
}
|
198 |
-
break;
|
199 |
-
case 'duplicated_termmeta':
|
200 |
-
$query = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT(meta_id) AS count FROM $wpdb->termmeta GROUP BY term_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
201 |
-
if( is_array( $query ) ) {
|
202 |
-
$count = array_sum( array_map( 'intval', $query ) );
|
203 |
-
}
|
204 |
-
break;
|
205 |
-
|
206 |
-
}
|
207 |
-
return $count;
|
208 |
-
}
|
209 |
-
|
210 |
-
/**
|
211 |
-
* Get Comment Count by status
|
212 |
-
*
|
213 |
-
* @access public
|
214 |
-
* @since 1.0
|
215 |
-
* @param array $status status
|
216 |
-
* @return int | posts count.
|
217 |
-
*/
|
218 |
-
public function get_comment_count( $status = '' ) {
|
219 |
-
global $wpdb;
|
220 |
-
|
221 |
-
$count = 0;
|
222 |
-
|
223 |
-
switch( $status ) {
|
224 |
-
|
225 |
-
case 'pending':
|
226 |
-
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = %s", '0' ) );
|
227 |
-
break;
|
228 |
-
|
229 |
-
case 'spam':
|
230 |
-
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = %s", 'spam' ) );
|
231 |
-
break;
|
232 |
-
|
233 |
-
case 'trash':
|
234 |
-
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE (comment_approved = %s OR comment_approved = %s)", 'trash', 'post-trashed' ) );
|
235 |
-
break;
|
236 |
-
|
237 |
-
case 'approved':
|
238 |
-
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = %s", '1' ) );
|
239 |
-
break;
|
240 |
-
|
241 |
-
default:
|
242 |
-
$count = 0;
|
243 |
-
break;
|
244 |
-
}
|
245 |
-
|
246 |
-
return $count;
|
247 |
-
}
|
248 |
-
|
249 |
-
|
250 |
-
/**
|
251 |
-
* Run Cleanup
|
252 |
-
*
|
253 |
-
* @access public
|
254 |
-
* @since 1.0
|
255 |
-
* @param array $cleanuptype Cleanup type.
|
256 |
-
* @return string | message.
|
257 |
-
*/
|
258 |
-
public function run_cleanup( $cleanuptype = '' ){
|
259 |
-
global $wpdb;
|
260 |
-
$message = '';
|
261 |
-
|
262 |
-
switch( $cleanuptype ) {
|
263 |
-
case 'revision':
|
264 |
-
$posts = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = %s", 'revision' ) );
|
265 |
-
if( $posts ) {
|
266 |
-
foreach ( $posts as $id ) {
|
267 |
-
wp_delete_post_revision( intval( $id ) );
|
268 |
-
}
|
269 |
-
|
270 |
-
$message = sprintf( __( '%s Revisions Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $posts ) ) );
|
271 |
-
}
|
272 |
-
break;
|
273 |
-
case 'auto_drafts':
|
274 |
-
$posts = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_status = %s", 'auto-draft' ) );
|
275 |
-
if( $posts ) {
|
276 |
-
foreach ( $posts as $id ) {
|
277 |
-
wp_delete_post( intval( $id ), true );
|
278 |
-
}
|
279 |
-
|
280 |
-
$message = sprintf( __( '%s Auto Drafts Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $posts ) ) );
|
281 |
-
}
|
282 |
-
break;
|
283 |
-
case 'trash':
|
284 |
-
$posts = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_status = %s", 'trash' ) );
|
285 |
-
if( $posts ) {
|
286 |
-
foreach ( $posts as $id ) {
|
287 |
-
wp_delete_post( $id, true );
|
288 |
-
}
|
289 |
-
|
290 |
-
$message = sprintf( __( '%s Trashed Posts Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $posts ) ) );
|
291 |
-
}
|
292 |
-
break;
|
293 |
-
|
294 |
-
case 'orphan_postmeta':
|
295 |
-
$query = $wpdb->get_results( "SELECT post_id, meta_key FROM $wpdb->postmeta WHERE post_id NOT IN (SELECT ID FROM $wpdb->posts)" );
|
296 |
-
if( $query ) {
|
297 |
-
foreach ( $query as $meta ) {
|
298 |
-
$post_id = intval( $meta->post_id );
|
299 |
-
if( $post_id === 0 ) {
|
300 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta->meta_key ) );
|
301 |
-
} else {
|
302 |
-
delete_post_meta( $post_id, $meta->meta_key );
|
303 |
-
}
|
304 |
-
}
|
305 |
-
|
306 |
-
$message = sprintf( __( '%s Orphaned Post Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
307 |
-
}
|
308 |
-
break;
|
309 |
-
case 'orphan_commentmeta':
|
310 |
-
$query = $wpdb->get_results( "SELECT comment_id, meta_key FROM $wpdb->commentmeta WHERE comment_id NOT IN (SELECT comment_ID FROM $wpdb->comments)" );
|
311 |
-
if( $query ) {
|
312 |
-
foreach ( $query as $meta ) {
|
313 |
-
$comment_id = intval( $meta->comment_id );
|
314 |
-
if( $comment_id === 0 ) {
|
315 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->commentmeta WHERE comment_id = %d AND meta_key = %s", $comment_id, $meta->meta_key ) );
|
316 |
-
} else {
|
317 |
-
delete_comment_meta( $comment_id, $meta->meta_key );
|
318 |
-
}
|
319 |
-
}
|
320 |
-
|
321 |
-
$message = sprintf( __( '%s Orphaned Comment Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
322 |
-
}
|
323 |
-
break;
|
324 |
-
case 'orphan_usermeta':
|
325 |
-
$query = $wpdb->get_results( "SELECT user_id, meta_key FROM $wpdb->usermeta WHERE user_id NOT IN (SELECT ID FROM $wpdb->users)" );
|
326 |
-
if( $query ) {
|
327 |
-
foreach ( $query as $meta ) {
|
328 |
-
$user_id = intval( $meta->user_id );
|
329 |
-
if( $user_id === 0 ) {
|
330 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta->meta_key ) );
|
331 |
-
} else {
|
332 |
-
delete_user_meta( $user_id, $meta->meta_key );
|
333 |
-
}
|
334 |
-
}
|
335 |
-
|
336 |
-
$message = sprintf( __( '%s Orphaned User Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
337 |
-
}
|
338 |
-
break;
|
339 |
-
case 'orphan_termmeta':
|
340 |
-
$query = $wpdb->get_results( "SELECT term_id, meta_key FROM $wpdb->termmeta WHERE term_id NOT IN (SELECT term_id FROM $wpdb->terms)" );
|
341 |
-
if( $query ) {
|
342 |
-
foreach ( $query as $meta ) {
|
343 |
-
$term_id = intval( $meta->term_id );
|
344 |
-
if( $term_id === 0 ) {
|
345 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->termmeta WHERE term_id = %d AND meta_key = %s", $term_id, $meta->meta_key ) );
|
346 |
-
} else {
|
347 |
-
delete_term_meta( $term_id, $meta->meta_key );
|
348 |
-
}
|
349 |
-
}
|
350 |
-
|
351 |
-
$message = sprintf( __( '%s Orphaned Term Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
352 |
-
}
|
353 |
-
break;
|
354 |
-
|
355 |
-
case 'duplicated_postmeta':
|
356 |
-
$query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, post_id, COUNT(*) AS count FROM $wpdb->postmeta GROUP BY post_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
357 |
-
if( $query ) {
|
358 |
-
foreach ( $query as $meta ) {
|
359 |
-
$ids = array_map( 'intval', explode( ',', $meta->ids ) );
|
360 |
-
array_pop( $ids );
|
361 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_id IN (" . implode( ',', $ids ) . ") AND post_id = %d", intval( $meta->post_id ) ) );
|
362 |
-
}
|
363 |
-
|
364 |
-
$message = sprintf( __( '%s Duplicated Post Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
365 |
-
}
|
366 |
-
break;
|
367 |
-
case 'duplicated_commentmeta':
|
368 |
-
$query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, comment_id, COUNT(*) AS count FROM $wpdb->commentmeta GROUP BY comment_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
369 |
-
if( $query ) {
|
370 |
-
foreach ( $query as $meta ) {
|
371 |
-
$ids = array_map( 'intval', explode( ',', $meta->ids ) );
|
372 |
-
array_pop( $ids );
|
373 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->commentmeta WHERE meta_id IN (" . implode( ',', $ids ) . ") AND comment_id = %d", intval( $meta->comment_id ) ) );
|
374 |
-
}
|
375 |
-
|
376 |
-
$message = sprintf( __( '%s Duplicated Comment Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
377 |
-
}
|
378 |
-
break;
|
379 |
-
case 'duplicated_usermeta':
|
380 |
-
$query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(umeta_id ORDER BY umeta_id DESC) AS ids, user_id, COUNT(*) AS count FROM $wpdb->usermeta GROUP BY user_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
381 |
-
if( $query ) {
|
382 |
-
foreach ( $query as $meta ) {
|
383 |
-
$ids = array_map( 'intval', explode( ',', $meta->ids ) );
|
384 |
-
array_pop( $ids );
|
385 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE umeta_id IN (" . implode( ',', $ids ) . ") AND user_id = %d", intval( $meta->user_id ) ) );
|
386 |
-
}
|
387 |
-
|
388 |
-
$message = sprintf( __( '%s Duplicated User Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
389 |
-
}
|
390 |
-
break;
|
391 |
-
case 'duplicated_termmeta':
|
392 |
-
$query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, term_id, COUNT(*) AS count FROM $wpdb->termmeta GROUP BY term_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
393 |
-
if( $query ) {
|
394 |
-
foreach ( $query as $meta ) {
|
395 |
-
$ids = array_map( 'intval', explode( ',', $meta->ids ) );
|
396 |
-
array_pop( $ids );
|
397 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->termmeta WHERE meta_id IN (" . implode( ',', $ids ) . ") AND term_id = %d", intval( $meta->term_id ) ) );
|
398 |
-
}
|
399 |
-
|
400 |
-
$message = sprintf( __( '%s Duplicated Term Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
401 |
-
}
|
402 |
-
break;
|
403 |
-
|
404 |
-
}
|
405 |
-
return $message;
|
406 |
-
}
|
407 |
-
|
408 |
-
/**
|
409 |
-
* Get Users Ids.
|
410 |
-
*
|
411 |
-
* @access public
|
412 |
-
* @since 1.0
|
413 |
-
* @param array $data Delete User form data.
|
414 |
-
* @return array | Users Id.
|
415 |
-
*/
|
416 |
-
public function get_delete_user_ids( $data = array() ){
|
417 |
-
global $wpdb;
|
418 |
-
|
419 |
-
if( empty( $data['delete_user_roles'] ) && ( $data['user_meta_key'] == '' || $data['user_meta_value'] == '' ) ){
|
420 |
-
return array();
|
421 |
-
}
|
422 |
-
$delete_user_roles = isset( $data['delete_user_roles'] ) ? $data['delete_user_roles'] : array();
|
423 |
-
$delete_user_roles = array_map('esc_sql', $delete_user_roles );
|
424 |
-
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
425 |
-
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
426 |
-
$limit_user = isset( $data['limit_user'] ) ? absint( $data['limit_user'] ) : '';
|
427 |
-
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
428 |
-
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
429 |
-
if( $date_type === 'older_than') {
|
430 |
-
$delete_start_date = $delete_end_date = '';
|
431 |
-
if( $input_days === "0" || $input_days > 0){
|
432 |
-
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
433 |
-
}
|
434 |
-
} else if( $date_type === 'within_last') {
|
435 |
-
$delete_start_date = $delete_end_date = '';
|
436 |
-
if( $input_days === "0" || $input_days > 0){
|
437 |
-
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
438 |
-
}
|
439 |
-
}
|
440 |
-
|
441 |
-
// By Usermeta.
|
442 |
-
$user_meta_key = isset( $data['user_meta_key'] ) ? esc_sql( $data['user_meta_key'] ) : '';
|
443 |
-
$user_meta_value = isset( $data['user_meta_value'] ) ? esc_sql( $data['user_meta_value'] ) : '';
|
444 |
-
$user_meta_compare = isset( $data['user_meta_compare'] ) ? $data['user_meta_compare'] : 'equal_to_str';
|
445 |
-
|
446 |
-
// Query Generation.
|
447 |
-
$query = "SELECT DISTINCT $wpdb->users.ID FROM $wpdb->users ";
|
448 |
-
|
449 |
-
if ( $user_meta_key != '' && $user_meta_compare != '' && $user_meta_value != '' ) {
|
450 |
-
$query .= " INNER JOIN $wpdb->usermeta ON( $wpdb->users.ID = $wpdb->usermeta.user_id )";
|
451 |
-
}
|
452 |
-
|
453 |
-
if( !empty( $delete_user_roles ) ){
|
454 |
-
$query .= " INNER JOIN $wpdb->usermeta AS mt_roles ON ( $wpdb->users.ID = mt_roles.user_id )";
|
455 |
-
}
|
456 |
-
|
457 |
-
$query .= ' WHERE 1=1 ';
|
458 |
-
|
459 |
-
if ( $user_meta_key != '' && $user_meta_compare != '' && $user_meta_value != '' ) {
|
460 |
-
$query .= " AND ( $wpdb->usermeta.meta_key = '" . $user_meta_key. "'";
|
461 |
-
switch ( $user_meta_compare ) {
|
462 |
-
case 'equal_to_str':
|
463 |
-
$query .= " AND $wpdb->usermeta.meta_value = '{$user_meta_value}' )";
|
464 |
-
break;
|
465 |
-
|
466 |
-
case 'notequal_to_str':
|
467 |
-
$query .= " AND $wpdb->usermeta.meta_value != '{$user_meta_value}' )";
|
468 |
-
break;
|
469 |
-
|
470 |
-
case 'like_str':
|
471 |
-
$query .= " AND $wpdb->usermeta.meta_value LIKE '%{$user_meta_value}%' )";
|
472 |
-
break;
|
473 |
-
|
474 |
-
case 'notlike_str':
|
475 |
-
$query .= " AND $wpdb->usermeta.meta_value NOT LIKE '%{$user_meta_value}%' )";
|
476 |
-
break;
|
477 |
-
|
478 |
-
case 'equal_to_date':
|
479 |
-
$query .= " AND CAST($wpdb->usermeta.meta_value AS DATE) = '{$user_meta_value}' )";
|
480 |
-
break;
|
481 |
-
|
482 |
-
case 'notequal_to_date':
|
483 |
-
$query .= " AND CAST($wpdb->usermeta.meta_value AS DATE) != '{$user_meta_value}' )";
|
484 |
-
break;
|
485 |
-
|
486 |
-
case 'lessthen_date':
|
487 |
-
$query .= " AND CAST($wpdb->usermeta.meta_value AS DATE) < '{$user_meta_value}' )";
|
488 |
-
break;
|
489 |
-
|
490 |
-
case 'lessthenequal_date':
|
491 |
-
$query .= " AND CAST($wpdb->usermeta.meta_value AS DATE) <= '{$user_meta_value}' )";
|
492 |
-
break;
|
493 |
-
|
494 |
-
case 'greaterthen_date':
|
495 |
-
$query .= " AND CAST($wpdb->usermeta.meta_value AS DATE) > '{$user_meta_value}' )";
|
496 |
-
break;
|
497 |
-
|
498 |
-
case 'greaterthenequal_date':
|
499 |
-
$query .= " AND CAST($wpdb->usermeta.meta_value AS DATE) >= '{$user_meta_value}' )";
|
500 |
-
break;
|
501 |
-
|
502 |
-
case 'equal_to_number':
|
503 |
-
$query .= " AND CAST($wpdb->usermeta.meta_value AS SIGNED) = '{$user_meta_value}' )";
|
504 |
-
break;
|
505 |
-
|
506 |
-
case 'notequal_to_number':
|
507 |
-
$query .= " AND CAST($wpdb->usermeta.meta_value AS SIGNED) != '{$user_meta_value}' )";
|
508 |
-
break;
|
509 |
-
|
510 |
-
case 'lessthen_number':
|
511 |
-
$query .= " AND CAST($wpdb->usermeta.meta_value AS SIGNED) < '{$user_meta_value}' )";
|
512 |
-
break;
|
513 |
-
|
514 |
-
case 'lessthenequal_number':
|
515 |
-
$query .= " AND CAST($wpdb->usermeta.meta_value AS SIGNED) <= '{$user_meta_value}' )";
|
516 |
-
break;
|
517 |
-
|
518 |
-
case 'greaterthen_number':
|
519 |
-
$query .= " AND CAST($wpdb->usermeta.meta_value AS SIGNED) > '{$user_meta_value}' )";
|
520 |
-
break;
|
521 |
-
|
522 |
-
case 'greaterthenequal_number':
|
523 |
-
$query .= " AND CAST($wpdb->usermeta.meta_value AS SIGNED) >= '{$user_meta_value}' )";
|
524 |
-
break;
|
525 |
-
|
526 |
-
default:
|
527 |
-
$query .= " AND $wpdb->usermeta.meta_value = '{$user_meta_value}' )";
|
528 |
-
break;
|
529 |
-
}
|
530 |
-
}
|
531 |
-
|
532 |
-
if( !empty( $delete_user_roles ) ){
|
533 |
-
$subquery = array();
|
534 |
-
foreach ($delete_user_roles as $delete_user_role ) {
|
535 |
-
$subquery[] = "( mt_roles.meta_key = '{$wpdb->prefix}capabilities' AND mt_roles.meta_value LIKE '%".'\"'.$delete_user_role.'\"%'."' )";
|
536 |
-
}
|
537 |
-
$subquery = implode( ' OR ', $subquery );
|
538 |
-
$query .= " AND ( {$subquery} )";
|
539 |
-
}
|
540 |
-
|
541 |
-
if( $delete_start_date != ''){
|
542 |
-
$query .= " AND ( $wpdb->users.user_registered >= '{$delete_start_date} 00:00:00' )";
|
543 |
-
}
|
544 |
-
if( $delete_end_date != ''){
|
545 |
-
$query .= " AND ( $wpdb->users.user_registered <= '{$delete_end_date} 23:59:59' )";
|
546 |
-
}
|
547 |
-
|
548 |
-
$query .= " AND $wpdb->users.ID NOT IN ( ".get_current_user_id()." )";
|
549 |
-
|
550 |
-
if( $limit_user != '' ){
|
551 |
-
if( is_numeric( $limit_user ) ){
|
552 |
-
$query .= " ORDER BY $wpdb->users.user_login ASC LIMIT " . $limit_user;
|
553 |
-
}
|
554 |
-
}
|
555 |
-
$users = $wpdb->get_col( $query );
|
556 |
-
return $users;
|
557 |
-
}
|
558 |
-
|
559 |
-
/**
|
560 |
-
* Do Delete operation on users.
|
561 |
-
*
|
562 |
-
* @access public
|
563 |
-
* @since 1.0
|
564 |
-
* @param array $data Posts Id.
|
565 |
-
* @return array | deleted posts count.
|
566 |
-
*/
|
567 |
-
public function do_delete_users( $user_ids = array(), $reassign_user = '') {
|
568 |
-
$user_delete_count = 0;
|
569 |
-
require_once(ABSPATH.'wp-admin/includes/user.php' );
|
570 |
-
$current_user = wp_get_current_user();
|
571 |
-
$user_ids = array_diff( $user_ids, array( $current_user->ID ) );
|
572 |
-
if ( ! empty( $user_ids ) ){
|
573 |
-
foreach ($user_ids as $user_id ) {
|
574 |
-
if( $reassign_user != '' && $reassign_user > 0 ){
|
575 |
-
wp_delete_user( $user_id , $reassign_user );
|
576 |
-
}else{
|
577 |
-
wp_delete_user( $user_id );
|
578 |
-
}
|
579 |
-
|
580 |
-
}
|
581 |
-
$user_delete_count = count( $user_ids );
|
582 |
-
|
583 |
-
}
|
584 |
-
return $user_delete_count;
|
585 |
-
}
|
586 |
-
|
587 |
-
/**
|
588 |
-
* Get Comment count to be deleted.
|
589 |
-
*
|
590 |
-
* @access public
|
591 |
-
* @since 1.1.0
|
592 |
-
* @param array $data Delete comment form data.
|
593 |
-
* @return comment count.
|
594 |
-
*/
|
595 |
-
public function get_delete_comment_count( $data = array() ){
|
596 |
-
if( wpbd_is_pro() && class_exists('WPBD_Delete_API_Pro', false) ){
|
597 |
-
$wpbdpro = new WPBD_Delete_API_Pro();
|
598 |
-
return $wpbdpro->get_delete_comment_count( $data );
|
599 |
-
}
|
600 |
-
global $wpdb;
|
601 |
-
$comment_delete_count = 0;
|
602 |
-
$delete_comment_status = isset( $data['delete_comment_status'] ) ? $data['delete_comment_status'] : array();
|
603 |
-
$delete_comment_status = array_map('esc_sql', $delete_comment_status );
|
604 |
-
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
605 |
-
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
606 |
-
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
607 |
-
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
608 |
-
if( $date_type === 'older_than') {
|
609 |
-
$delete_start_date = $delete_end_date = '';
|
610 |
-
if( $input_days === "0" || $input_days > 0){
|
611 |
-
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
612 |
-
}
|
613 |
-
} else if( $date_type === 'within_last') {
|
614 |
-
$delete_start_date = $delete_end_date = '';
|
615 |
-
if( $input_days === "0" || $input_days > 0){
|
616 |
-
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
617 |
-
}
|
618 |
-
}
|
619 |
-
|
620 |
-
if ( ! empty( $data ) ){
|
621 |
-
|
622 |
-
$temp_delete_query = array();
|
623 |
-
|
624 |
-
if( ! empty( $delete_comment_status ) ){
|
625 |
-
foreach ( $delete_comment_status as $comment_status ) {
|
626 |
-
|
627 |
-
switch( $comment_status ) {
|
628 |
-
case 'pending':
|
629 |
-
$temp_delete_query[] = "comment_approved = '0'";
|
630 |
-
break;
|
631 |
-
|
632 |
-
case 'spam':
|
633 |
-
$temp_delete_query[] = "comment_approved = 'spam'";
|
634 |
-
break;
|
635 |
-
|
636 |
-
case 'trash':
|
637 |
-
$temp_delete_query[] = "comment_approved = 'trash' OR comment_approved = 'post-trashed'";
|
638 |
-
break;
|
639 |
-
|
640 |
-
case 'approved':
|
641 |
-
$temp_delete_query[] = "comment_approved = '1'";
|
642 |
-
break;
|
643 |
-
}
|
644 |
-
|
645 |
-
}
|
646 |
-
if( !empty( $temp_delete_query ) ) {
|
647 |
-
$delete_comment_query = "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE 1=1";
|
648 |
-
$delete_comment_query .= " AND (" . implode( " OR ", $temp_delete_query ) . ")";
|
649 |
-
}
|
650 |
-
}
|
651 |
-
|
652 |
-
if( $delete_start_date != ''){
|
653 |
-
$delete_comment_query .= " AND ( comment_date >= '{$delete_start_date} 00:00:00' )";
|
654 |
-
}
|
655 |
-
if( $delete_end_date != ''){
|
656 |
-
$delete_comment_query .= " AND ( comment_date <= '{$delete_end_date} 23:59:59' )";
|
657 |
-
}
|
658 |
-
$comment_delete_count = $wpdb->get_var( $delete_comment_query );
|
659 |
-
}
|
660 |
-
return $comment_delete_count;
|
661 |
-
}
|
662 |
-
|
663 |
-
/**
|
664 |
-
* Do Delete operation on comments.
|
665 |
-
*
|
666 |
-
* @access public
|
667 |
-
* @since 1.1.0
|
668 |
-
* @param array $data $_POST.
|
669 |
-
* @return deleted comments count.
|
670 |
-
*/
|
671 |
-
public function do_delete_comments( $data = array() ) {
|
672 |
-
global $wpdb;
|
673 |
-
if( wpbd_is_pro() && class_exists('WPBD_Delete_API_Pro', false) ){
|
674 |
-
$wpbdpro = new WPBD_Delete_API_Pro();
|
675 |
-
return $wpbdpro->do_delete_comments( $data );
|
676 |
-
}
|
677 |
-
|
678 |
-
$comment_delete_count = 0;
|
679 |
-
$delete_comment_status = isset( $data['delete_comment_status'] ) ? $data['delete_comment_status'] : array();
|
680 |
-
$delete_comment_status = array_map('esc_sql', $delete_comment_status );
|
681 |
-
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
682 |
-
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
683 |
-
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
684 |
-
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
685 |
-
if( $date_type === 'older_than') {
|
686 |
-
$delete_start_date = $delete_end_date = '';
|
687 |
-
if( $input_days === "0" || $input_days > 0){
|
688 |
-
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
689 |
-
}
|
690 |
-
} else if( $date_type === 'within_last') {
|
691 |
-
$delete_start_date = $delete_end_date = '';
|
692 |
-
if( $input_days === "0" || $input_days > 0){
|
693 |
-
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
694 |
-
}
|
695 |
-
}
|
696 |
-
|
697 |
-
if ( ! empty( $data ) ){
|
698 |
-
|
699 |
-
$temp_delete_query = array();
|
700 |
-
|
701 |
-
if( ! empty( $delete_comment_status ) ){
|
702 |
-
foreach ( $delete_comment_status as $comment_status ) {
|
703 |
-
|
704 |
-
switch( $comment_status ) {
|
705 |
-
case 'pending':
|
706 |
-
$temp_delete_query[] = "comment_approved = '0'";
|
707 |
-
break;
|
708 |
-
|
709 |
-
case 'spam':
|
710 |
-
$temp_delete_query[] = "comment_approved = 'spam'";
|
711 |
-
break;
|
712 |
-
|
713 |
-
case 'trash':
|
714 |
-
$temp_delete_query[] = "comment_approved = 'trash' OR comment_approved = 'post-trashed'";
|
715 |
-
break;
|
716 |
-
break;
|
717 |
-
|
718 |
-
case 'approved':
|
719 |
-
$temp_delete_query[] = "comment_approved = '1'";
|
720 |
-
break;
|
721 |
-
}
|
722 |
-
|
723 |
-
}
|
724 |
-
if( !empty( $temp_delete_query ) ) {
|
725 |
-
$delete_comment_query = "DELETE FROM $wpdb->comments WHERE 1=1";
|
726 |
-
$delete_comment_query .= " AND (" . implode( " OR ", $temp_delete_query ) . ")";
|
727 |
-
}
|
728 |
-
}
|
729 |
-
|
730 |
-
if( $delete_start_date != ''){
|
731 |
-
$delete_comment_query .= " AND ( comment_date >= '{$delete_start_date} 00:00:00' )";
|
732 |
-
}
|
733 |
-
if( $delete_end_date != ''){
|
734 |
-
$delete_comment_query .= " AND ( comment_date <= '{$delete_end_date} 23:59:59' )";
|
735 |
-
}
|
736 |
-
$comment_delete_count = $wpdb->query( $delete_comment_query );
|
737 |
-
}
|
738 |
-
return $comment_delete_count;
|
739 |
-
}
|
740 |
-
|
741 |
-
/**
|
742 |
-
* Get postmeta Ids.
|
743 |
-
*
|
744 |
-
* @access public
|
745 |
-
* @since 1.1.0
|
746 |
-
* @param array $data Delete postmeta form data.
|
747 |
-
* @return array | Posts Id.
|
748 |
-
*/
|
749 |
-
public function get_delete_postmeta_ids( $data = array() ) {
|
750 |
-
global $wpdb;
|
751 |
-
if( wpbd_is_pro() && class_exists('WPBD_Delete_API_Pro', false) ){
|
752 |
-
$wpbdpro = new WPBD_Delete_API_Pro();
|
753 |
-
return $wpbdpro->get_delete_postmeta_ids( $data );
|
754 |
-
}
|
755 |
-
if( ! empty( $data['meta_post_type'] ) && ! empty( $data['custom_field_key'] ) ){
|
756 |
-
|
757 |
-
$post_type = isset( $data['meta_post_type'] ) ? esc_sql( $data['meta_post_type'] ) : '';
|
758 |
-
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
759 |
-
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
760 |
-
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
761 |
-
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
762 |
-
if( $date_type === 'older_than') {
|
763 |
-
$delete_start_date = $delete_end_date = '';
|
764 |
-
if( $input_days === "0" || $input_days > 0){
|
765 |
-
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
766 |
-
}
|
767 |
-
} else if( $date_type === 'within_last') {
|
768 |
-
$delete_start_date = $delete_end_date = '';
|
769 |
-
if( $input_days === "0" || $input_days > 0){
|
770 |
-
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
771 |
-
}
|
772 |
-
}
|
773 |
-
|
774 |
-
// Post Query Generation.
|
775 |
-
$postquery = "SELECT DISTINCT $wpdb->posts.ID FROM $wpdb->posts ";
|
776 |
-
|
777 |
-
$postquery .= " WHERE $wpdb->posts.post_type = '" . $post_type . "'";
|
778 |
-
|
779 |
-
if( $delete_start_date != ''){
|
780 |
-
$postquery .= " AND ( $wpdb->posts.post_date >= '{$delete_start_date} 00:00:00' )";
|
781 |
-
}
|
782 |
-
if( $delete_end_date != ''){
|
783 |
-
$postquery .= " AND ( $wpdb->posts.post_date <= '{$delete_end_date} 23:59:59' )";
|
784 |
-
}
|
785 |
-
|
786 |
-
$metaQuery = $metaWhere = "";
|
787 |
-
$metaWhere = $this->get_meta_where( $data );
|
788 |
-
|
789 |
-
if( $metaWhere != '' ){
|
790 |
-
$metaQuery = "SELECT post_id, meta_key FROM $wpdb->postmeta WHERE post_id IN ( {$postquery} ) AND ( {$metaWhere} )";
|
791 |
-
}else{
|
792 |
-
return array();
|
793 |
-
}
|
794 |
-
|
795 |
-
if( $metaQuery == '' ){
|
796 |
-
return array();
|
797 |
-
}
|
798 |
-
$meta_results = $wpdb->get_results( $metaQuery );
|
799 |
-
return $meta_results;
|
800 |
-
}else{
|
801 |
-
return array();
|
802 |
-
}
|
803 |
-
}
|
804 |
-
|
805 |
-
/**
|
806 |
-
* Do Delete operation on postmetas.
|
807 |
-
*
|
808 |
-
* @access public
|
809 |
-
* @since 1.1.0
|
810 |
-
* @param array $data Postmeta results
|
811 |
-
* @return array | deleted postmetas count.
|
812 |
-
*/
|
813 |
-
public function do_delete_postmetas( $meta_results = array() ) {
|
814 |
-
$post_delete_count = 0;
|
815 |
-
|
816 |
-
if ( ! empty( $meta_results ) ){
|
817 |
-
|
818 |
-
foreach ($meta_results as $meta ) {
|
819 |
-
$post_id = intval( $meta->post_id );
|
820 |
-
if( $post_id === 0 ) {
|
821 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta->meta_key ) );
|
822 |
-
} else {
|
823 |
-
delete_post_meta( $post_id, $meta->meta_key );
|
824 |
-
}
|
825 |
-
}
|
826 |
-
$post_delete_count = number_format_i18n( sizeof( $meta_results ) );
|
827 |
-
|
828 |
-
}
|
829 |
-
return $post_delete_count;
|
830 |
-
}
|
831 |
-
|
832 |
-
/**
|
833 |
-
* Get commentmeta Ids.
|
834 |
-
*
|
835 |
-
* @access public
|
836 |
-
* @since 1.1.0
|
837 |
-
* @param array $data Delete commentmeta form data.
|
838 |
-
* @return array | Meta results.
|
839 |
-
*/
|
840 |
-
public function get_delete_commentmeta_ids( $data = array() ) {
|
841 |
-
global $wpdb;
|
842 |
-
if( $data['custom_field_key'] != '' ){
|
843 |
-
|
844 |
-
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
845 |
-
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
846 |
-
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
847 |
-
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
848 |
-
if( $date_type === 'older_than') {
|
849 |
-
$delete_start_date = $delete_end_date = '';
|
850 |
-
if( $input_days === "0" || $input_days > 0){
|
851 |
-
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
852 |
-
}
|
853 |
-
} else if( $date_type === 'within_last') {
|
854 |
-
$delete_start_date = $delete_end_date = '';
|
855 |
-
if( $input_days === "0" || $input_days > 0){
|
856 |
-
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
857 |
-
}
|
858 |
-
}
|
859 |
-
|
860 |
-
// Post Query Generation.
|
861 |
-
$commentquery = "SELECT DISTINCT $wpdb->comments.comment_ID FROM $wpdb->comments WHERE 1 = 1";
|
862 |
-
|
863 |
-
if( $delete_start_date != ''){
|
864 |
-
$commentquery .= " AND ( $wpdb->comments.comment_date >= '{$delete_start_date} 00:00:00' )";
|
865 |
-
}
|
866 |
-
if( $delete_end_date != ''){
|
867 |
-
$commentquery .= " AND ( $wpdb->comments.comment_date <= '{$delete_end_date} 23:59:59' )";
|
868 |
-
}
|
869 |
-
|
870 |
-
$metaQuery = $metaWhere = "";
|
871 |
-
$metaWhere = $this->get_meta_where( $data );
|
872 |
-
|
873 |
-
if( $metaWhere != '' ){
|
874 |
-
$metaQuery = "SELECT comment_id, meta_key FROM $wpdb->commentmeta WHERE comment_id IN ( {$commentquery} ) AND ( {$metaWhere} )";
|
875 |
-
}else{
|
876 |
-
return array();
|
877 |
-
}
|
878 |
-
|
879 |
-
if( $metaQuery == '' ){
|
880 |
-
return array();
|
881 |
-
}
|
882 |
-
$meta_results = $wpdb->get_results( $metaQuery );
|
883 |
-
return $meta_results;
|
884 |
-
}else{
|
885 |
-
return array();
|
886 |
-
}
|
887 |
-
}
|
888 |
-
|
889 |
-
/**
|
890 |
-
* Do Delete operation on commentmetas.
|
891 |
-
*
|
892 |
-
* @access public
|
893 |
-
* @since 1.1.0
|
894 |
-
* @param array $data commentmeta results
|
895 |
-
* @return array | deleted commentmeta count.
|
896 |
-
*/
|
897 |
-
public function do_delete_commentmetas( $meta_results = array() ) {
|
898 |
-
$post_delete_count = 0;
|
899 |
-
|
900 |
-
if ( ! empty( $meta_results ) ){
|
901 |
-
|
902 |
-
foreach ($meta_results as $meta ) {
|
903 |
-
$comment_id = intval( $meta->comment_id );
|
904 |
-
if( $comment_id === 0 ) {
|
905 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->commentmeta WHERE comment_id = %d AND meta_key = %s", $comment_id, $meta->meta_key ) );
|
906 |
-
} else {
|
907 |
-
delete_comment_meta( $comment_id, $meta->meta_key );
|
908 |
-
}
|
909 |
-
}
|
910 |
-
$post_delete_count = number_format_i18n( sizeof( $meta_results ) );
|
911 |
-
|
912 |
-
}
|
913 |
-
return $post_delete_count;
|
914 |
-
}
|
915 |
-
|
916 |
-
/**
|
917 |
-
* Get usermeta Ids.
|
918 |
-
*
|
919 |
-
* @access public
|
920 |
-
* @since 1.1.0
|
921 |
-
* @param array $data Delete usermeta form data.
|
922 |
-
* @return array | Meta results.
|
923 |
-
*/
|
924 |
-
public function get_delete_usermeta_ids( $data = array() ) {
|
925 |
-
global $wpdb;
|
926 |
-
if( $data['custom_field_key'] != '' && !empty( $data['delete_user_roles'] ) ){
|
927 |
-
|
928 |
-
$delete_user_roles = isset( $data['delete_user_roles'] ) ? $data['delete_user_roles'] : array();
|
929 |
-
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
930 |
-
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
931 |
-
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
932 |
-
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
933 |
-
if( $date_type === 'older_than') {
|
934 |
-
$delete_start_date = $delete_end_date = '';
|
935 |
-
if( $input_days === "0" || $input_days > 0){
|
936 |
-
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
937 |
-
}
|
938 |
-
} else if( $date_type === 'within_last') {
|
939 |
-
$delete_start_date = $delete_end_date = '';
|
940 |
-
if( $input_days === "0" || $input_days > 0){
|
941 |
-
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
942 |
-
}
|
943 |
-
}
|
944 |
-
|
945 |
-
$userquery = "SELECT DISTINCT $wpdb->users.ID FROM $wpdb->users ";
|
946 |
-
|
947 |
-
if( !empty( $delete_user_roles ) ){
|
948 |
-
$i = 1;
|
949 |
-
foreach ($delete_user_roles as $delete_user_role ) {
|
950 |
-
$userquery .= " INNER JOIN $wpdb->usermeta AS mt{$i} ON ( $wpdb->users.ID = mt{$i}.user_id )";
|
951 |
-
$i++;
|
952 |
-
}
|
953 |
-
}
|
954 |
-
$userquery .= " WHERE 1 = 1";
|
955 |
-
if( !empty( $delete_user_roles ) ){
|
956 |
-
$j = 1;
|
957 |
-
$subquery = array();
|
958 |
-
foreach ($delete_user_roles as $delete_user_role ) {
|
959 |
-
$subquery[]= "( mt{$j}.meta_key = '{$wpdb->prefix}capabilities' AND mt{$j}.meta_value LIKE '%\"{$delete_user_role}\"%' )";
|
960 |
-
$j++;
|
961 |
-
}
|
962 |
-
$subquery = implode( ' OR ', $subquery );
|
963 |
-
$userquery .= " AND ( {$subquery} )";
|
964 |
-
}
|
965 |
-
|
966 |
-
// User Query Generation.
|
967 |
-
if( $delete_start_date != '' || $delete_end_date != '' ){
|
968 |
-
|
969 |
-
if( $delete_start_date != '' ){
|
970 |
-
$userquery .= " AND ( $wpdb->users.user_registered >= '{$delete_start_date} 00:00:00' )";
|
971 |
-
}
|
972 |
-
if( $delete_end_date != '' ){
|
973 |
-
$userquery .= " AND ( $wpdb->users.user_registered <= '{$delete_end_date} 23:59:59' )";
|
974 |
-
}
|
975 |
-
}
|
976 |
-
|
977 |
-
$metaQuery = $metaWhere = "";
|
978 |
-
$metaWhere = $this->get_meta_where( $data );
|
979 |
-
|
980 |
-
if( $metaWhere != '' ){
|
981 |
-
$metaQuery = "SELECT user_id, meta_key FROM $wpdb->usermeta WHERE user_id IN ( {$userquery} ) AND ( {$metaWhere} )";
|
982 |
-
|
983 |
-
}else{
|
984 |
-
return array();
|
985 |
-
}
|
986 |
-
|
987 |
-
if( $metaQuery == '' ){
|
988 |
-
return array();
|
989 |
-
}
|
990 |
-
$meta_results = $wpdb->get_results( $metaQuery );
|
991 |
-
return $meta_results;
|
992 |
-
|
993 |
-
}else{
|
994 |
-
return array();
|
995 |
-
}
|
996 |
-
}
|
997 |
-
|
998 |
-
/**
|
999 |
-
* Do Delete operation on usermetas.
|
1000 |
-
*
|
1001 |
-
* @access public
|
1002 |
-
* @since 1.1.0
|
1003 |
-
* @param array $data usermeta results
|
1004 |
-
* @return array | deleted usermeta count.
|
1005 |
-
*/
|
1006 |
-
public function do_delete_usermetas( $meta_results = array() ) {
|
1007 |
-
$usermeta_delete_count = 0;
|
1008 |
-
if ( ! empty( $meta_results ) ){
|
1009 |
-
|
1010 |
-
foreach ($meta_results as $meta ) {
|
1011 |
-
$user_id = intval( $meta->user_id );
|
1012 |
-
if( $user_id === 0 ) {
|
1013 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta->meta_key ) );
|
1014 |
-
} else {
|
1015 |
-
delete_user_meta( $user_id, $meta->meta_key );
|
1016 |
-
}
|
1017 |
-
}
|
1018 |
-
$usermeta_delete_count = number_format_i18n( sizeof( $meta_results ) );
|
1019 |
-
|
1020 |
-
}
|
1021 |
-
return $usermeta_delete_count;
|
1022 |
-
}
|
1023 |
-
|
1024 |
-
/**
|
1025 |
-
* Get delete Term count.
|
1026 |
-
*
|
1027 |
-
* @access public
|
1028 |
-
* @since 1.1.0
|
1029 |
-
* @param array $data Delete terms form data.
|
1030 |
-
* @return int | Term count.
|
1031 |
-
*/
|
1032 |
-
public function get_delete_term_count( $data = array() ){
|
1033 |
-
|
1034 |
-
if( $data['delete_post_type'] == '' && $data['post_taxonomy'] == '' ){
|
1035 |
-
return 0;
|
1036 |
-
}
|
1037 |
-
|
1038 |
-
return $numTerms = wp_count_terms( $data['post_taxonomy'], array( 'hide_empty'=> false ) );
|
1039 |
-
|
1040 |
-
}
|
1041 |
-
|
1042 |
-
/**
|
1043 |
-
* Do Delete operation on taxonomy terms.
|
1044 |
-
*
|
1045 |
-
* @access public
|
1046 |
-
* @since 1.1.0
|
1047 |
-
* @param array $data Delete terms form data.
|
1048 |
-
* @return array | deleted terms count.
|
1049 |
-
*/
|
1050 |
-
public function do_delete_terms( $data = array() ) {
|
1051 |
-
$terms_delete_count = 0;
|
1052 |
-
if ( ! empty( $data ) ){
|
1053 |
-
|
1054 |
-
if( $data['delete_post_type'] == '' || $data['post_taxonomy'] == '' ){
|
1055 |
-
return $terms_delete_count;
|
1056 |
-
}
|
1057 |
-
|
1058 |
-
$terms = get_terms( $data['post_taxonomy'], array( 'fields' => 'ids', 'hide_empty' => false ) );
|
1059 |
-
foreach ( $terms as $value ) {
|
1060 |
-
wp_delete_term( $value, $data['post_taxonomy'] );
|
1061 |
-
}
|
1062 |
-
$terms_delete_count = number_format_i18n( sizeof( $terms ) );
|
1063 |
-
}
|
1064 |
-
return $terms_delete_count;
|
1065 |
-
}
|
1066 |
-
|
1067 |
-
/**
|
1068 |
-
* Generate WHERE condition for meta delete.
|
1069 |
-
*
|
1070 |
-
* @access public
|
1071 |
-
* @since 1.1.0
|
1072 |
-
* @param array $data Delete form data.
|
1073 |
-
* @return string | WHERE Condition for query.
|
1074 |
-
*/
|
1075 |
-
function get_meta_where( $data ){
|
1076 |
-
// Costomfields
|
1077 |
-
$custom_field_key = ( $data['custom_field_key'] ) ? esc_sql( $data['custom_field_key'] ) : '';
|
1078 |
-
$custom_field_value = ( $data['custom_field_value'] ) ? esc_sql( $data['custom_field_value'] ) : '';
|
1079 |
-
$custom_field_compare = ( $data['custom_field_compare'] ) ? $data['custom_field_compare'] : 'equal_to_str';
|
1080 |
-
$metaWhere = '';
|
1081 |
-
|
1082 |
-
if ( $custom_field_key != '' ) {
|
1083 |
-
$metaWhere .= "( meta_key = '" . $custom_field_key. "'";
|
1084 |
-
|
1085 |
-
if( $custom_field_compare != '' && $custom_field_value != '' ){
|
1086 |
-
switch ( $custom_field_compare ) {
|
1087 |
-
case 'equal_to_str':
|
1088 |
-
$metaWhere .= " AND meta_value = '{$custom_field_value}' )";
|
1089 |
-
break;
|
1090 |
-
|
1091 |
-
case 'notequal_to_str':
|
1092 |
-
$metaWhere .= " AND meta_value != '{$custom_field_value}' )";
|
1093 |
-
break;
|
1094 |
-
|
1095 |
-
case 'like_str':
|
1096 |
-
$metaWhere .= " AND meta_value LIKE '%{$custom_field_value}%' )";
|
1097 |
-
break;
|
1098 |
-
|
1099 |
-
case 'notlike_str':
|
1100 |
-
$metaWhere .= " AND meta_value NOT LIKE '%{$custom_field_value}%' )";
|
1101 |
-
break;
|
1102 |
-
|
1103 |
-
case 'equal_to_date':
|
1104 |
-
$metaWhere .= " AND CAST(meta_value AS DATE) = '{$custom_field_value}' )";
|
1105 |
-
break;
|
1106 |
-
|
1107 |
-
case 'notequal_to_date':
|
1108 |
-
$metaWhere .= " AND CAST(meta_value AS DATE) != '{$custom_field_value}' )";
|
1109 |
-
break;
|
1110 |
-
|
1111 |
-
case 'lessthen_date':
|
1112 |
-
$metaWhere .= " AND CAST(meta_value AS DATE) < '{$custom_field_value}' )";
|
1113 |
-
break;
|
1114 |
-
|
1115 |
-
case 'lessthenequal_date':
|
1116 |
-
$metaWhere .= " AND CAST(meta_value AS DATE) <= '{$custom_field_value}' )";
|
1117 |
-
break;
|
1118 |
-
|
1119 |
-
case 'greaterthen_date':
|
1120 |
-
$metaWhere .= " AND CAST(meta_value AS DATE) > '{$custom_field_value}' )";
|
1121 |
-
break;
|
1122 |
-
|
1123 |
-
case 'greaterthenequal_date':
|
1124 |
-
$metaWhere .= " AND CAST(meta_value AS DATE) >= '{$custom_field_value}' )";
|
1125 |
-
break;
|
1126 |
-
|
1127 |
-
case 'equal_to_number':
|
1128 |
-
$metaWhere .= " AND CAST(meta_value AS SIGNED) = '{$custom_field_value}' )";
|
1129 |
-
break;
|
1130 |
-
|
1131 |
-
case 'notequal_to_number':
|
1132 |
-
$metaWhere .= " AND CAST(meta_value AS SIGNED) != '{$custom_field_value}' )";
|
1133 |
-
break;
|
1134 |
-
|
1135 |
-
case 'lessthen_number':
|
1136 |
-
$metaWhere .= " AND CAST(meta_value AS SIGNED) < '{$custom_field_value}' )";
|
1137 |
-
break;
|
1138 |
-
|
1139 |
-
case 'lessthenequal_number':
|
1140 |
-
$metaWhere .= " AND CAST(meta_value AS SIGNED) <= '{$custom_field_value}' )";
|
1141 |
-
break;
|
1142 |
-
|
1143 |
-
case 'greaterthen_number':
|
1144 |
-
$metaWhere .= " AND CAST(meta_value AS SIGNED) > '{$custom_field_value}' )";
|
1145 |
-
break;
|
1146 |
-
|
1147 |
-
case 'greaterthenequal_number':
|
1148 |
-
$metaWhere .= " AND CAST(meta_value AS SIGNED) >= '{$custom_field_value}' )";
|
1149 |
-
break;
|
1150 |
-
|
1151 |
-
default:
|
1152 |
-
$metaWhere .= " AND meta_value = '{$custom_field_value}' )";
|
1153 |
-
break;
|
1154 |
-
}
|
1155 |
-
}else{
|
1156 |
-
$metaWhere .=" )";
|
1157 |
-
}
|
1158 |
-
}
|
1159 |
-
return $metaWhere;
|
1160 |
-
}
|
1161 |
-
|
1162 |
-
/**
|
1163 |
-
* Get Plugin array
|
1164 |
-
*
|
1165 |
-
* @since 1.1.0
|
1166 |
-
* @return array
|
1167 |
-
*/
|
1168 |
-
public function get_xyuls_themes_plugins(){
|
1169 |
-
return array(
|
1170 |
-
'wp-event-aggregator' => esc_html__( 'WP Event Aggregator', 'wp-bulk-delete' ),
|
1171 |
-
'import-facebook-events' => esc_html__( 'Import Facebook Events', 'wp-bulk-delete' ),
|
1172 |
-
'import-eventbrite-events' => esc_html__( 'Import Eventbrite Events', 'wp-bulk-delete' ),
|
1173 |
-
'import-meetup-events' => esc_html__( 'Import Meetup Events', 'wp-bulk-delete' ),
|
1174 |
-
'event-schema' => esc_html__( 'Event Schema / Structured Data', 'wp-bulk-delete' ),
|
1175 |
-
);
|
1176 |
-
}
|
1177 |
-
|
1178 |
-
/**
|
1179 |
-
* Get Plugin Details.
|
1180 |
-
*
|
1181 |
-
* @since 1.1.0
|
1182 |
-
* @return array
|
1183 |
-
*/
|
1184 |
-
public function get_wporg_plugin( $slug ){
|
1185 |
-
|
1186 |
-
if( $slug == '' ){
|
1187 |
-
return false;
|
1188 |
-
}
|
1189 |
-
|
1190 |
-
$transient_name = 'support_plugin_box'.$slug;
|
1191 |
-
$plugin_data = get_transient( $transient_name );
|
1192 |
-
if( false === $plugin_data ){
|
1193 |
-
if ( ! function_exists( 'plugins_api' ) ) {
|
1194 |
-
include_once ABSPATH . '/wp-admin/includes/plugin-install.php';
|
1195 |
-
}
|
1196 |
-
|
1197 |
-
$plugin_data = plugins_api( 'plugin_information', array(
|
1198 |
-
'slug' => $slug,
|
1199 |
-
'is_ssl' => is_ssl(),
|
1200 |
-
'fields' => array(
|
1201 |
-
'banners' => true,
|
1202 |
-
'active_installs' => true,
|
1203 |
-
),
|
1204 |
-
) );
|
1205 |
-
|
1206 |
-
if ( ! is_wp_error( $plugin_data ) ) {
|
1207 |
-
set_transient( $transient_name, $plugin_data, 24 * HOUR_IN_SECONDS );
|
1208 |
-
} else {
|
1209 |
-
// If there was a bug on the Current Request just leave
|
1210 |
-
return false;
|
1211 |
-
}
|
1212 |
-
}
|
1213 |
-
return $plugin_data;
|
1214 |
-
}
|
1215 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Scripts
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Delerte API
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* WPBD_Delete_API class
|
16 |
+
*
|
17 |
+
* @since 1.0.0
|
18 |
+
*/
|
19 |
+
class WPBD_Delete_API {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Get things going
|
23 |
+
*
|
24 |
+
* @since 1.0.0
|
25 |
+
*/
|
26 |
+
public function __construct() { /* */ }
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Get posts Ids.
|
30 |
+
*
|
31 |
+
* @access public
|
32 |
+
* @since 1.0
|
33 |
+
* @param array $data Delete posts form data.
|
34 |
+
* @return array | Posts Id.
|
35 |
+
*/
|
36 |
+
public function get_delete_posts_ids( $data = array() ) {
|
37 |
+
if( wpbd_is_pro() && class_exists('WPBD_Delete_API_Pro', false) ){
|
38 |
+
$wpbdpro = new WPBD_Delete_API_Pro();
|
39 |
+
return $wpbdpro->get_delete_posts_ids( $data );
|
40 |
+
}
|
41 |
+
global $wpdb;
|
42 |
+
if( ! empty( $data['delete_post_type'] ) && ! empty( $data['delete_post_status'] ) ){
|
43 |
+
|
44 |
+
$post_types = isset( $data['delete_post_type'] ) ? $data['delete_post_type'] : array();
|
45 |
+
if( ! is_array( $post_types ) ){
|
46 |
+
$post_types = array( $post_types );
|
47 |
+
}
|
48 |
+
$post_types = array_map('esc_sql', $post_types );
|
49 |
+
|
50 |
+
$post_status = isset( $data['delete_post_status'] ) ? array_map('esc_sql', $data['delete_post_status'] ) : array();
|
51 |
+
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
52 |
+
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
53 |
+
$delete_authors = isset( $data['delete_authors'] ) ? array_map( 'intval', $data['delete_authors'] ) : array();
|
54 |
+
$delete_type = isset( $data['delete_type'] ) ? $data['delete_type'] : 'trash';
|
55 |
+
$limit_post = isset( $data['limit_post'] ) ? absint( $data['limit_post'] ) : '';
|
56 |
+
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
57 |
+
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
58 |
+
if( $date_type === 'older_than') {
|
59 |
+
$delete_start_date = $delete_end_date = '';
|
60 |
+
if( $input_days === "0" || $input_days > 0){
|
61 |
+
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
62 |
+
}
|
63 |
+
} else if( $date_type === 'within_last') {
|
64 |
+
$delete_start_date = $delete_end_date = '';
|
65 |
+
if( $input_days === "0" || $input_days > 0){
|
66 |
+
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
// BY Taxonomy.
|
71 |
+
$post_taxonomy = isset( $data['post_taxonomy'] ) ? esc_sql( $data['post_taxonomy'] ) : '';
|
72 |
+
$post_taxonomy_terms = isset( $data['post_taxonomy_terms'] ) ? array_map( 'intval', $data['post_taxonomy_terms'] ) : array();
|
73 |
+
|
74 |
+
if( empty( $post_types ) || empty( $post_status ) ){
|
75 |
+
return array();
|
76 |
+
}
|
77 |
+
|
78 |
+
// Query Generation.
|
79 |
+
$query = "SELECT DISTINCT $wpdb->posts.ID FROM $wpdb->posts ";
|
80 |
+
|
81 |
+
if( $post_taxonomy != '' && ! empty( $post_taxonomy_terms ) ) {
|
82 |
+
|
83 |
+
$query .= " LEFT JOIN $wpdb->term_relationships ON( $wpdb->posts.ID = $wpdb->term_relationships.object_id )";
|
84 |
+
$query .= " LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)";
|
85 |
+
$query .= " LEFT JOIN $wpdb->terms ON($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id)";
|
86 |
+
}
|
87 |
+
|
88 |
+
$query .= " WHERE $wpdb->posts.post_type IN ( '" . implode( "', '", $post_types ) . "' )";
|
89 |
+
|
90 |
+
if( $post_taxonomy != '' && ! empty( $post_taxonomy_terms ) ) {
|
91 |
+
$query .= " AND ( $wpdb->terms.term_id IN ( " . implode( ", ", $post_taxonomy_terms ). " )";
|
92 |
+
$query .= " AND $wpdb->term_taxonomy.taxonomy = '{$post_taxonomy}' )";
|
93 |
+
}
|
94 |
+
|
95 |
+
if( !empty( $post_status ) ){
|
96 |
+
$query .= " AND $wpdb->posts.post_status IN ( '" . implode( "', '", $post_status ) . "' )";
|
97 |
+
}
|
98 |
+
if( $delete_start_date != ''){
|
99 |
+
$query .= " AND $wpdb->posts.post_date >= '{$delete_start_date} 00:00:00'";
|
100 |
+
}
|
101 |
+
if( $delete_end_date != ''){
|
102 |
+
$query .= " AND $wpdb->posts.post_date <= '{$delete_end_date} 23:59:59'";
|
103 |
+
}
|
104 |
+
|
105 |
+
if( !empty( $delete_authors ) ){
|
106 |
+
$query .= " AND $wpdb->posts.post_author IN ( " . implode( ",", $delete_authors ). " )";
|
107 |
+
}
|
108 |
+
|
109 |
+
if( $limit_post != '' ){
|
110 |
+
if( is_numeric( $limit_post ) ){
|
111 |
+
$query .= " LIMIT " . $limit_post;
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
$posts = $wpdb->get_col( $query );
|
116 |
+
return $posts;
|
117 |
+
|
118 |
+
}else{
|
119 |
+
return array();
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Do Delete operation on posts.
|
125 |
+
*
|
126 |
+
* @access public
|
127 |
+
* @since 1.0
|
128 |
+
* @param array $data Posts Id.
|
129 |
+
* @return array | deleted posts count.
|
130 |
+
*/
|
131 |
+
public function do_delete_posts( $post_ids = array(), $force_delete = false ) {
|
132 |
+
$post_delete_count = 0;
|
133 |
+
|
134 |
+
if ( ! empty( $post_ids ) ){
|
135 |
+
|
136 |
+
foreach ($post_ids as $post_id ) {
|
137 |
+
wp_delete_post( $post_id, $force_delete );
|
138 |
+
}
|
139 |
+
$post_delete_count = count( $post_ids );
|
140 |
+
|
141 |
+
}
|
142 |
+
return $post_delete_count;
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Get Post Count by Posttype
|
147 |
+
*
|
148 |
+
* @access public
|
149 |
+
* @since 1.0
|
150 |
+
* @param array $post_type Post type.
|
151 |
+
* @return int | posts count.
|
152 |
+
*/
|
153 |
+
public function get_post_count( $counttype = '' ) {
|
154 |
+
global $wpdb;
|
155 |
+
|
156 |
+
$count = 0;
|
157 |
+
|
158 |
+
switch( $counttype ) {
|
159 |
+
case 'revision':
|
160 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_type = %s", 'revision' ) );
|
161 |
+
break;
|
162 |
+
case 'auto_drafts':
|
163 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_status = %s", 'auto-draft' ) );
|
164 |
+
break;
|
165 |
+
case 'trash':
|
166 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_status = %s", 'trash' ) );
|
167 |
+
break;
|
168 |
+
case 'orphan_postmeta':
|
169 |
+
$count = $wpdb->get_var( "SELECT COUNT(meta_id) FROM $wpdb->postmeta WHERE post_id NOT IN (SELECT ID FROM $wpdb->posts)" );
|
170 |
+
break;
|
171 |
+
case 'orphan_commentmeta':
|
172 |
+
$count = $wpdb->get_var( "SELECT COUNT(meta_id) FROM $wpdb->commentmeta WHERE comment_id NOT IN (SELECT comment_ID FROM $wpdb->comments)" );
|
173 |
+
break;
|
174 |
+
case 'orphan_usermeta':
|
175 |
+
$count = $wpdb->get_var( "SELECT COUNT(umeta_id) FROM $wpdb->usermeta WHERE user_id NOT IN (SELECT ID FROM $wpdb->users)" );
|
176 |
+
break;
|
177 |
+
case 'orphan_termmeta':
|
178 |
+
$count = $wpdb->get_var( "SELECT COUNT(meta_id) FROM $wpdb->termmeta WHERE term_id NOT IN (SELECT term_id FROM $wpdb->terms)" );
|
179 |
+
break;
|
180 |
+
|
181 |
+
case 'duplicated_postmeta':
|
182 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT(meta_id) AS count FROM $wpdb->postmeta GROUP BY post_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
183 |
+
if( is_array( $query ) ) {
|
184 |
+
$count = array_sum( array_map( 'intval', $query ) );
|
185 |
+
}
|
186 |
+
break;
|
187 |
+
case 'duplicated_commentmeta':
|
188 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT(meta_id) AS count FROM $wpdb->commentmeta GROUP BY comment_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
189 |
+
if( is_array( $query ) ) {
|
190 |
+
$count = array_sum( array_map( 'intval', $query ) );
|
191 |
+
}
|
192 |
+
break;
|
193 |
+
case 'duplicated_usermeta':
|
194 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT(umeta_id) AS count FROM $wpdb->usermeta GROUP BY user_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
195 |
+
if( is_array( $query ) ) {
|
196 |
+
$count = array_sum( array_map( 'intval', $query ) );
|
197 |
+
}
|
198 |
+
break;
|
199 |
+
case 'duplicated_termmeta':
|
200 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT(meta_id) AS count FROM $wpdb->termmeta GROUP BY term_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
201 |
+
if( is_array( $query ) ) {
|
202 |
+
$count = array_sum( array_map( 'intval', $query ) );
|
203 |
+
}
|
204 |
+
break;
|
205 |
+
|
206 |
+
}
|
207 |
+
return $count;
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Get Comment Count by status
|
212 |
+
*
|
213 |
+
* @access public
|
214 |
+
* @since 1.0
|
215 |
+
* @param array $status status
|
216 |
+
* @return int | posts count.
|
217 |
+
*/
|
218 |
+
public function get_comment_count( $status = '' ) {
|
219 |
+
global $wpdb;
|
220 |
+
|
221 |
+
$count = 0;
|
222 |
+
|
223 |
+
switch( $status ) {
|
224 |
+
|
225 |
+
case 'pending':
|
226 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = %s", '0' ) );
|
227 |
+
break;
|
228 |
+
|
229 |
+
case 'spam':
|
230 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = %s", 'spam' ) );
|
231 |
+
break;
|
232 |
+
|
233 |
+
case 'trash':
|
234 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE (comment_approved = %s OR comment_approved = %s)", 'trash', 'post-trashed' ) );
|
235 |
+
break;
|
236 |
+
|
237 |
+
case 'approved':
|
238 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = %s", '1' ) );
|
239 |
+
break;
|
240 |
+
|
241 |
+
default:
|
242 |
+
$count = 0;
|
243 |
+
break;
|
244 |
+
}
|
245 |
+
|
246 |
+
return $count;
|
247 |
+
}
|
248 |
+
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Run Cleanup
|
252 |
+
*
|
253 |
+
* @access public
|
254 |
+
* @since 1.0
|
255 |
+
* @param array $cleanuptype Cleanup type.
|
256 |
+
* @return string | message.
|
257 |
+
*/
|
258 |
+
public function run_cleanup( $cleanuptype = '' ){
|
259 |
+
global $wpdb;
|
260 |
+
$message = '';
|
261 |
+
|
262 |
+
switch( $cleanuptype ) {
|
263 |
+
case 'revision':
|
264 |
+
$posts = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = %s", 'revision' ) );
|
265 |
+
if( $posts ) {
|
266 |
+
foreach ( $posts as $id ) {
|
267 |
+
wp_delete_post_revision( intval( $id ) );
|
268 |
+
}
|
269 |
+
|
270 |
+
$message = sprintf( __( '%s Revisions Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $posts ) ) );
|
271 |
+
}
|
272 |
+
break;
|
273 |
+
case 'auto_drafts':
|
274 |
+
$posts = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_status = %s", 'auto-draft' ) );
|
275 |
+
if( $posts ) {
|
276 |
+
foreach ( $posts as $id ) {
|
277 |
+
wp_delete_post( intval( $id ), true );
|
278 |
+
}
|
279 |
+
|
280 |
+
$message = sprintf( __( '%s Auto Drafts Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $posts ) ) );
|
281 |
+
}
|
282 |
+
break;
|
283 |
+
case 'trash':
|
284 |
+
$posts = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_status = %s", 'trash' ) );
|
285 |
+
if( $posts ) {
|
286 |
+
foreach ( $posts as $id ) {
|
287 |
+
wp_delete_post( $id, true );
|
288 |
+
}
|
289 |
+
|
290 |
+
$message = sprintf( __( '%s Trashed Posts Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $posts ) ) );
|
291 |
+
}
|
292 |
+
break;
|
293 |
+
|
294 |
+
case 'orphan_postmeta':
|
295 |
+
$query = $wpdb->get_results( "SELECT post_id, meta_key FROM $wpdb->postmeta WHERE post_id NOT IN (SELECT ID FROM $wpdb->posts)" );
|
296 |
+
if( $query ) {
|
297 |
+
foreach ( $query as $meta ) {
|
298 |
+
$post_id = intval( $meta->post_id );
|
299 |
+
if( $post_id === 0 ) {
|
300 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta->meta_key ) );
|
301 |
+
} else {
|
302 |
+
delete_post_meta( $post_id, $meta->meta_key );
|
303 |
+
}
|
304 |
+
}
|
305 |
+
|
306 |
+
$message = sprintf( __( '%s Orphaned Post Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
307 |
+
}
|
308 |
+
break;
|
309 |
+
case 'orphan_commentmeta':
|
310 |
+
$query = $wpdb->get_results( "SELECT comment_id, meta_key FROM $wpdb->commentmeta WHERE comment_id NOT IN (SELECT comment_ID FROM $wpdb->comments)" );
|
311 |
+
if( $query ) {
|
312 |
+
foreach ( $query as $meta ) {
|
313 |
+
$comment_id = intval( $meta->comment_id );
|
314 |
+
if( $comment_id === 0 ) {
|
315 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->commentmeta WHERE comment_id = %d AND meta_key = %s", $comment_id, $meta->meta_key ) );
|
316 |
+
} else {
|
317 |
+
delete_comment_meta( $comment_id, $meta->meta_key );
|
318 |
+
}
|
319 |
+
}
|
320 |
+
|
321 |
+
$message = sprintf( __( '%s Orphaned Comment Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
322 |
+
}
|
323 |
+
break;
|
324 |
+
case 'orphan_usermeta':
|
325 |
+
$query = $wpdb->get_results( "SELECT user_id, meta_key FROM $wpdb->usermeta WHERE user_id NOT IN (SELECT ID FROM $wpdb->users)" );
|
326 |
+
if( $query ) {
|
327 |
+
foreach ( $query as $meta ) {
|
328 |
+
$user_id = intval( $meta->user_id );
|
329 |
+
if( $user_id === 0 ) {
|
330 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta->meta_key ) );
|
331 |
+
} else {
|
332 |
+
delete_user_meta( $user_id, $meta->meta_key );
|
333 |
+
}
|
334 |
+
}
|
335 |
+
|
336 |
+
$message = sprintf( __( '%s Orphaned User Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
337 |
+
}
|
338 |
+
break;
|
339 |
+
case 'orphan_termmeta':
|
340 |
+
$query = $wpdb->get_results( "SELECT term_id, meta_key FROM $wpdb->termmeta WHERE term_id NOT IN (SELECT term_id FROM $wpdb->terms)" );
|
341 |
+
if( $query ) {
|
342 |
+
foreach ( $query as $meta ) {
|
343 |
+
$term_id = intval( $meta->term_id );
|
344 |
+
if( $term_id === 0 ) {
|
345 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->termmeta WHERE term_id = %d AND meta_key = %s", $term_id, $meta->meta_key ) );
|
346 |
+
} else {
|
347 |
+
delete_term_meta( $term_id, $meta->meta_key );
|
348 |
+
}
|
349 |
+
}
|
350 |
+
|
351 |
+
$message = sprintf( __( '%s Orphaned Term Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
352 |
+
}
|
353 |
+
break;
|
354 |
+
|
355 |
+
case 'duplicated_postmeta':
|
356 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, post_id, COUNT(*) AS count FROM $wpdb->postmeta GROUP BY post_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
357 |
+
if( $query ) {
|
358 |
+
foreach ( $query as $meta ) {
|
359 |
+
$ids = array_map( 'intval', explode( ',', $meta->ids ) );
|
360 |
+
array_pop( $ids );
|
361 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_id IN (" . implode( ',', $ids ) . ") AND post_id = %d", intval( $meta->post_id ) ) );
|
362 |
+
}
|
363 |
+
|
364 |
+
$message = sprintf( __( '%s Duplicated Post Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
365 |
+
}
|
366 |
+
break;
|
367 |
+
case 'duplicated_commentmeta':
|
368 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, comment_id, COUNT(*) AS count FROM $wpdb->commentmeta GROUP BY comment_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
369 |
+
if( $query ) {
|
370 |
+
foreach ( $query as $meta ) {
|
371 |
+
$ids = array_map( 'intval', explode( ',', $meta->ids ) );
|
372 |
+
array_pop( $ids );
|
373 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->commentmeta WHERE meta_id IN (" . implode( ',', $ids ) . ") AND comment_id = %d", intval( $meta->comment_id ) ) );
|
374 |
+
}
|
375 |
+
|
376 |
+
$message = sprintf( __( '%s Duplicated Comment Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
377 |
+
}
|
378 |
+
break;
|
379 |
+
case 'duplicated_usermeta':
|
380 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(umeta_id ORDER BY umeta_id DESC) AS ids, user_id, COUNT(*) AS count FROM $wpdb->usermeta GROUP BY user_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
381 |
+
if( $query ) {
|
382 |
+
foreach ( $query as $meta ) {
|
383 |
+
$ids = array_map( 'intval', explode( ',', $meta->ids ) );
|
384 |
+
array_pop( $ids );
|
385 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE umeta_id IN (" . implode( ',', $ids ) . ") AND user_id = %d", intval( $meta->user_id ) ) );
|
386 |
+
}
|
387 |
+
|
388 |
+
$message = sprintf( __( '%s Duplicated User Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
389 |
+
}
|
390 |
+
break;
|
391 |
+
case 'duplicated_termmeta':
|
392 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, term_id, COUNT(*) AS count FROM $wpdb->termmeta GROUP BY term_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
393 |
+
if( $query ) {
|
394 |
+
foreach ( $query as $meta ) {
|
395 |
+
$ids = array_map( 'intval', explode( ',', $meta->ids ) );
|
396 |
+
array_pop( $ids );
|
397 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->termmeta WHERE meta_id IN (" . implode( ',', $ids ) . ") AND term_id = %d", intval( $meta->term_id ) ) );
|
398 |
+
}
|
399 |
+
|
400 |
+
$message = sprintf( __( '%s Duplicated Term Meta Cleaned up', 'wp-bulk-delete' ), number_format_i18n( sizeof( $query ) ) );
|
401 |
+
}
|
402 |
+
break;
|
403 |
+
|
404 |
+
}
|
405 |
+
return $message;
|
406 |
+
}
|
407 |
+
|
408 |
+
/**
|
409 |
+
* Get Users Ids.
|
410 |
+
*
|
411 |
+
* @access public
|
412 |
+
* @since 1.0
|
413 |
+
* @param array $data Delete User form data.
|
414 |
+
* @return array | Users Id.
|
415 |
+
*/
|
416 |
+
public function get_delete_user_ids( $data = array() ){
|
417 |
+
global $wpdb;
|
418 |
+
|
419 |
+
if( empty( $data['delete_user_roles'] ) && ( $data['user_meta_key'] == '' || $data['user_meta_value'] == '' ) ){
|
420 |
+
return array();
|
421 |
+
}
|
422 |
+
$delete_user_roles = isset( $data['delete_user_roles'] ) ? $data['delete_user_roles'] : array();
|
423 |
+
$delete_user_roles = array_map('esc_sql', $delete_user_roles );
|
424 |
+
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
425 |
+
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
426 |
+
$limit_user = isset( $data['limit_user'] ) ? absint( $data['limit_user'] ) : '';
|
427 |
+
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
428 |
+
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
429 |
+
if( $date_type === 'older_than') {
|
430 |
+
$delete_start_date = $delete_end_date = '';
|
431 |
+
if( $input_days === "0" || $input_days > 0){
|
432 |
+
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
433 |
+
}
|
434 |
+
} else if( $date_type === 'within_last') {
|
435 |
+
$delete_start_date = $delete_end_date = '';
|
436 |
+
if( $input_days === "0" || $input_days > 0){
|
437 |
+
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
438 |
+
}
|
439 |
+
}
|
440 |
+
|
441 |
+
// By Usermeta.
|
442 |
+
$user_meta_key = isset( $data['user_meta_key'] ) ? esc_sql( $data['user_meta_key'] ) : '';
|
443 |
+
$user_meta_value = isset( $data['user_meta_value'] ) ? esc_sql( $data['user_meta_value'] ) : '';
|
444 |
+
$user_meta_compare = isset( $data['user_meta_compare'] ) ? $data['user_meta_compare'] : 'equal_to_str';
|
445 |
+
|
446 |
+
// Query Generation.
|
447 |
+
$query = "SELECT DISTINCT $wpdb->users.ID FROM $wpdb->users ";
|
448 |
+
|
449 |
+
if ( $user_meta_key != '' && $user_meta_compare != '' && $user_meta_value != '' ) {
|
450 |
+
$query .= " INNER JOIN $wpdb->usermeta ON( $wpdb->users.ID = $wpdb->usermeta.user_id )";
|
451 |
+
}
|
452 |
+
|
453 |
+
if( !empty( $delete_user_roles ) ){
|
454 |
+
$query .= " INNER JOIN $wpdb->usermeta AS mt_roles ON ( $wpdb->users.ID = mt_roles.user_id )";
|
455 |
+
}
|
456 |
+
|
457 |
+
$query .= ' WHERE 1=1 ';
|
458 |
+
|
459 |
+
if ( $user_meta_key != '' && $user_meta_compare != '' && $user_meta_value != '' ) {
|
460 |
+
$query .= " AND ( $wpdb->usermeta.meta_key = '" . $user_meta_key. "'";
|
461 |
+
switch ( $user_meta_compare ) {
|
462 |
+
case 'equal_to_str':
|
463 |
+
$query .= " AND $wpdb->usermeta.meta_value = '{$user_meta_value}' )";
|
464 |
+
break;
|
465 |
+
|
466 |
+
case 'notequal_to_str':
|
467 |
+
$query .= " AND $wpdb->usermeta.meta_value != '{$user_meta_value}' )";
|
468 |
+
break;
|
469 |
+
|
470 |
+
case 'like_str':
|
471 |
+
$query .= " AND $wpdb->usermeta.meta_value LIKE '%{$user_meta_value}%' )";
|
472 |
+
break;
|
473 |
+
|
474 |
+
case 'notlike_str':
|
475 |
+
$query .= " AND $wpdb->usermeta.meta_value NOT LIKE '%{$user_meta_value}%' )";
|
476 |
+
break;
|
477 |
+
|
478 |
+
case 'equal_to_date':
|
479 |
+
$query .= " AND CAST($wpdb->usermeta.meta_value AS DATE) = '{$user_meta_value}' )";
|
480 |
+
break;
|
481 |
+
|
482 |
+
case 'notequal_to_date':
|
483 |
+
$query .= " AND CAST($wpdb->usermeta.meta_value AS DATE) != '{$user_meta_value}' )";
|
484 |
+
break;
|
485 |
+
|
486 |
+
case 'lessthen_date':
|
487 |
+
$query .= " AND CAST($wpdb->usermeta.meta_value AS DATE) < '{$user_meta_value}' )";
|
488 |
+
break;
|
489 |
+
|
490 |
+
case 'lessthenequal_date':
|
491 |
+
$query .= " AND CAST($wpdb->usermeta.meta_value AS DATE) <= '{$user_meta_value}' )";
|
492 |
+
break;
|
493 |
+
|
494 |
+
case 'greaterthen_date':
|
495 |
+
$query .= " AND CAST($wpdb->usermeta.meta_value AS DATE) > '{$user_meta_value}' )";
|
496 |
+
break;
|
497 |
+
|
498 |
+
case 'greaterthenequal_date':
|
499 |
+
$query .= " AND CAST($wpdb->usermeta.meta_value AS DATE) >= '{$user_meta_value}' )";
|
500 |
+
break;
|
501 |
+
|
502 |
+
case 'equal_to_number':
|
503 |
+
$query .= " AND CAST($wpdb->usermeta.meta_value AS SIGNED) = '{$user_meta_value}' )";
|
504 |
+
break;
|
505 |
+
|
506 |
+
case 'notequal_to_number':
|
507 |
+
$query .= " AND CAST($wpdb->usermeta.meta_value AS SIGNED) != '{$user_meta_value}' )";
|
508 |
+
break;
|
509 |
+
|
510 |
+
case 'lessthen_number':
|
511 |
+
$query .= " AND CAST($wpdb->usermeta.meta_value AS SIGNED) < '{$user_meta_value}' )";
|
512 |
+
break;
|
513 |
+
|
514 |
+
case 'lessthenequal_number':
|
515 |
+
$query .= " AND CAST($wpdb->usermeta.meta_value AS SIGNED) <= '{$user_meta_value}' )";
|
516 |
+
break;
|
517 |
+
|
518 |
+
case 'greaterthen_number':
|
519 |
+
$query .= " AND CAST($wpdb->usermeta.meta_value AS SIGNED) > '{$user_meta_value}' )";
|
520 |
+
break;
|
521 |
+
|
522 |
+
case 'greaterthenequal_number':
|
523 |
+
$query .= " AND CAST($wpdb->usermeta.meta_value AS SIGNED) >= '{$user_meta_value}' )";
|
524 |
+
break;
|
525 |
+
|
526 |
+
default:
|
527 |
+
$query .= " AND $wpdb->usermeta.meta_value = '{$user_meta_value}' )";
|
528 |
+
break;
|
529 |
+
}
|
530 |
+
}
|
531 |
+
|
532 |
+
if( !empty( $delete_user_roles ) ){
|
533 |
+
$subquery = array();
|
534 |
+
foreach ($delete_user_roles as $delete_user_role ) {
|
535 |
+
$subquery[] = "( mt_roles.meta_key = '{$wpdb->prefix}capabilities' AND mt_roles.meta_value LIKE '%".'\"'.$delete_user_role.'\"%'."' )";
|
536 |
+
}
|
537 |
+
$subquery = implode( ' OR ', $subquery );
|
538 |
+
$query .= " AND ( {$subquery} )";
|
539 |
+
}
|
540 |
+
|
541 |
+
if( $delete_start_date != ''){
|
542 |
+
$query .= " AND ( $wpdb->users.user_registered >= '{$delete_start_date} 00:00:00' )";
|
543 |
+
}
|
544 |
+
if( $delete_end_date != ''){
|
545 |
+
$query .= " AND ( $wpdb->users.user_registered <= '{$delete_end_date} 23:59:59' )";
|
546 |
+
}
|
547 |
+
|
548 |
+
$query .= " AND $wpdb->users.ID NOT IN ( ".get_current_user_id()." )";
|
549 |
+
|
550 |
+
if( $limit_user != '' ){
|
551 |
+
if( is_numeric( $limit_user ) ){
|
552 |
+
$query .= " ORDER BY $wpdb->users.user_login ASC LIMIT " . $limit_user;
|
553 |
+
}
|
554 |
+
}
|
555 |
+
$users = $wpdb->get_col( $query );
|
556 |
+
return $users;
|
557 |
+
}
|
558 |
+
|
559 |
+
/**
|
560 |
+
* Do Delete operation on users.
|
561 |
+
*
|
562 |
+
* @access public
|
563 |
+
* @since 1.0
|
564 |
+
* @param array $data Posts Id.
|
565 |
+
* @return array | deleted posts count.
|
566 |
+
*/
|
567 |
+
public function do_delete_users( $user_ids = array(), $reassign_user = '') {
|
568 |
+
$user_delete_count = 0;
|
569 |
+
require_once(ABSPATH.'wp-admin/includes/user.php' );
|
570 |
+
$current_user = wp_get_current_user();
|
571 |
+
$user_ids = array_diff( $user_ids, array( $current_user->ID ) );
|
572 |
+
if ( ! empty( $user_ids ) ){
|
573 |
+
foreach ($user_ids as $user_id ) {
|
574 |
+
if( $reassign_user != '' && $reassign_user > 0 ){
|
575 |
+
wp_delete_user( $user_id , $reassign_user );
|
576 |
+
}else{
|
577 |
+
wp_delete_user( $user_id );
|
578 |
+
}
|
579 |
+
|
580 |
+
}
|
581 |
+
$user_delete_count = count( $user_ids );
|
582 |
+
|
583 |
+
}
|
584 |
+
return $user_delete_count;
|
585 |
+
}
|
586 |
+
|
587 |
+
/**
|
588 |
+
* Get Comment count to be deleted.
|
589 |
+
*
|
590 |
+
* @access public
|
591 |
+
* @since 1.1.0
|
592 |
+
* @param array $data Delete comment form data.
|
593 |
+
* @return comment count.
|
594 |
+
*/
|
595 |
+
public function get_delete_comment_count( $data = array() ){
|
596 |
+
if( wpbd_is_pro() && class_exists('WPBD_Delete_API_Pro', false) ){
|
597 |
+
$wpbdpro = new WPBD_Delete_API_Pro();
|
598 |
+
return $wpbdpro->get_delete_comment_count( $data );
|
599 |
+
}
|
600 |
+
global $wpdb;
|
601 |
+
$comment_delete_count = 0;
|
602 |
+
$delete_comment_status = isset( $data['delete_comment_status'] ) ? $data['delete_comment_status'] : array();
|
603 |
+
$delete_comment_status = array_map('esc_sql', $delete_comment_status );
|
604 |
+
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
605 |
+
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
606 |
+
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
607 |
+
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
608 |
+
if( $date_type === 'older_than') {
|
609 |
+
$delete_start_date = $delete_end_date = '';
|
610 |
+
if( $input_days === "0" || $input_days > 0){
|
611 |
+
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
612 |
+
}
|
613 |
+
} else if( $date_type === 'within_last') {
|
614 |
+
$delete_start_date = $delete_end_date = '';
|
615 |
+
if( $input_days === "0" || $input_days > 0){
|
616 |
+
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
617 |
+
}
|
618 |
+
}
|
619 |
+
|
620 |
+
if ( ! empty( $data ) ){
|
621 |
+
|
622 |
+
$temp_delete_query = array();
|
623 |
+
|
624 |
+
if( ! empty( $delete_comment_status ) ){
|
625 |
+
foreach ( $delete_comment_status as $comment_status ) {
|
626 |
+
|
627 |
+
switch( $comment_status ) {
|
628 |
+
case 'pending':
|
629 |
+
$temp_delete_query[] = "comment_approved = '0'";
|
630 |
+
break;
|
631 |
+
|
632 |
+
case 'spam':
|
633 |
+
$temp_delete_query[] = "comment_approved = 'spam'";
|
634 |
+
break;
|
635 |
+
|
636 |
+
case 'trash':
|
637 |
+
$temp_delete_query[] = "comment_approved = 'trash' OR comment_approved = 'post-trashed'";
|
638 |
+
break;
|
639 |
+
|
640 |
+
case 'approved':
|
641 |
+
$temp_delete_query[] = "comment_approved = '1'";
|
642 |
+
break;
|
643 |
+
}
|
644 |
+
|
645 |
+
}
|
646 |
+
if( !empty( $temp_delete_query ) ) {
|
647 |
+
$delete_comment_query = "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE 1=1";
|
648 |
+
$delete_comment_query .= " AND (" . implode( " OR ", $temp_delete_query ) . ")";
|
649 |
+
}
|
650 |
+
}
|
651 |
+
|
652 |
+
if( $delete_start_date != ''){
|
653 |
+
$delete_comment_query .= " AND ( comment_date >= '{$delete_start_date} 00:00:00' )";
|
654 |
+
}
|
655 |
+
if( $delete_end_date != ''){
|
656 |
+
$delete_comment_query .= " AND ( comment_date <= '{$delete_end_date} 23:59:59' )";
|
657 |
+
}
|
658 |
+
$comment_delete_count = $wpdb->get_var( $delete_comment_query );
|
659 |
+
}
|
660 |
+
return $comment_delete_count;
|
661 |
+
}
|
662 |
+
|
663 |
+
/**
|
664 |
+
* Do Delete operation on comments.
|
665 |
+
*
|
666 |
+
* @access public
|
667 |
+
* @since 1.1.0
|
668 |
+
* @param array $data $_POST.
|
669 |
+
* @return deleted comments count.
|
670 |
+
*/
|
671 |
+
public function do_delete_comments( $data = array() ) {
|
672 |
+
global $wpdb;
|
673 |
+
if( wpbd_is_pro() && class_exists('WPBD_Delete_API_Pro', false) ){
|
674 |
+
$wpbdpro = new WPBD_Delete_API_Pro();
|
675 |
+
return $wpbdpro->do_delete_comments( $data );
|
676 |
+
}
|
677 |
+
|
678 |
+
$comment_delete_count = 0;
|
679 |
+
$delete_comment_status = isset( $data['delete_comment_status'] ) ? $data['delete_comment_status'] : array();
|
680 |
+
$delete_comment_status = array_map('esc_sql', $delete_comment_status );
|
681 |
+
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
682 |
+
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
683 |
+
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
684 |
+
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
685 |
+
if( $date_type === 'older_than') {
|
686 |
+
$delete_start_date = $delete_end_date = '';
|
687 |
+
if( $input_days === "0" || $input_days > 0){
|
688 |
+
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
689 |
+
}
|
690 |
+
} else if( $date_type === 'within_last') {
|
691 |
+
$delete_start_date = $delete_end_date = '';
|
692 |
+
if( $input_days === "0" || $input_days > 0){
|
693 |
+
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
694 |
+
}
|
695 |
+
}
|
696 |
+
|
697 |
+
if ( ! empty( $data ) ){
|
698 |
+
|
699 |
+
$temp_delete_query = array();
|
700 |
+
|
701 |
+
if( ! empty( $delete_comment_status ) ){
|
702 |
+
foreach ( $delete_comment_status as $comment_status ) {
|
703 |
+
|
704 |
+
switch( $comment_status ) {
|
705 |
+
case 'pending':
|
706 |
+
$temp_delete_query[] = "comment_approved = '0'";
|
707 |
+
break;
|
708 |
+
|
709 |
+
case 'spam':
|
710 |
+
$temp_delete_query[] = "comment_approved = 'spam'";
|
711 |
+
break;
|
712 |
+
|
713 |
+
case 'trash':
|
714 |
+
$temp_delete_query[] = "comment_approved = 'trash' OR comment_approved = 'post-trashed'";
|
715 |
+
break;
|
716 |
+
break;
|
717 |
+
|
718 |
+
case 'approved':
|
719 |
+
$temp_delete_query[] = "comment_approved = '1'";
|
720 |
+
break;
|
721 |
+
}
|
722 |
+
|
723 |
+
}
|
724 |
+
if( !empty( $temp_delete_query ) ) {
|
725 |
+
$delete_comment_query = "DELETE FROM $wpdb->comments WHERE 1=1";
|
726 |
+
$delete_comment_query .= " AND (" . implode( " OR ", $temp_delete_query ) . ")";
|
727 |
+
}
|
728 |
+
}
|
729 |
+
|
730 |
+
if( $delete_start_date != ''){
|
731 |
+
$delete_comment_query .= " AND ( comment_date >= '{$delete_start_date} 00:00:00' )";
|
732 |
+
}
|
733 |
+
if( $delete_end_date != ''){
|
734 |
+
$delete_comment_query .= " AND ( comment_date <= '{$delete_end_date} 23:59:59' )";
|
735 |
+
}
|
736 |
+
$comment_delete_count = $wpdb->query( $delete_comment_query );
|
737 |
+
}
|
738 |
+
return $comment_delete_count;
|
739 |
+
}
|
740 |
+
|
741 |
+
/**
|
742 |
+
* Get postmeta Ids.
|
743 |
+
*
|
744 |
+
* @access public
|
745 |
+
* @since 1.1.0
|
746 |
+
* @param array $data Delete postmeta form data.
|
747 |
+
* @return array | Posts Id.
|
748 |
+
*/
|
749 |
+
public function get_delete_postmeta_ids( $data = array() ) {
|
750 |
+
global $wpdb;
|
751 |
+
if( wpbd_is_pro() && class_exists('WPBD_Delete_API_Pro', false) ){
|
752 |
+
$wpbdpro = new WPBD_Delete_API_Pro();
|
753 |
+
return $wpbdpro->get_delete_postmeta_ids( $data );
|
754 |
+
}
|
755 |
+
if( ! empty( $data['meta_post_type'] ) && ! empty( $data['custom_field_key'] ) ){
|
756 |
+
|
757 |
+
$post_type = isset( $data['meta_post_type'] ) ? esc_sql( $data['meta_post_type'] ) : '';
|
758 |
+
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
759 |
+
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
760 |
+
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
761 |
+
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
762 |
+
if( $date_type === 'older_than') {
|
763 |
+
$delete_start_date = $delete_end_date = '';
|
764 |
+
if( $input_days === "0" || $input_days > 0){
|
765 |
+
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
766 |
+
}
|
767 |
+
} else if( $date_type === 'within_last') {
|
768 |
+
$delete_start_date = $delete_end_date = '';
|
769 |
+
if( $input_days === "0" || $input_days > 0){
|
770 |
+
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
771 |
+
}
|
772 |
+
}
|
773 |
+
|
774 |
+
// Post Query Generation.
|
775 |
+
$postquery = "SELECT DISTINCT $wpdb->posts.ID FROM $wpdb->posts ";
|
776 |
+
|
777 |
+
$postquery .= " WHERE $wpdb->posts.post_type = '" . $post_type . "'";
|
778 |
+
|
779 |
+
if( $delete_start_date != ''){
|
780 |
+
$postquery .= " AND ( $wpdb->posts.post_date >= '{$delete_start_date} 00:00:00' )";
|
781 |
+
}
|
782 |
+
if( $delete_end_date != ''){
|
783 |
+
$postquery .= " AND ( $wpdb->posts.post_date <= '{$delete_end_date} 23:59:59' )";
|
784 |
+
}
|
785 |
+
|
786 |
+
$metaQuery = $metaWhere = "";
|
787 |
+
$metaWhere = $this->get_meta_where( $data );
|
788 |
+
|
789 |
+
if( $metaWhere != '' ){
|
790 |
+
$metaQuery = "SELECT post_id, meta_key FROM $wpdb->postmeta WHERE post_id IN ( {$postquery} ) AND ( {$metaWhere} )";
|
791 |
+
}else{
|
792 |
+
return array();
|
793 |
+
}
|
794 |
+
|
795 |
+
if( $metaQuery == '' ){
|
796 |
+
return array();
|
797 |
+
}
|
798 |
+
$meta_results = $wpdb->get_results( $metaQuery );
|
799 |
+
return $meta_results;
|
800 |
+
}else{
|
801 |
+
return array();
|
802 |
+
}
|
803 |
+
}
|
804 |
+
|
805 |
+
/**
|
806 |
+
* Do Delete operation on postmetas.
|
807 |
+
*
|
808 |
+
* @access public
|
809 |
+
* @since 1.1.0
|
810 |
+
* @param array $data Postmeta results
|
811 |
+
* @return array | deleted postmetas count.
|
812 |
+
*/
|
813 |
+
public function do_delete_postmetas( $meta_results = array() ) {
|
814 |
+
$post_delete_count = 0;
|
815 |
+
|
816 |
+
if ( ! empty( $meta_results ) ){
|
817 |
+
|
818 |
+
foreach ($meta_results as $meta ) {
|
819 |
+
$post_id = intval( $meta->post_id );
|
820 |
+
if( $post_id === 0 ) {
|
821 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta->meta_key ) );
|
822 |
+
} else {
|
823 |
+
delete_post_meta( $post_id, $meta->meta_key );
|
824 |
+
}
|
825 |
+
}
|
826 |
+
$post_delete_count = number_format_i18n( sizeof( $meta_results ) );
|
827 |
+
|
828 |
+
}
|
829 |
+
return $post_delete_count;
|
830 |
+
}
|
831 |
+
|
832 |
+
/**
|
833 |
+
* Get commentmeta Ids.
|
834 |
+
*
|
835 |
+
* @access public
|
836 |
+
* @since 1.1.0
|
837 |
+
* @param array $data Delete commentmeta form data.
|
838 |
+
* @return array | Meta results.
|
839 |
+
*/
|
840 |
+
public function get_delete_commentmeta_ids( $data = array() ) {
|
841 |
+
global $wpdb;
|
842 |
+
if( $data['custom_field_key'] != '' ){
|
843 |
+
|
844 |
+
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
845 |
+
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
846 |
+
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
847 |
+
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
848 |
+
if( $date_type === 'older_than') {
|
849 |
+
$delete_start_date = $delete_end_date = '';
|
850 |
+
if( $input_days === "0" || $input_days > 0){
|
851 |
+
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
852 |
+
}
|
853 |
+
} else if( $date_type === 'within_last') {
|
854 |
+
$delete_start_date = $delete_end_date = '';
|
855 |
+
if( $input_days === "0" || $input_days > 0){
|
856 |
+
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
857 |
+
}
|
858 |
+
}
|
859 |
+
|
860 |
+
// Post Query Generation.
|
861 |
+
$commentquery = "SELECT DISTINCT $wpdb->comments.comment_ID FROM $wpdb->comments WHERE 1 = 1";
|
862 |
+
|
863 |
+
if( $delete_start_date != ''){
|
864 |
+
$commentquery .= " AND ( $wpdb->comments.comment_date >= '{$delete_start_date} 00:00:00' )";
|
865 |
+
}
|
866 |
+
if( $delete_end_date != ''){
|
867 |
+
$commentquery .= " AND ( $wpdb->comments.comment_date <= '{$delete_end_date} 23:59:59' )";
|
868 |
+
}
|
869 |
+
|
870 |
+
$metaQuery = $metaWhere = "";
|
871 |
+
$metaWhere = $this->get_meta_where( $data );
|
872 |
+
|
873 |
+
if( $metaWhere != '' ){
|
874 |
+
$metaQuery = "SELECT comment_id, meta_key FROM $wpdb->commentmeta WHERE comment_id IN ( {$commentquery} ) AND ( {$metaWhere} )";
|
875 |
+
}else{
|
876 |
+
return array();
|
877 |
+
}
|
878 |
+
|
879 |
+
if( $metaQuery == '' ){
|
880 |
+
return array();
|
881 |
+
}
|
882 |
+
$meta_results = $wpdb->get_results( $metaQuery );
|
883 |
+
return $meta_results;
|
884 |
+
}else{
|
885 |
+
return array();
|
886 |
+
}
|
887 |
+
}
|
888 |
+
|
889 |
+
/**
|
890 |
+
* Do Delete operation on commentmetas.
|
891 |
+
*
|
892 |
+
* @access public
|
893 |
+
* @since 1.1.0
|
894 |
+
* @param array $data commentmeta results
|
895 |
+
* @return array | deleted commentmeta count.
|
896 |
+
*/
|
897 |
+
public function do_delete_commentmetas( $meta_results = array() ) {
|
898 |
+
$post_delete_count = 0;
|
899 |
+
|
900 |
+
if ( ! empty( $meta_results ) ){
|
901 |
+
|
902 |
+
foreach ($meta_results as $meta ) {
|
903 |
+
$comment_id = intval( $meta->comment_id );
|
904 |
+
if( $comment_id === 0 ) {
|
905 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->commentmeta WHERE comment_id = %d AND meta_key = %s", $comment_id, $meta->meta_key ) );
|
906 |
+
} else {
|
907 |
+
delete_comment_meta( $comment_id, $meta->meta_key );
|
908 |
+
}
|
909 |
+
}
|
910 |
+
$post_delete_count = number_format_i18n( sizeof( $meta_results ) );
|
911 |
+
|
912 |
+
}
|
913 |
+
return $post_delete_count;
|
914 |
+
}
|
915 |
+
|
916 |
+
/**
|
917 |
+
* Get usermeta Ids.
|
918 |
+
*
|
919 |
+
* @access public
|
920 |
+
* @since 1.1.0
|
921 |
+
* @param array $data Delete usermeta form data.
|
922 |
+
* @return array | Meta results.
|
923 |
+
*/
|
924 |
+
public function get_delete_usermeta_ids( $data = array() ) {
|
925 |
+
global $wpdb;
|
926 |
+
if( $data['custom_field_key'] != '' && !empty( $data['delete_user_roles'] ) ){
|
927 |
+
|
928 |
+
$delete_user_roles = isset( $data['delete_user_roles'] ) ? $data['delete_user_roles'] : array();
|
929 |
+
$delete_start_date = isset( $data['delete_start_date'] ) ? esc_sql( $data['delete_start_date'] ) : '';
|
930 |
+
$delete_end_date = isset( $data['delete_end_date'] ) ? esc_sql( $data['delete_end_date'] ) : '';
|
931 |
+
$date_type = isset( $data['date_type'] ) ? esc_sql( $data['date_type'] ) : 'custom_date';
|
932 |
+
$input_days = isset( $data['input_days'] ) ? esc_sql( $data['input_days'] ) : '';
|
933 |
+
if( $date_type === 'older_than') {
|
934 |
+
$delete_start_date = $delete_end_date = '';
|
935 |
+
if( $input_days === "0" || $input_days > 0){
|
936 |
+
$delete_end_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
937 |
+
}
|
938 |
+
} else if( $date_type === 'within_last') {
|
939 |
+
$delete_start_date = $delete_end_date = '';
|
940 |
+
if( $input_days === "0" || $input_days > 0){
|
941 |
+
$delete_start_date = date('Y-m-d', strtotime("-{$input_days} days", strtotime(current_time('Y-m-d'))));
|
942 |
+
}
|
943 |
+
}
|
944 |
+
|
945 |
+
$userquery = "SELECT DISTINCT $wpdb->users.ID FROM $wpdb->users ";
|
946 |
+
|
947 |
+
if( !empty( $delete_user_roles ) ){
|
948 |
+
$i = 1;
|
949 |
+
foreach ($delete_user_roles as $delete_user_role ) {
|
950 |
+
$userquery .= " INNER JOIN $wpdb->usermeta AS mt{$i} ON ( $wpdb->users.ID = mt{$i}.user_id )";
|
951 |
+
$i++;
|
952 |
+
}
|
953 |
+
}
|
954 |
+
$userquery .= " WHERE 1 = 1";
|
955 |
+
if( !empty( $delete_user_roles ) ){
|
956 |
+
$j = 1;
|
957 |
+
$subquery = array();
|
958 |
+
foreach ($delete_user_roles as $delete_user_role ) {
|
959 |
+
$subquery[]= "( mt{$j}.meta_key = '{$wpdb->prefix}capabilities' AND mt{$j}.meta_value LIKE '%\"{$delete_user_role}\"%' )";
|
960 |
+
$j++;
|
961 |
+
}
|
962 |
+
$subquery = implode( ' OR ', $subquery );
|
963 |
+
$userquery .= " AND ( {$subquery} )";
|
964 |
+
}
|
965 |
+
|
966 |
+
// User Query Generation.
|
967 |
+
if( $delete_start_date != '' || $delete_end_date != '' ){
|
968 |
+
|
969 |
+
if( $delete_start_date != '' ){
|
970 |
+
$userquery .= " AND ( $wpdb->users.user_registered >= '{$delete_start_date} 00:00:00' )";
|
971 |
+
}
|
972 |
+
if( $delete_end_date != '' ){
|
973 |
+
$userquery .= " AND ( $wpdb->users.user_registered <= '{$delete_end_date} 23:59:59' )";
|
974 |
+
}
|
975 |
+
}
|
976 |
+
|
977 |
+
$metaQuery = $metaWhere = "";
|
978 |
+
$metaWhere = $this->get_meta_where( $data );
|
979 |
+
|
980 |
+
if( $metaWhere != '' ){
|
981 |
+
$metaQuery = "SELECT user_id, meta_key FROM $wpdb->usermeta WHERE user_id IN ( {$userquery} ) AND ( {$metaWhere} )";
|
982 |
+
|
983 |
+
}else{
|
984 |
+
return array();
|
985 |
+
}
|
986 |
+
|
987 |
+
if( $metaQuery == '' ){
|
988 |
+
return array();
|
989 |
+
}
|
990 |
+
$meta_results = $wpdb->get_results( $metaQuery );
|
991 |
+
return $meta_results;
|
992 |
+
|
993 |
+
}else{
|
994 |
+
return array();
|
995 |
+
}
|
996 |
+
}
|
997 |
+
|
998 |
+
/**
|
999 |
+
* Do Delete operation on usermetas.
|
1000 |
+
*
|
1001 |
+
* @access public
|
1002 |
+
* @since 1.1.0
|
1003 |
+
* @param array $data usermeta results
|
1004 |
+
* @return array | deleted usermeta count.
|
1005 |
+
*/
|
1006 |
+
public function do_delete_usermetas( $meta_results = array() ) {
|
1007 |
+
$usermeta_delete_count = 0;
|
1008 |
+
if ( ! empty( $meta_results ) ){
|
1009 |
+
|
1010 |
+
foreach ($meta_results as $meta ) {
|
1011 |
+
$user_id = intval( $meta->user_id );
|
1012 |
+
if( $user_id === 0 ) {
|
1013 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta->meta_key ) );
|
1014 |
+
} else {
|
1015 |
+
delete_user_meta( $user_id, $meta->meta_key );
|
1016 |
+
}
|
1017 |
+
}
|
1018 |
+
$usermeta_delete_count = number_format_i18n( sizeof( $meta_results ) );
|
1019 |
+
|
1020 |
+
}
|
1021 |
+
return $usermeta_delete_count;
|
1022 |
+
}
|
1023 |
+
|
1024 |
+
/**
|
1025 |
+
* Get delete Term count.
|
1026 |
+
*
|
1027 |
+
* @access public
|
1028 |
+
* @since 1.1.0
|
1029 |
+
* @param array $data Delete terms form data.
|
1030 |
+
* @return int | Term count.
|
1031 |
+
*/
|
1032 |
+
public function get_delete_term_count( $data = array() ){
|
1033 |
+
|
1034 |
+
if( $data['delete_post_type'] == '' && $data['post_taxonomy'] == '' ){
|
1035 |
+
return 0;
|
1036 |
+
}
|
1037 |
+
|
1038 |
+
return $numTerms = wp_count_terms( $data['post_taxonomy'], array( 'hide_empty'=> false ) );
|
1039 |
+
|
1040 |
+
}
|
1041 |
+
|
1042 |
+
/**
|
1043 |
+
* Do Delete operation on taxonomy terms.
|
1044 |
+
*
|
1045 |
+
* @access public
|
1046 |
+
* @since 1.1.0
|
1047 |
+
* @param array $data Delete terms form data.
|
1048 |
+
* @return array | deleted terms count.
|
1049 |
+
*/
|
1050 |
+
public function do_delete_terms( $data = array() ) {
|
1051 |
+
$terms_delete_count = 0;
|
1052 |
+
if ( ! empty( $data ) ){
|
1053 |
+
|
1054 |
+
if( $data['delete_post_type'] == '' || $data['post_taxonomy'] == '' ){
|
1055 |
+
return $terms_delete_count;
|
1056 |
+
}
|
1057 |
+
|
1058 |
+
$terms = get_terms( $data['post_taxonomy'], array( 'fields' => 'ids', 'hide_empty' => false ) );
|
1059 |
+
foreach ( $terms as $value ) {
|
1060 |
+
wp_delete_term( $value, $data['post_taxonomy'] );
|
1061 |
+
}
|
1062 |
+
$terms_delete_count = number_format_i18n( sizeof( $terms ) );
|
1063 |
+
}
|
1064 |
+
return $terms_delete_count;
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
/**
|
1068 |
+
* Generate WHERE condition for meta delete.
|
1069 |
+
*
|
1070 |
+
* @access public
|
1071 |
+
* @since 1.1.0
|
1072 |
+
* @param array $data Delete form data.
|
1073 |
+
* @return string | WHERE Condition for query.
|
1074 |
+
*/
|
1075 |
+
function get_meta_where( $data ){
|
1076 |
+
// Costomfields
|
1077 |
+
$custom_field_key = ( $data['custom_field_key'] ) ? esc_sql( $data['custom_field_key'] ) : '';
|
1078 |
+
$custom_field_value = ( $data['custom_field_value'] ) ? esc_sql( $data['custom_field_value'] ) : '';
|
1079 |
+
$custom_field_compare = ( $data['custom_field_compare'] ) ? $data['custom_field_compare'] : 'equal_to_str';
|
1080 |
+
$metaWhere = '';
|
1081 |
+
|
1082 |
+
if ( $custom_field_key != '' ) {
|
1083 |
+
$metaWhere .= "( meta_key = '" . $custom_field_key. "'";
|
1084 |
+
|
1085 |
+
if( $custom_field_compare != '' && $custom_field_value != '' ){
|
1086 |
+
switch ( $custom_field_compare ) {
|
1087 |
+
case 'equal_to_str':
|
1088 |
+
$metaWhere .= " AND meta_value = '{$custom_field_value}' )";
|
1089 |
+
break;
|
1090 |
+
|
1091 |
+
case 'notequal_to_str':
|
1092 |
+
$metaWhere .= " AND meta_value != '{$custom_field_value}' )";
|
1093 |
+
break;
|
1094 |
+
|
1095 |
+
case 'like_str':
|
1096 |
+
$metaWhere .= " AND meta_value LIKE '%{$custom_field_value}%' )";
|
1097 |
+
break;
|
1098 |
+
|
1099 |
+
case 'notlike_str':
|
1100 |
+
$metaWhere .= " AND meta_value NOT LIKE '%{$custom_field_value}%' )";
|
1101 |
+
break;
|
1102 |
+
|
1103 |
+
case 'equal_to_date':
|
1104 |
+
$metaWhere .= " AND CAST(meta_value AS DATE) = '{$custom_field_value}' )";
|
1105 |
+
break;
|
1106 |
+
|
1107 |
+
case 'notequal_to_date':
|
1108 |
+
$metaWhere .= " AND CAST(meta_value AS DATE) != '{$custom_field_value}' )";
|
1109 |
+
break;
|
1110 |
+
|
1111 |
+
case 'lessthen_date':
|
1112 |
+
$metaWhere .= " AND CAST(meta_value AS DATE) < '{$custom_field_value}' )";
|
1113 |
+
break;
|
1114 |
+
|
1115 |
+
case 'lessthenequal_date':
|
1116 |
+
$metaWhere .= " AND CAST(meta_value AS DATE) <= '{$custom_field_value}' )";
|
1117 |
+
break;
|
1118 |
+
|
1119 |
+
case 'greaterthen_date':
|
1120 |
+
$metaWhere .= " AND CAST(meta_value AS DATE) > '{$custom_field_value}' )";
|
1121 |
+
break;
|
1122 |
+
|
1123 |
+
case 'greaterthenequal_date':
|
1124 |
+
$metaWhere .= " AND CAST(meta_value AS DATE) >= '{$custom_field_value}' )";
|
1125 |
+
break;
|
1126 |
+
|
1127 |
+
case 'equal_to_number':
|
1128 |
+
$metaWhere .= " AND CAST(meta_value AS SIGNED) = '{$custom_field_value}' )";
|
1129 |
+
break;
|
1130 |
+
|
1131 |
+
case 'notequal_to_number':
|
1132 |
+
$metaWhere .= " AND CAST(meta_value AS SIGNED) != '{$custom_field_value}' )";
|
1133 |
+
break;
|
1134 |
+
|
1135 |
+
case 'lessthen_number':
|
1136 |
+
$metaWhere .= " AND CAST(meta_value AS SIGNED) < '{$custom_field_value}' )";
|
1137 |
+
break;
|
1138 |
+
|
1139 |
+
case 'lessthenequal_number':
|
1140 |
+
$metaWhere .= " AND CAST(meta_value AS SIGNED) <= '{$custom_field_value}' )";
|
1141 |
+
break;
|
1142 |
+
|
1143 |
+
case 'greaterthen_number':
|
1144 |
+
$metaWhere .= " AND CAST(meta_value AS SIGNED) > '{$custom_field_value}' )";
|
1145 |
+
break;
|
1146 |
+
|
1147 |
+
case 'greaterthenequal_number':
|
1148 |
+
$metaWhere .= " AND CAST(meta_value AS SIGNED) >= '{$custom_field_value}' )";
|
1149 |
+
break;
|
1150 |
+
|
1151 |
+
default:
|
1152 |
+
$metaWhere .= " AND meta_value = '{$custom_field_value}' )";
|
1153 |
+
break;
|
1154 |
+
}
|
1155 |
+
}else{
|
1156 |
+
$metaWhere .=" )";
|
1157 |
+
}
|
1158 |
+
}
|
1159 |
+
return $metaWhere;
|
1160 |
+
}
|
1161 |
+
|
1162 |
+
/**
|
1163 |
+
* Get Plugin array
|
1164 |
+
*
|
1165 |
+
* @since 1.1.0
|
1166 |
+
* @return array
|
1167 |
+
*/
|
1168 |
+
public function get_xyuls_themes_plugins(){
|
1169 |
+
return array(
|
1170 |
+
'wp-event-aggregator' => esc_html__( 'WP Event Aggregator', 'wp-bulk-delete' ),
|
1171 |
+
'import-facebook-events' => esc_html__( 'Import Facebook Events', 'wp-bulk-delete' ),
|
1172 |
+
'import-eventbrite-events' => esc_html__( 'Import Eventbrite Events', 'wp-bulk-delete' ),
|
1173 |
+
'import-meetup-events' => esc_html__( 'Import Meetup Events', 'wp-bulk-delete' ),
|
1174 |
+
'event-schema' => esc_html__( 'Event Schema / Structured Data', 'wp-bulk-delete' ),
|
1175 |
+
);
|
1176 |
+
}
|
1177 |
+
|
1178 |
+
/**
|
1179 |
+
* Get Plugin Details.
|
1180 |
+
*
|
1181 |
+
* @since 1.1.0
|
1182 |
+
* @return array
|
1183 |
+
*/
|
1184 |
+
public function get_wporg_plugin( $slug ){
|
1185 |
+
|
1186 |
+
if( $slug == '' ){
|
1187 |
+
return false;
|
1188 |
+
}
|
1189 |
+
|
1190 |
+
$transient_name = 'support_plugin_box'.$slug;
|
1191 |
+
$plugin_data = get_transient( $transient_name );
|
1192 |
+
if( false === $plugin_data ){
|
1193 |
+
if ( ! function_exists( 'plugins_api' ) ) {
|
1194 |
+
include_once ABSPATH . '/wp-admin/includes/plugin-install.php';
|
1195 |
+
}
|
1196 |
+
|
1197 |
+
$plugin_data = plugins_api( 'plugin_information', array(
|
1198 |
+
'slug' => $slug,
|
1199 |
+
'is_ssl' => is_ssl(),
|
1200 |
+
'fields' => array(
|
1201 |
+
'banners' => true,
|
1202 |
+
'active_installs' => true,
|
1203 |
+
),
|
1204 |
+
) );
|
1205 |
+
|
1206 |
+
if ( ! is_wp_error( $plugin_data ) ) {
|
1207 |
+
set_transient( $transient_name, $plugin_data, 24 * HOUR_IN_SECONDS );
|
1208 |
+
} else {
|
1209 |
+
// If there was a bug on the Current Request just leave
|
1210 |
+
return false;
|
1211 |
+
}
|
1212 |
+
}
|
1213 |
+
return $plugin_data;
|
1214 |
+
}
|
1215 |
+
}
|
includes/class-wpbd-plugin-deactivation.php
ADDED
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Deactivation Class
|
4 |
+
* Collects Feedback from user about deactivation
|
5 |
+
*
|
6 |
+
* @package Xylus_Plugin_Deactivation
|
7 |
+
* @copyright Copyright (c) 2021, Xylus Themes
|
8 |
+
* @since 1.0.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly.
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
13 |
+
exit;
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* The admin-specific functionality of the plugin.
|
18 |
+
*
|
19 |
+
* @package WP_Bulk_Delete
|
20 |
+
* @subpackage WP_Bulk_Delete/admin
|
21 |
+
* @author Dharmesh Patel <dspatel44@gmail.com>
|
22 |
+
*/
|
23 |
+
if ( ! class_exists( 'WPBD_Plugin_Deactivation' ) ) {
|
24 |
+
class WPBD_Plugin_Deactivation {
|
25 |
+
|
26 |
+
private $prefix = 'wpbd_';
|
27 |
+
private $slug = 'wp-bulk-delete';
|
28 |
+
private $plugin_name;
|
29 |
+
private $plugin_version = '1.0.0';
|
30 |
+
private $api_url = 'https://api.xylusthemes.com/api/v1/';
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Initialize the class and set its properties.
|
34 |
+
*
|
35 |
+
* @since 1.0.0
|
36 |
+
*/
|
37 |
+
public function __construct() {
|
38 |
+
$this->plugin_name = __('WP Bulk Delete', 'wp-bulk-delete' );
|
39 |
+
if ( defined( 'WPBD_VERSION' ) ) {
|
40 |
+
$this->plugin_version = WPBD_VERSION;
|
41 |
+
}
|
42 |
+
|
43 |
+
add_action( 'admin_footer', array( $this, 'deactivation_feedback_form') );
|
44 |
+
add_action( 'wp_ajax_'.$this->prefix.'plugin_deactivation_feedback', array( $this, 'submit_plugin_deactivation_feedback') );
|
45 |
+
}
|
46 |
+
|
47 |
+
public function get_deactivation_reasons() {
|
48 |
+
return array(
|
49 |
+
'confusing' => __('I couldn\'t understand how to make it work', 'wp-bulk-delete' ),
|
50 |
+
'better_plugin' => __('I found a better plugin', 'wp-bulk-delete' ),
|
51 |
+
'feature_request' => __('The plugin is great, but I need specific feature that you don\'t support', 'wp-bulk-delete' ),
|
52 |
+
'buggy' => __('Plugin has bugs and it\'s not working', 'wp-bulk-delete' ),
|
53 |
+
'wrong_plugin' => __('It\'s not what I was looking for', 'wp-bulk-delete' ),
|
54 |
+
'not_working' => __('Plugin didn\'t work as expected', 'wp-bulk-delete' ),
|
55 |
+
'temporary' => __('It\'s temporary deactivatation, for debug an issue', 'wp-bulk-delete' ),
|
56 |
+
'other' => __('Other reasons', 'wp-bulk-delete' ),
|
57 |
+
);
|
58 |
+
}
|
59 |
+
|
60 |
+
function generate_ticket(){
|
61 |
+
$url = $this->api_url.'generateTicket';
|
62 |
+
$user = wp_get_current_user();
|
63 |
+
$headers = array( 'Content-Type' => 'application/json' );
|
64 |
+
$args = array(
|
65 |
+
'method' =>'POST',
|
66 |
+
'body' => json_encode(array('customer_email' => $user->user_email )),
|
67 |
+
'blocking' => true,
|
68 |
+
'headers' => $headers,
|
69 |
+
);
|
70 |
+
|
71 |
+
$response = wp_remote_post( $url, $args );
|
72 |
+
if ( is_wp_error( $response ) ) {
|
73 |
+
return false;
|
74 |
+
}
|
75 |
+
|
76 |
+
return wp_remote_retrieve_body($response);
|
77 |
+
}
|
78 |
+
|
79 |
+
function submit_plugin_deactivation_feedback(){
|
80 |
+
if ( !wp_verify_nonce( $_REQUEST['nonce'], $this->prefix.'plugin_deactivation_feedback')) {
|
81 |
+
exit("nonce verification failed");
|
82 |
+
}
|
83 |
+
|
84 |
+
$url = $this->api_url.'feedback';
|
85 |
+
$credentials = $this->generate_ticket();
|
86 |
+
if(!$credentials){
|
87 |
+
die();
|
88 |
+
}
|
89 |
+
|
90 |
+
$credentials = json_decode($credentials);
|
91 |
+
$user = wp_get_current_user();
|
92 |
+
$timestamp = $credentials->timestamp;
|
93 |
+
$client_id = $credentials->client_id;
|
94 |
+
$client_secret = $credentials->client_secret;
|
95 |
+
$customer_email = $user->user_email;
|
96 |
+
$customer_name = $user->display_name;
|
97 |
+
if(empty($customer_name)){
|
98 |
+
$customer_name = $user->user_firstname. ' '.$user->user_lastname;
|
99 |
+
}
|
100 |
+
$deactivation_reason = sanitize_text_field( $_REQUEST['reason'] );
|
101 |
+
$deactivation_reason_message = $this->get_deactivation_reasons()[$deactivation_reason];
|
102 |
+
$customer_query = sanitize_text_field( $_REQUEST['customerQuery'] );
|
103 |
+
|
104 |
+
$data = array(
|
105 |
+
"type" => "plugin_deactivation",
|
106 |
+
"site_url" => get_site_url(),
|
107 |
+
"customer_name" => $customer_name,
|
108 |
+
"customer_email" => $customer_email,
|
109 |
+
"plugin" => $this->slug,
|
110 |
+
"plugin_name" => $this->plugin_name,
|
111 |
+
"plugin_version" => $this->plugin_version,
|
112 |
+
"plugin_version" => $this->plugin_version,
|
113 |
+
"deactivation_reason" => $deactivation_reason,
|
114 |
+
"deactivation_reason_message" => $deactivation_reason_message,
|
115 |
+
"query" => $customer_query
|
116 |
+
);
|
117 |
+
|
118 |
+
$plain_string = $customer_email . $timestamp . $client_secret;
|
119 |
+
$sha512_hash = hash("sha512", $plain_string);
|
120 |
+
|
121 |
+
$body = json_encode($data);
|
122 |
+
$headers = array( 'Content-Type' => 'application/json');
|
123 |
+
$headers['Client-Id'] = $client_id;
|
124 |
+
$headers['Timestamp'] = $timestamp;
|
125 |
+
$headers['Authorization'] = $sha512_hash;
|
126 |
+
$args = array(
|
127 |
+
'method' =>'POST',
|
128 |
+
'body' => $body,
|
129 |
+
'blocking' => true,
|
130 |
+
'headers' => $headers
|
131 |
+
);
|
132 |
+
$response = wp_remote_post( $url, $args );
|
133 |
+
if ( is_wp_error( $response ) ) {
|
134 |
+
$error_message = $response->get_error_message();
|
135 |
+
echo "Something went wrong: $error_message";
|
136 |
+
exit();
|
137 |
+
}
|
138 |
+
|
139 |
+
die(true);
|
140 |
+
}
|
141 |
+
|
142 |
+
public function deactivation_feedback_form() {
|
143 |
+
$wp_screen = get_current_screen();
|
144 |
+
$page_id = $wp_screen->id;
|
145 |
+
|
146 |
+
// Load only for WP admin plugins page
|
147 |
+
if($page_id !== 'plugins'){
|
148 |
+
return;
|
149 |
+
}
|
150 |
+
wp_enqueue_style( 'wp-jquery-ui-dialog');
|
151 |
+
wp_enqueue_script( 'jquery-ui-dialog');
|
152 |
+
|
153 |
+
$deactivate_reasons = $this->get_deactivation_reasons();
|
154 |
+
?>
|
155 |
+
|
156 |
+
<script>
|
157 |
+
jQuery(document).ready(function() {
|
158 |
+
var dataReason = jQuery('input:radio[name="<?php echo $this->prefix; ?>deactivatation_reason_radio"]').val();
|
159 |
+
jQuery('a[aria-label="Deactivate WP Bulk Delete"]').on('click', function (e) {
|
160 |
+
e.preventDefault();
|
161 |
+
var pluginDeactivateURL = jQuery(this).attr('href');
|
162 |
+
jQuery('#<?php echo $this->slug; ?>-deactivate-dialog' ).dialog({
|
163 |
+
'dialogClass' : '<?php echo $this->slug . "-deactivate-dialog"; ?>',
|
164 |
+
'modal' : true,
|
165 |
+
'closeOnEscape' : true,
|
166 |
+
width: 600,
|
167 |
+
'buttons' : [
|
168 |
+
{
|
169 |
+
text: "<?php _e('Submit & Deactivate', 'wp-bulk-delete' ); ?>",
|
170 |
+
class: 'button button-primary <?php echo $this->prefix . "deactivate_button"; ?>',
|
171 |
+
click: function() {
|
172 |
+
var that = this;
|
173 |
+
var dataQuery = jQuery('#<?php echo $this->prefix; ?>customer_query').val();
|
174 |
+
if(dataReason == 'other' && !dataQuery){
|
175 |
+
jQuery('#<?php echo $this->prefix; ?>customer_query').focus();
|
176 |
+
return false;
|
177 |
+
}
|
178 |
+
jQuery('#<?php echo $this->prefix; ?>deactivatation_form').hide();
|
179 |
+
jQuery('.<?php echo $this->prefix; ?>deactivatation_loading').show();
|
180 |
+
jQuery('button.<?php echo $this->prefix; ?>deactivate_button').prop('disabled', true);
|
181 |
+
jQuery.ajax({
|
182 |
+
type : "post",
|
183 |
+
dataType : "json",
|
184 |
+
url : "<?php echo admin_url('admin-ajax.php?action='.$this->prefix.'plugin_deactivation_feedback&nonce='.wp_create_nonce($this->prefix.'plugin_deactivation_feedback')); ?>",
|
185 |
+
data : {
|
186 |
+
action: "<?php echo $this->prefix; ?>plugin_deactivation_feedback",
|
187 |
+
reason: dataReason,
|
188 |
+
customerQuery: dataQuery
|
189 |
+
},
|
190 |
+
}).always( function(){
|
191 |
+
jQuery( that ).dialog( "close" );
|
192 |
+
window.location.href=pluginDeactivateURL;
|
193 |
+
});
|
194 |
+
}
|
195 |
+
},
|
196 |
+
{
|
197 |
+
text: "<?php _e('Skip', 'wp-bulk-delete' ); ?>",
|
198 |
+
class: 'button',
|
199 |
+
click: function() {
|
200 |
+
jQuery( this ).dialog( "close" );
|
201 |
+
window.location.href=pluginDeactivateURL;
|
202 |
+
}
|
203 |
+
}
|
204 |
+
]
|
205 |
+
});
|
206 |
+
});
|
207 |
+
|
208 |
+
jQuery('input:radio[name="<?php echo $this->prefix; ?>deactivatation_reason_radio"]').click(function () {
|
209 |
+
var reason = jQuery(this).val();
|
210 |
+
dataReason = jQuery(this).val();
|
211 |
+
var customerQuery = jQuery('#<?php echo $this->prefix; ?>customer_query');
|
212 |
+
customerQuery.removeAttr('required');
|
213 |
+
if (reason === "confusing") {
|
214 |
+
customerQuery.attr("placeholder", "<?php _e('Finding it confusing? let us know so that we can improve the interface', 'wp-bulk-delete' ); ?>");
|
215 |
+
|
216 |
+
} else if (reason === "other") {
|
217 |
+
customerQuery.attr("placeholder", "<?php _e('Can you let us know the reason for deactivation (Required)', 'wp-bulk-delete' ); ?>");
|
218 |
+
customerQuery.prop('required', true);
|
219 |
+
|
220 |
+
} else if (reason === "buggy" || reason === 'not_working') {
|
221 |
+
customerQuery.attr("placeholder", "<?php _e('Can you please let us know about the bug/issue in detail?', 'wp-bulk-delete' ); ?>");
|
222 |
+
|
223 |
+
} else if (reason === "better_plugin") {
|
224 |
+
customerQuery.attr("placeholder", "<?php _e('Can you please let us know which plugin you found helpful', 'wp-bulk-delete' ); ?>");
|
225 |
+
|
226 |
+
} else if (reason === "feature_request") {
|
227 |
+
customerQuery.attr("placeholder", "<?php _e('Can you please let us know more about the feature you want', 'wp-bulk-delete' ); ?>");
|
228 |
+
|
229 |
+
} else if (reason === "wrong_plugins") {
|
230 |
+
customerQuery.attr("placeholder", "<?php _e('Can you please let us know more about your requirement', 'wp-bulk-delete' ); ?>");
|
231 |
+
|
232 |
+
} else if (reason === "temporary") {
|
233 |
+
customerQuery.attr("placeholder", "<?php _e('Write your query here', 'wp-bulk-delete'); ?>");
|
234 |
+
}
|
235 |
+
});
|
236 |
+
});
|
237 |
+
</script>
|
238 |
+
<style>
|
239 |
+
<?php echo '.'.$this->slug; ?>-deactivate-dialog .ui-dialog-titlebar{
|
240 |
+
display: none;
|
241 |
+
}
|
242 |
+
.ui-widget.<?php echo $this->slug; ?>-deactivate-dialog{
|
243 |
+
font-family: inherit;
|
244 |
+
font-size: 14px;
|
245 |
+
font-weight: inherit;
|
246 |
+
line-height: inherit;
|
247 |
+
}
|
248 |
+
.ui-widget.<?php echo $this->slug; ?>-deactivate-dialog textarea{
|
249 |
+
font-family: inherit;
|
250 |
+
font-size: 14px;
|
251 |
+
width: 100%;
|
252 |
+
}
|
253 |
+
<?php echo '#'.$this->slug; ?>-deactivate-dialog {
|
254 |
+
display : none;
|
255 |
+
}
|
256 |
+
</style>
|
257 |
+
<div id="<?php echo $this->slug; ?>-deactivate-dialog">
|
258 |
+
<h3><?php _e('If you have a moment, please let us know why you are deactivating:', 'wp-bulk-delete'); ?></h3>
|
259 |
+
<form method="post" action="" id="<?php echo $this->prefix; ?>deactivatation_form">
|
260 |
+
<div>
|
261 |
+
<?php
|
262 |
+
foreach ( $deactivate_reasons as $key => $deactivate_reason ) {
|
263 |
+
?>
|
264 |
+
<div class="radio" style="padding:1px;margin-left:2%">
|
265 |
+
<label for="<?php echo $key; ?>">
|
266 |
+
<input type="radio" name="<?php echo $this->prefix; ?>deactivatation_reason_radio" id="<?php echo $key; ?>" value="<?php echo $key; ?>" required <?php if($key === 'confusing') { echo "checked"; } ?>> <?php echo $deactivate_reason; ?>
|
267 |
+
</label>
|
268 |
+
</div>
|
269 |
+
<?php } ?>
|
270 |
+
<br>
|
271 |
+
<textarea id="<?php echo $this->prefix; ?>customer_query" name="<?php echo $this->prefix; ?>customer_query" rows="4" placeholder="<?php _e('Write your query here', 'wp-bulk-delete'); ?>"></textarea>
|
272 |
+
</div>
|
273 |
+
</form>
|
274 |
+
<div class="<?php echo $this->prefix; ?>deactivatation_loading" style="width: 100%;text-align: center; display:none;">
|
275 |
+
<img src="<?php echo admin_url('images/spinner.gif'); ?>" />
|
276 |
+
</div>
|
277 |
+
</div>
|
278 |
+
<?php
|
279 |
+
}
|
280 |
+
}
|
281 |
+
}
|
282 |
+
|
283 |
+
new WPBD_Plugin_Deactivation();
|
includes/common-functions.php
CHANGED
@@ -1,187 +1,187 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Common functions
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Common functions
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Get Taxomomy from posttype.
|
17 |
-
*
|
18 |
-
* @since 1.0
|
19 |
-
* @param string $post_type Post Type
|
20 |
-
* @return array | taxonomy array
|
21 |
-
*/
|
22 |
-
function wpbd_get_taxonomy_by_posttype( $post_type = '' ) {
|
23 |
-
|
24 |
-
$taxonomies = array();
|
25 |
-
$ingnore_taxonomy = array( 'post_format' );
|
26 |
-
if ( $post_type != '' ) {
|
27 |
-
$taxonomy_objects = get_object_taxonomies( $post_type, 'objects' );
|
28 |
-
if( !empty( $taxonomy_objects ) ){
|
29 |
-
foreach( $taxonomy_objects as $slug => $taxonomy ){
|
30 |
-
if( in_array( $slug, $ingnore_taxonomy ) ){
|
31 |
-
continue;
|
32 |
-
}else{
|
33 |
-
$taxonomies[$slug] = $taxonomy->labels->name;
|
34 |
-
}
|
35 |
-
}
|
36 |
-
}
|
37 |
-
}
|
38 |
-
return $taxonomies;
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Get Taxomomy from posttype.
|
43 |
-
*
|
44 |
-
* @since 1.0
|
45 |
-
* @param string $posttype Post Type
|
46 |
-
* @return array | taxonomy array
|
47 |
-
*/
|
48 |
-
function wpbd_get_terms_by_taxonomy( $taxonomy = '' ) {
|
49 |
-
$terms = array();
|
50 |
-
if ( $taxonomy != '' ) {
|
51 |
-
if( taxonomy_exists( $taxonomy ) ){
|
52 |
-
$terms = get_terms( $taxonomy, array( 'hide_empty' => true ) );
|
53 |
-
}
|
54 |
-
}
|
55 |
-
return $terms;
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Display Admin Notices
|
60 |
-
*
|
61 |
-
* @since 1.0
|
62 |
-
* @param array $notice_result Status array
|
63 |
-
* @return void
|
64 |
-
*/
|
65 |
-
function wpbd_display_admin_notice( $notice_result = array() ) {
|
66 |
-
|
67 |
-
if ( ! empty( $notice_result ) && $notice_result['status'] == 1 ){
|
68 |
-
if( !empty( $notice_result['messages'] ) ){
|
69 |
-
foreach ( $notice_result['messages'] as $smessages ) {
|
70 |
-
?>
|
71 |
-
<div class="notice notice-success">
|
72 |
-
<p><strong><?php echo $smessages; ?></strong></p>
|
73 |
-
</div>
|
74 |
-
<?php
|
75 |
-
}
|
76 |
-
}
|
77 |
-
} elseif ( ! empty( $notice_result ) && $notice_result['status'] == 0 ){
|
78 |
-
|
79 |
-
if( !empty( $notice_result['messages'] ) ){
|
80 |
-
foreach ( $notice_result['messages'] as $emessages ) {
|
81 |
-
?>
|
82 |
-
<div class="notice notice-error">
|
83 |
-
<p><strong><?php echo $emessages; ?></strong></p>
|
84 |
-
</div>
|
85 |
-
<?php
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
}
|
90 |
-
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Display Admin Notices
|
94 |
-
*
|
95 |
-
* @since 1.0
|
96 |
-
* @param array $notice_result Status array
|
97 |
-
* @return void
|
98 |
-
*/
|
99 |
-
function wpbd_display_available_in_pro() {
|
100 |
-
if( !wpbd_is_pro() ) {
|
101 |
-
?>
|
102 |
-
<span style="color: red"><?php _e('Available in Pro version.','wp-bulk-delete'); ?></span>
|
103 |
-
<a href="<?php echo esc_url(WPBD_PLUGIN_BUY_NOW_URL); ?>"><?php _e('Buy Now','wp-bulk-delete'); ?></a>
|
104 |
-
<?php
|
105 |
-
}
|
106 |
-
}
|
107 |
-
add_action( 'wpbd_display_available_in_pro', 'wpbd_display_available_in_pro' );
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Return post count from posttype
|
111 |
-
*
|
112 |
-
* @since 1.0
|
113 |
-
* @return void
|
114 |
-
*/
|
115 |
-
function wpbd_get_posttype_post_count( $posttye ){
|
116 |
-
if( $posttye != '' ){
|
117 |
-
global $wpdb;
|
118 |
-
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_type = %s AND `post_status` NOT IN ('trash', 'auto-draft')", esc_attr( $posttye ) ) );
|
119 |
-
return $count;
|
120 |
-
}
|
121 |
-
return 0;
|
122 |
-
}
|
123 |
-
|
124 |
-
/**
|
125 |
-
* Save Scheduled delete
|
126 |
-
*
|
127 |
-
* @param {Array} $data
|
128 |
-
* @return {Array}
|
129 |
-
*/
|
130 |
-
function wpbd_save_scheduled_delete($data){
|
131 |
-
$scheduled = false;
|
132 |
-
$delete_datetime = ( $data['delete_datetime'] ) ? $data['delete_datetime'] : '';
|
133 |
-
$delete_frequency = ( $data['delete_frequency'] ) ? $data['delete_frequency'] : 'not_repeat';
|
134 |
-
$cron_time = strtotime($delete_datetime) - (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
|
135 |
-
if( $delete_frequency === 'not_repeat' ){
|
136 |
-
$scheduled = wp_schedule_single_event( $cron_time, 'wpbd_run_scheduled_delete', array($data));
|
137 |
-
} else {
|
138 |
-
$title = !empty( $data['schedule_name'] ) ? $data['schedule_name'] : __( 'Scheduled Delete - ', 'wp-bulk-delete' ) . ucfirst($data['delete_entity']);
|
139 |
-
$insert_args = array(
|
140 |
-
'post_type' => 'wpbd_scheduled',
|
141 |
-
'post_status' => 'publish',
|
142 |
-
'post_title' => $title,
|
143 |
-
);
|
144 |
-
|
145 |
-
$insert = wp_insert_post( $insert_args, true );
|
146 |
-
if ( is_wp_error( $insert ) ) {
|
147 |
-
return array(
|
148 |
-
'status' => 0,
|
149 |
-
'messages' => array( esc_html__( 'Something went wrong when saving scheduled delete.', 'wp-bulk-delete' ) ),
|
150 |
-
);
|
151 |
-
}
|
152 |
-
$data['wpbd_scheduled_id'] = $insert;
|
153 |
-
update_post_meta( $insert, 'delete_options', $data );
|
154 |
-
$scheduled = wp_schedule_event( $cron_time, $delete_frequency, 'wpbd_run_scheduled_delete', array('post_id' => $insert));
|
155 |
-
}
|
156 |
-
if( $scheduled) {
|
157 |
-
return array(
|
158 |
-
'status' => 1,
|
159 |
-
'messages' => array( esc_html__( 'Delete scheduled successfully.', 'wp-bulk-delete' ) )
|
160 |
-
);
|
161 |
-
}else{
|
162 |
-
return array(
|
163 |
-
'status' => 0,
|
164 |
-
'messages' => array( esc_html__( 'Error in scheduled delete.', 'wp-bulk-delete' ) ),
|
165 |
-
);
|
166 |
-
}
|
167 |
-
}
|
168 |
-
|
169 |
-
/**
|
170 |
-
* Function only for debuging
|
171 |
-
*
|
172 |
-
* @since 1.1
|
173 |
-
*/
|
174 |
-
function wp_p( $data, $exit = false ){
|
175 |
-
|
176 |
-
echo '<pre>';
|
177 |
-
if ( is_array( $data ) || is_object( $data ) ){
|
178 |
-
print_r( $data );
|
179 |
-
} else {
|
180 |
-
echo $data;
|
181 |
-
}
|
182 |
-
echo '</pre>';
|
183 |
-
if ( $exit ) {
|
184 |
-
exit();
|
185 |
-
}
|
186 |
-
|
187 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Common functions
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Common functions
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Get Taxomomy from posttype.
|
17 |
+
*
|
18 |
+
* @since 1.0
|
19 |
+
* @param string $post_type Post Type
|
20 |
+
* @return array | taxonomy array
|
21 |
+
*/
|
22 |
+
function wpbd_get_taxonomy_by_posttype( $post_type = '' ) {
|
23 |
+
|
24 |
+
$taxonomies = array();
|
25 |
+
$ingnore_taxonomy = array( 'post_format' );
|
26 |
+
if ( $post_type != '' ) {
|
27 |
+
$taxonomy_objects = get_object_taxonomies( $post_type, 'objects' );
|
28 |
+
if( !empty( $taxonomy_objects ) ){
|
29 |
+
foreach( $taxonomy_objects as $slug => $taxonomy ){
|
30 |
+
if( in_array( $slug, $ingnore_taxonomy ) ){
|
31 |
+
continue;
|
32 |
+
}else{
|
33 |
+
$taxonomies[$slug] = $taxonomy->labels->name;
|
34 |
+
}
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
return $taxonomies;
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Get Taxomomy from posttype.
|
43 |
+
*
|
44 |
+
* @since 1.0
|
45 |
+
* @param string $posttype Post Type
|
46 |
+
* @return array | taxonomy array
|
47 |
+
*/
|
48 |
+
function wpbd_get_terms_by_taxonomy( $taxonomy = '' ) {
|
49 |
+
$terms = array();
|
50 |
+
if ( $taxonomy != '' ) {
|
51 |
+
if( taxonomy_exists( $taxonomy ) ){
|
52 |
+
$terms = get_terms( $taxonomy, array( 'hide_empty' => true ) );
|
53 |
+
}
|
54 |
+
}
|
55 |
+
return $terms;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Display Admin Notices
|
60 |
+
*
|
61 |
+
* @since 1.0
|
62 |
+
* @param array $notice_result Status array
|
63 |
+
* @return void
|
64 |
+
*/
|
65 |
+
function wpbd_display_admin_notice( $notice_result = array() ) {
|
66 |
+
|
67 |
+
if ( ! empty( $notice_result ) && $notice_result['status'] == 1 ){
|
68 |
+
if( !empty( $notice_result['messages'] ) ){
|
69 |
+
foreach ( $notice_result['messages'] as $smessages ) {
|
70 |
+
?>
|
71 |
+
<div class="notice notice-success">
|
72 |
+
<p><strong><?php echo $smessages; ?></strong></p>
|
73 |
+
</div>
|
74 |
+
<?php
|
75 |
+
}
|
76 |
+
}
|
77 |
+
} elseif ( ! empty( $notice_result ) && $notice_result['status'] == 0 ){
|
78 |
+
|
79 |
+
if( !empty( $notice_result['messages'] ) ){
|
80 |
+
foreach ( $notice_result['messages'] as $emessages ) {
|
81 |
+
?>
|
82 |
+
<div class="notice notice-error">
|
83 |
+
<p><strong><?php echo $emessages; ?></strong></p>
|
84 |
+
</div>
|
85 |
+
<?php
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Display Admin Notices
|
94 |
+
*
|
95 |
+
* @since 1.0
|
96 |
+
* @param array $notice_result Status array
|
97 |
+
* @return void
|
98 |
+
*/
|
99 |
+
function wpbd_display_available_in_pro() {
|
100 |
+
if( !wpbd_is_pro() ) {
|
101 |
+
?>
|
102 |
+
<span style="color: red"><?php _e('Available in Pro version.','wp-bulk-delete'); ?></span>
|
103 |
+
<a href="<?php echo esc_url(WPBD_PLUGIN_BUY_NOW_URL); ?>"><?php _e('Buy Now','wp-bulk-delete'); ?></a>
|
104 |
+
<?php
|
105 |
+
}
|
106 |
+
}
|
107 |
+
add_action( 'wpbd_display_available_in_pro', 'wpbd_display_available_in_pro' );
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Return post count from posttype
|
111 |
+
*
|
112 |
+
* @since 1.0
|
113 |
+
* @return void
|
114 |
+
*/
|
115 |
+
function wpbd_get_posttype_post_count( $posttye ){
|
116 |
+
if( $posttye != '' ){
|
117 |
+
global $wpdb;
|
118 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_type = %s AND `post_status` NOT IN ('trash', 'auto-draft')", esc_attr( $posttye ) ) );
|
119 |
+
return $count;
|
120 |
+
}
|
121 |
+
return 0;
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Save Scheduled delete
|
126 |
+
*
|
127 |
+
* @param {Array} $data
|
128 |
+
* @return {Array}
|
129 |
+
*/
|
130 |
+
function wpbd_save_scheduled_delete($data){
|
131 |
+
$scheduled = false;
|
132 |
+
$delete_datetime = ( $data['delete_datetime'] ) ? $data['delete_datetime'] : '';
|
133 |
+
$delete_frequency = ( $data['delete_frequency'] ) ? $data['delete_frequency'] : 'not_repeat';
|
134 |
+
$cron_time = strtotime($delete_datetime) - (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
|
135 |
+
if( $delete_frequency === 'not_repeat' ){
|
136 |
+
$scheduled = wp_schedule_single_event( $cron_time, 'wpbd_run_scheduled_delete', array($data));
|
137 |
+
} else {
|
138 |
+
$title = !empty( $data['schedule_name'] ) ? $data['schedule_name'] : __( 'Scheduled Delete - ', 'wp-bulk-delete' ) . ucfirst($data['delete_entity']);
|
139 |
+
$insert_args = array(
|
140 |
+
'post_type' => 'wpbd_scheduled',
|
141 |
+
'post_status' => 'publish',
|
142 |
+
'post_title' => $title,
|
143 |
+
);
|
144 |
+
|
145 |
+
$insert = wp_insert_post( $insert_args, true );
|
146 |
+
if ( is_wp_error( $insert ) ) {
|
147 |
+
return array(
|
148 |
+
'status' => 0,
|
149 |
+
'messages' => array( esc_html__( 'Something went wrong when saving scheduled delete.', 'wp-bulk-delete' ) ),
|
150 |
+
);
|
151 |
+
}
|
152 |
+
$data['wpbd_scheduled_id'] = $insert;
|
153 |
+
update_post_meta( $insert, 'delete_options', $data );
|
154 |
+
$scheduled = wp_schedule_event( $cron_time, $delete_frequency, 'wpbd_run_scheduled_delete', array('post_id' => $insert));
|
155 |
+
}
|
156 |
+
if( $scheduled) {
|
157 |
+
return array(
|
158 |
+
'status' => 1,
|
159 |
+
'messages' => array( esc_html__( 'Delete scheduled successfully.', 'wp-bulk-delete' ) )
|
160 |
+
);
|
161 |
+
}else{
|
162 |
+
return array(
|
163 |
+
'status' => 0,
|
164 |
+
'messages' => array( esc_html__( 'Error in scheduled delete.', 'wp-bulk-delete' ) ),
|
165 |
+
);
|
166 |
+
}
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Function only for debuging
|
171 |
+
*
|
172 |
+
* @since 1.1
|
173 |
+
*/
|
174 |
+
function wp_p( $data, $exit = false ){
|
175 |
+
|
176 |
+
echo '<pre>';
|
177 |
+
if ( is_array( $data ) || is_object( $data ) ){
|
178 |
+
print_r( $data );
|
179 |
+
} else {
|
180 |
+
echo $data;
|
181 |
+
}
|
182 |
+
echo '</pre>';
|
183 |
+
if ( $exit ) {
|
184 |
+
exit();
|
185 |
+
}
|
186 |
+
|
187 |
}
|
includes/delele-comments-form-functions.php
CHANGED
@@ -1,245 +1,245 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Delete Comments Form Funcitons
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Delete Comments Form Funcitons
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
/** Actions *************************************************************/
|
15 |
-
add_action( 'wpbd_delete_comments_form', 'wpdb_render_delete_comments_status' );
|
16 |
-
add_action( 'wpbd_delete_comments_form', 'wpdb_render_delete_comments_users' );
|
17 |
-
add_action( 'wpbd_delete_comments_form', 'wpdb_render_delete_comments_posts' );
|
18 |
-
add_action( 'wpbd_delete_comments_form', 'wpdb_render_delete_comments_date_interval' );
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Process Delete Comments form
|
22 |
-
*
|
23 |
-
*
|
24 |
-
* @since 1.1.0
|
25 |
-
* @param array $data Form post Data.
|
26 |
-
* @return array | posts ID to be delete.
|
27 |
-
*/
|
28 |
-
function xt_delete_comments_form_process( $data ) {
|
29 |
-
$error = array();
|
30 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
31 |
-
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
32 |
-
}
|
33 |
-
if( empty( $data['delete_comment_status'] ) ){
|
34 |
-
$error[] = esc_html__('Please select Comment status for proceed delete operation.', 'wp-bulk-delete' );
|
35 |
-
}
|
36 |
-
|
37 |
-
if ( isset( $data['_delete_comments_wpnonce'] ) && wp_verify_nonce( $data['_delete_comments_wpnonce'], 'delete_comments_nonce' ) ) {
|
38 |
-
|
39 |
-
if( empty( $error ) ){
|
40 |
-
$delete_time = ( $data['delete_time'] ) ? $data['delete_time'] : 'now';
|
41 |
-
$delete_datetime = ( $data['delete_datetime'] ) ? $data['delete_datetime'] : '';
|
42 |
-
if( $delete_time === 'scheduled' && !empty($delete_datetime) && wpbd_is_pro() ) {
|
43 |
-
$data['delete_entity'] = 'comment';
|
44 |
-
return wpbd_save_scheduled_delete($data);
|
45 |
-
}
|
46 |
-
|
47 |
-
$comment_count = wpbulkdelete()->api->do_delete_comments( $data );
|
48 |
-
if( false === $comment_count ){
|
49 |
-
return array(
|
50 |
-
'status' => 0,
|
51 |
-
'messages' => array( esc_html__( 'Something went wrong pelase try again!!', 'wp-bulk-delete' ) ),
|
52 |
-
);
|
53 |
-
}
|
54 |
-
|
55 |
-
if ( ! empty( $comment_count ) && $comment_count > 0 ) {
|
56 |
-
return array(
|
57 |
-
'status' => 1,
|
58 |
-
'messages' => array( sprintf( esc_html__( '%d comment(s) deleted successfully.', 'wp-bulk-delete' ), $comment_count )
|
59 |
-
) );
|
60 |
-
} else {
|
61 |
-
return array(
|
62 |
-
'status' => 1,
|
63 |
-
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
64 |
-
);
|
65 |
-
}
|
66 |
-
|
67 |
-
} else {
|
68 |
-
return array(
|
69 |
-
'status' => 0,
|
70 |
-
'messages' => $error,
|
71 |
-
);
|
72 |
-
}
|
73 |
-
|
74 |
-
} else {
|
75 |
-
wp_die( esc_html__( 'Sorry, Your nonce did not verify.', 'wp-bulk-delete' ) );
|
76 |
-
}
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Render Userroles checkboxes.
|
81 |
-
*
|
82 |
-
* @since 1.1.0
|
83 |
-
* @return void
|
84 |
-
*/
|
85 |
-
function wpdb_render_delete_comments_status(){
|
86 |
-
$comment_status = array(
|
87 |
-
'pending' => __( 'Pending Comments', 'wp-bulk-delete'),
|
88 |
-
'spam' => __( 'Spam Comments', 'wp-bulk-delete'),
|
89 |
-
'trash' => __( 'Trash Comments', 'wp-bulk-delete'),
|
90 |
-
'approved' => __( 'Approved Comments', 'wp-bulk-delete'),
|
91 |
-
);
|
92 |
-
|
93 |
-
?>
|
94 |
-
<tr>
|
95 |
-
<th scope="row">
|
96 |
-
<?php _e( 'Comment Status', 'wp-bulk-delete' ); ?> :
|
97 |
-
</th>
|
98 |
-
|
99 |
-
<td>
|
100 |
-
<?php
|
101 |
-
if( ! empty( $comment_status ) ){
|
102 |
-
foreach ($comment_status as $comment_status_value => $comment_status_name ) {
|
103 |
-
?>
|
104 |
-
<input name="delete_comment_status[]" class="delete_comment_status" id="comment_status_<?php echo $comment_status_value; ?>" type="checkbox" value="<?php echo $comment_status_value; ?>" >
|
105 |
-
<label for="comment_status_<?php echo $comment_status_value; ?>">
|
106 |
-
<?php echo $comment_status_name . ' ' . sprintf( __( '( %s Comment(s) )', 'wp-bulk-delete' ), wpbulkdelete()->api->get_comment_count( $comment_status_value ) ); ?>
|
107 |
-
</label>
|
108 |
-
<br/>
|
109 |
-
<?php
|
110 |
-
}
|
111 |
-
}
|
112 |
-
?>
|
113 |
-
<p class="description">
|
114 |
-
<?php _e('Select the comment statuses which you want to delete.','wp-bulk-delete'); ?>
|
115 |
-
</p>
|
116 |
-
</td>
|
117 |
-
</tr>
|
118 |
-
<?php
|
119 |
-
}
|
120 |
-
|
121 |
-
|
122 |
-
/**
|
123 |
-
* Render User registration date interval.
|
124 |
-
*
|
125 |
-
* @since 1.0
|
126 |
-
* @return void
|
127 |
-
*/
|
128 |
-
function wpdb_render_delete_comments_date_interval(){
|
129 |
-
?>
|
130 |
-
<tr>
|
131 |
-
<th scope="row">
|
132 |
-
<?php _e('Comment Date :','wp-bulk-delete'); ?>
|
133 |
-
</th>
|
134 |
-
<td>
|
135 |
-
<?php _e('Delete Comments which are','wp-bulk-delete'); ?>
|
136 |
-
<select name="date_type" class="date_type">
|
137 |
-
<option value="older_than"><?php _e('older than','wp-bulk-delete'); ?></option>
|
138 |
-
<option value="within_last"><?php _e('submitted within last','wp-bulk-delete'); ?></option>
|
139 |
-
<option value="custom_date"><?php _e('submitted between','wp-bulk-delete'); ?></option>
|
140 |
-
</select>
|
141 |
-
<div class="wpbd_date_days wpbd_inline">
|
142 |
-
<input type="number" id="input_days" name="input_days" class="wpbd_input_days" placeholder="0" min="0" /> <?php _e('days','wp-bulk-delete'); ?>
|
143 |
-
</div>
|
144 |
-
<div class="wpbd_custom_interval wpbd_inline" style="display:none;">
|
145 |
-
<input type="text" id="delete_start_date" name="delete_start_date" class="delete_all_datepicker" placeholder="<?php _e('Start Date','wp-bulk-delete'); ?>" />
|
146 |
-
-
|
147 |
-
<input type="text" id="delete_end_date" name="delete_end_date" class="delete_all_datepicker" placeholder="<?php _e('End Date','wp-bulk-delete'); ?>" />
|
148 |
-
<p class="description">
|
149 |
-
<?php _e('Set the date interval for comments to delete ( only delete comments between these dates ) or leave these fields blank to select all comments. The dates must be specified in the following format: <strong>YYYY-MM-DD</strong>','wp-bulk-delete'); ?>
|
150 |
-
</p>
|
151 |
-
</div>
|
152 |
-
</td>
|
153 |
-
</tr>
|
154 |
-
<?php
|
155 |
-
}
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Render Users Dropdown for comment authors.
|
159 |
-
*
|
160 |
-
* @since 1.1
|
161 |
-
* @return void
|
162 |
-
*/
|
163 |
-
function wpdb_render_delete_comments_users(){
|
164 |
-
global $wpdb;
|
165 |
-
?>
|
166 |
-
<tr>
|
167 |
-
<th scope="row">
|
168 |
-
<?php _e('Comment Author','wp-bulk-delete'); ?> :
|
169 |
-
</th>
|
170 |
-
<td>
|
171 |
-
<?php
|
172 |
-
if( ! wpbd_is_pro() ) { ?>
|
173 |
-
<select name="sample1" class="sample1" disabled="disabled" >
|
174 |
-
<option value=""><?php esc_attr_e( 'Select author', 'wp-bulk-delete' ); ?></option>
|
175 |
-
</select>
|
176 |
-
<?php
|
177 |
-
} else {
|
178 |
-
$comment_query = "SELECT DISTINCT `comment_author` FROM {$wpdb->comments}";
|
179 |
-
$comment_authors = $wpdb->get_col( $comment_query );
|
180 |
-
if( !empty( $comment_authors ) ){
|
181 |
-
?>
|
182 |
-
<select name="comment_author" class="chosen_select">
|
183 |
-
<option value=""><?php esc_attr_e( 'Select author', 'wp-bulk-delete' ); ?></option>
|
184 |
-
<?php
|
185 |
-
foreach ($comment_authors as $comment_author ) {
|
186 |
-
echo '<option value="' . $comment_author . '">' . $comment_author . '</option>';
|
187 |
-
}
|
188 |
-
?>
|
189 |
-
</select>
|
190 |
-
<?php
|
191 |
-
}
|
192 |
-
} ?>
|
193 |
-
<p class="description">
|
194 |
-
<?php _e('Select comment author whose comment you want to delete.','wp-bulk-delete'); ?>
|
195 |
-
</p>
|
196 |
-
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
197 |
-
</td>
|
198 |
-
</tr>
|
199 |
-
<?php
|
200 |
-
}
|
201 |
-
|
202 |
-
/**
|
203 |
-
* Render Posts Dropdown for comment posts.
|
204 |
-
*
|
205 |
-
* @since 1.1
|
206 |
-
* @return void
|
207 |
-
*/
|
208 |
-
function wpdb_render_delete_comments_posts(){
|
209 |
-
global $wpdb;
|
210 |
-
?>
|
211 |
-
<tr>
|
212 |
-
<th scope="row">
|
213 |
-
<?php _e('Comment Post','wp-bulk-delete'); ?> :
|
214 |
-
</th>
|
215 |
-
<td>
|
216 |
-
<?php
|
217 |
-
if( ! wpbd_is_pro() ) { ?>
|
218 |
-
<select name="sample2" class="sample2" disabled="disabled" >
|
219 |
-
<option value=""><?php esc_attr_e( 'Select post', 'wp-bulk-delete' ); ?></option>
|
220 |
-
</select>
|
221 |
-
<?php
|
222 |
-
} else {
|
223 |
-
$comment_query = "SELECT DISTINCT `comment_post_ID` FROM {$wpdb->comments}";
|
224 |
-
$comment_posts = $wpdb->get_col( $comment_query );
|
225 |
-
if( !empty( $comment_posts ) ){
|
226 |
-
?>
|
227 |
-
<select name="comment_post" class="chosen_select">
|
228 |
-
<option value=""><?php esc_attr_e( 'Select post', 'wp-bulk-delete' ); ?></option>
|
229 |
-
<?php
|
230 |
-
foreach ($comment_posts as $comment_post ) {
|
231 |
-
echo '<option value="' . $comment_post . '">' . get_the_title( $comment_post ) . '</option>';
|
232 |
-
}
|
233 |
-
?>
|
234 |
-
</select>
|
235 |
-
<?php
|
236 |
-
}
|
237 |
-
} ?>
|
238 |
-
<p class="description">
|
239 |
-
<?php _e('Select comment post whose comment you want to delete.','wp-bulk-delete'); ?>
|
240 |
-
</p>
|
241 |
-
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
242 |
-
</td>
|
243 |
-
</tr>
|
244 |
-
<?php
|
245 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Delete Comments Form Funcitons
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Delete Comments Form Funcitons
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
/** Actions *************************************************************/
|
15 |
+
add_action( 'wpbd_delete_comments_form', 'wpdb_render_delete_comments_status' );
|
16 |
+
add_action( 'wpbd_delete_comments_form', 'wpdb_render_delete_comments_users' );
|
17 |
+
add_action( 'wpbd_delete_comments_form', 'wpdb_render_delete_comments_posts' );
|
18 |
+
add_action( 'wpbd_delete_comments_form', 'wpdb_render_delete_comments_date_interval' );
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Process Delete Comments form
|
22 |
+
*
|
23 |
+
*
|
24 |
+
* @since 1.1.0
|
25 |
+
* @param array $data Form post Data.
|
26 |
+
* @return array | posts ID to be delete.
|
27 |
+
*/
|
28 |
+
function xt_delete_comments_form_process( $data ) {
|
29 |
+
$error = array();
|
30 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
31 |
+
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
32 |
+
}
|
33 |
+
if( empty( $data['delete_comment_status'] ) ){
|
34 |
+
$error[] = esc_html__('Please select Comment status for proceed delete operation.', 'wp-bulk-delete' );
|
35 |
+
}
|
36 |
+
|
37 |
+
if ( isset( $data['_delete_comments_wpnonce'] ) && wp_verify_nonce( $data['_delete_comments_wpnonce'], 'delete_comments_nonce' ) ) {
|
38 |
+
|
39 |
+
if( empty( $error ) ){
|
40 |
+
$delete_time = ( $data['delete_time'] ) ? $data['delete_time'] : 'now';
|
41 |
+
$delete_datetime = ( $data['delete_datetime'] ) ? $data['delete_datetime'] : '';
|
42 |
+
if( $delete_time === 'scheduled' && !empty($delete_datetime) && wpbd_is_pro() ) {
|
43 |
+
$data['delete_entity'] = 'comment';
|
44 |
+
return wpbd_save_scheduled_delete($data);
|
45 |
+
}
|
46 |
+
|
47 |
+
$comment_count = wpbulkdelete()->api->do_delete_comments( $data );
|
48 |
+
if( false === $comment_count ){
|
49 |
+
return array(
|
50 |
+
'status' => 0,
|
51 |
+
'messages' => array( esc_html__( 'Something went wrong pelase try again!!', 'wp-bulk-delete' ) ),
|
52 |
+
);
|
53 |
+
}
|
54 |
+
|
55 |
+
if ( ! empty( $comment_count ) && $comment_count > 0 ) {
|
56 |
+
return array(
|
57 |
+
'status' => 1,
|
58 |
+
'messages' => array( sprintf( esc_html__( '%d comment(s) deleted successfully.', 'wp-bulk-delete' ), $comment_count )
|
59 |
+
) );
|
60 |
+
} else {
|
61 |
+
return array(
|
62 |
+
'status' => 1,
|
63 |
+
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
64 |
+
);
|
65 |
+
}
|
66 |
+
|
67 |
+
} else {
|
68 |
+
return array(
|
69 |
+
'status' => 0,
|
70 |
+
'messages' => $error,
|
71 |
+
);
|
72 |
+
}
|
73 |
+
|
74 |
+
} else {
|
75 |
+
wp_die( esc_html__( 'Sorry, Your nonce did not verify.', 'wp-bulk-delete' ) );
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Render Userroles checkboxes.
|
81 |
+
*
|
82 |
+
* @since 1.1.0
|
83 |
+
* @return void
|
84 |
+
*/
|
85 |
+
function wpdb_render_delete_comments_status(){
|
86 |
+
$comment_status = array(
|
87 |
+
'pending' => __( 'Pending Comments', 'wp-bulk-delete'),
|
88 |
+
'spam' => __( 'Spam Comments', 'wp-bulk-delete'),
|
89 |
+
'trash' => __( 'Trash Comments', 'wp-bulk-delete'),
|
90 |
+
'approved' => __( 'Approved Comments', 'wp-bulk-delete'),
|
91 |
+
);
|
92 |
+
|
93 |
+
?>
|
94 |
+
<tr>
|
95 |
+
<th scope="row">
|
96 |
+
<?php _e( 'Comment Status', 'wp-bulk-delete' ); ?> :
|
97 |
+
</th>
|
98 |
+
|
99 |
+
<td>
|
100 |
+
<?php
|
101 |
+
if( ! empty( $comment_status ) ){
|
102 |
+
foreach ($comment_status as $comment_status_value => $comment_status_name ) {
|
103 |
+
?>
|
104 |
+
<input name="delete_comment_status[]" class="delete_comment_status" id="comment_status_<?php echo $comment_status_value; ?>" type="checkbox" value="<?php echo $comment_status_value; ?>" >
|
105 |
+
<label for="comment_status_<?php echo $comment_status_value; ?>">
|
106 |
+
<?php echo $comment_status_name . ' ' . sprintf( __( '( %s Comment(s) )', 'wp-bulk-delete' ), wpbulkdelete()->api->get_comment_count( $comment_status_value ) ); ?>
|
107 |
+
</label>
|
108 |
+
<br/>
|
109 |
+
<?php
|
110 |
+
}
|
111 |
+
}
|
112 |
+
?>
|
113 |
+
<p class="description">
|
114 |
+
<?php _e('Select the comment statuses which you want to delete.','wp-bulk-delete'); ?>
|
115 |
+
</p>
|
116 |
+
</td>
|
117 |
+
</tr>
|
118 |
+
<?php
|
119 |
+
}
|
120 |
+
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Render User registration date interval.
|
124 |
+
*
|
125 |
+
* @since 1.0
|
126 |
+
* @return void
|
127 |
+
*/
|
128 |
+
function wpdb_render_delete_comments_date_interval(){
|
129 |
+
?>
|
130 |
+
<tr>
|
131 |
+
<th scope="row">
|
132 |
+
<?php _e('Comment Date :','wp-bulk-delete'); ?>
|
133 |
+
</th>
|
134 |
+
<td>
|
135 |
+
<?php _e('Delete Comments which are','wp-bulk-delete'); ?>
|
136 |
+
<select name="date_type" class="date_type">
|
137 |
+
<option value="older_than"><?php _e('older than','wp-bulk-delete'); ?></option>
|
138 |
+
<option value="within_last"><?php _e('submitted within last','wp-bulk-delete'); ?></option>
|
139 |
+
<option value="custom_date"><?php _e('submitted between','wp-bulk-delete'); ?></option>
|
140 |
+
</select>
|
141 |
+
<div class="wpbd_date_days wpbd_inline">
|
142 |
+
<input type="number" id="input_days" name="input_days" class="wpbd_input_days" placeholder="0" min="0" /> <?php _e('days','wp-bulk-delete'); ?>
|
143 |
+
</div>
|
144 |
+
<div class="wpbd_custom_interval wpbd_inline" style="display:none;">
|
145 |
+
<input type="text" id="delete_start_date" name="delete_start_date" class="delete_all_datepicker" placeholder="<?php _e('Start Date','wp-bulk-delete'); ?>" />
|
146 |
+
-
|
147 |
+
<input type="text" id="delete_end_date" name="delete_end_date" class="delete_all_datepicker" placeholder="<?php _e('End Date','wp-bulk-delete'); ?>" />
|
148 |
+
<p class="description">
|
149 |
+
<?php _e('Set the date interval for comments to delete ( only delete comments between these dates ) or leave these fields blank to select all comments. The dates must be specified in the following format: <strong>YYYY-MM-DD</strong>','wp-bulk-delete'); ?>
|
150 |
+
</p>
|
151 |
+
</div>
|
152 |
+
</td>
|
153 |
+
</tr>
|
154 |
+
<?php
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Render Users Dropdown for comment authors.
|
159 |
+
*
|
160 |
+
* @since 1.1
|
161 |
+
* @return void
|
162 |
+
*/
|
163 |
+
function wpdb_render_delete_comments_users(){
|
164 |
+
global $wpdb;
|
165 |
+
?>
|
166 |
+
<tr>
|
167 |
+
<th scope="row">
|
168 |
+
<?php _e('Comment Author','wp-bulk-delete'); ?> :
|
169 |
+
</th>
|
170 |
+
<td>
|
171 |
+
<?php
|
172 |
+
if( ! wpbd_is_pro() ) { ?>
|
173 |
+
<select name="sample1" class="sample1" disabled="disabled" >
|
174 |
+
<option value=""><?php esc_attr_e( 'Select author', 'wp-bulk-delete' ); ?></option>
|
175 |
+
</select>
|
176 |
+
<?php
|
177 |
+
} else {
|
178 |
+
$comment_query = "SELECT DISTINCT `comment_author` FROM {$wpdb->comments}";
|
179 |
+
$comment_authors = $wpdb->get_col( $comment_query );
|
180 |
+
if( !empty( $comment_authors ) ){
|
181 |
+
?>
|
182 |
+
<select name="comment_author" class="chosen_select">
|
183 |
+
<option value=""><?php esc_attr_e( 'Select author', 'wp-bulk-delete' ); ?></option>
|
184 |
+
<?php
|
185 |
+
foreach ($comment_authors as $comment_author ) {
|
186 |
+
echo '<option value="' . $comment_author . '">' . $comment_author . '</option>';
|
187 |
+
}
|
188 |
+
?>
|
189 |
+
</select>
|
190 |
+
<?php
|
191 |
+
}
|
192 |
+
} ?>
|
193 |
+
<p class="description">
|
194 |
+
<?php _e('Select comment author whose comment you want to delete.','wp-bulk-delete'); ?>
|
195 |
+
</p>
|
196 |
+
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
197 |
+
</td>
|
198 |
+
</tr>
|
199 |
+
<?php
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Render Posts Dropdown for comment posts.
|
204 |
+
*
|
205 |
+
* @since 1.1
|
206 |
+
* @return void
|
207 |
+
*/
|
208 |
+
function wpdb_render_delete_comments_posts(){
|
209 |
+
global $wpdb;
|
210 |
+
?>
|
211 |
+
<tr>
|
212 |
+
<th scope="row">
|
213 |
+
<?php _e('Comment Post','wp-bulk-delete'); ?> :
|
214 |
+
</th>
|
215 |
+
<td>
|
216 |
+
<?php
|
217 |
+
if( ! wpbd_is_pro() ) { ?>
|
218 |
+
<select name="sample2" class="sample2" disabled="disabled" >
|
219 |
+
<option value=""><?php esc_attr_e( 'Select post', 'wp-bulk-delete' ); ?></option>
|
220 |
+
</select>
|
221 |
+
<?php
|
222 |
+
} else {
|
223 |
+
$comment_query = "SELECT DISTINCT `comment_post_ID` FROM {$wpdb->comments}";
|
224 |
+
$comment_posts = $wpdb->get_col( $comment_query );
|
225 |
+
if( !empty( $comment_posts ) ){
|
226 |
+
?>
|
227 |
+
<select name="comment_post" class="chosen_select">
|
228 |
+
<option value=""><?php esc_attr_e( 'Select post', 'wp-bulk-delete' ); ?></option>
|
229 |
+
<?php
|
230 |
+
foreach ($comment_posts as $comment_post ) {
|
231 |
+
echo '<option value="' . $comment_post . '">' . get_the_title( $comment_post ) . '</option>';
|
232 |
+
}
|
233 |
+
?>
|
234 |
+
</select>
|
235 |
+
<?php
|
236 |
+
}
|
237 |
+
} ?>
|
238 |
+
<p class="description">
|
239 |
+
<?php _e('Select comment post whose comment you want to delete.','wp-bulk-delete'); ?>
|
240 |
+
</p>
|
241 |
+
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
242 |
+
</td>
|
243 |
+
</tr>
|
244 |
+
<?php
|
245 |
}
|
includes/delele-meta-form-functions.php
CHANGED
@@ -1,383 +1,383 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Form Process
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Form Process
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
/** Actions *************************************************************/
|
15 |
-
// postmeta
|
16 |
-
add_action( 'render_postmeta_form', 'wpdb_render_meta_form_posttype', 10 );
|
17 |
-
add_action( 'render_postmeta_form', 'wpdb_render_meta_form_postdropdown', 10 );
|
18 |
-
add_action( 'render_postmeta_form', 'wpbd_render_meta_fields', 10 );
|
19 |
-
add_action( 'render_postmeta_form', 'wpbd_render_meta_date_interval', 10 );
|
20 |
-
|
21 |
-
// commentmeta
|
22 |
-
add_action( 'render_commentmeta_form', 'wpbd_render_meta_fields', 10 );
|
23 |
-
add_action( 'render_commentmeta_form', 'wpbd_render_meta_date_interval', 10 );
|
24 |
-
|
25 |
-
// usermeta
|
26 |
-
add_action( 'render_usermeta_form', 'wpbd_render_meta_userroles', 10 );
|
27 |
-
add_action( 'render_usermeta_form', 'wpbd_render_meta_fields', 10 );
|
28 |
-
add_action( 'render_usermeta_form', 'wpbd_render_meta_date_interval', 10 );
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Process Delete meta form
|
32 |
-
*
|
33 |
-
*
|
34 |
-
* @since 1.0
|
35 |
-
* @param array $data meta form data.
|
36 |
-
* @return array | with status and message.
|
37 |
-
*/
|
38 |
-
function wpbd_delete_meta_form_process( $data ) {
|
39 |
-
$error = $meta_results = array();
|
40 |
-
$meta_count = 0;
|
41 |
-
|
42 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
43 |
-
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
44 |
-
}
|
45 |
-
|
46 |
-
if ( isset( $data['_delete_meta_wpnonce'] ) && wp_verify_nonce( $data['_delete_meta_wpnonce'], 'delete_meta_nonce' ) ) {
|
47 |
-
|
48 |
-
if( empty( $error ) ){
|
49 |
-
$delete_time = ( $data['delete_time'] ) ? $data['delete_time'] : 'now';
|
50 |
-
$delete_datetime = ( $data['delete_datetime'] ) ? $data['delete_datetime'] : '';
|
51 |
-
if( $delete_time === 'scheduled' && !empty($delete_datetime) && wpbd_is_pro() ) {
|
52 |
-
$data['delete_entity'] = $data['meta_type'];
|
53 |
-
return wpbd_save_scheduled_delete($data);
|
54 |
-
}
|
55 |
-
|
56 |
-
// Get meta_results for delete based on user input.
|
57 |
-
if( 'postmeta' == $data['meta_type'] ) {
|
58 |
-
$meta_results = wpbulkdelete()->api->get_delete_postmeta_ids( $data );
|
59 |
-
|
60 |
-
} elseif('usermeta' == $data['meta_type'] ) {
|
61 |
-
$meta_results = wpbulkdelete()->api->get_delete_usermeta_ids( $data );
|
62 |
-
|
63 |
-
} elseif('commentmeta' == $data['meta_type'] ) {
|
64 |
-
$meta_results = wpbulkdelete()->api->get_delete_commentmeta_ids( $data );
|
65 |
-
}
|
66 |
-
|
67 |
-
if ( ! empty( $meta_results ) && count( $meta_results ) > 0 ) {
|
68 |
-
|
69 |
-
if( 'postmeta' == $data['meta_type'] ) {
|
70 |
-
$meta_count = wpbulkdelete()->api->do_delete_postmetas( $meta_results );
|
71 |
-
|
72 |
-
} elseif('usermeta' == $data['meta_type'] ) {
|
73 |
-
$meta_count = wpbulkdelete()->api->do_delete_usermetas( $meta_results );
|
74 |
-
|
75 |
-
} elseif('commentmeta' == $data['meta_type'] ) {
|
76 |
-
$meta_count = wpbulkdelete()->api->do_delete_commentmetas( $meta_results );
|
77 |
-
|
78 |
-
}
|
79 |
-
|
80 |
-
return array(
|
81 |
-
'status' => 1,
|
82 |
-
'messages' => array( sprintf( esc_html__( '%d Meta deleted successfully.', 'wp-bulk-delete' ), $meta_count)
|
83 |
-
) );
|
84 |
-
} else {
|
85 |
-
return array(
|
86 |
-
'status' => 1,
|
87 |
-
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
88 |
-
);
|
89 |
-
}
|
90 |
-
|
91 |
-
} else {
|
92 |
-
return array(
|
93 |
-
'status' => 0,
|
94 |
-
'messages' => $error,
|
95 |
-
);
|
96 |
-
}
|
97 |
-
|
98 |
-
} else {
|
99 |
-
wp_die( esc_html__( 'Sorry, Your nonce did not verify.', 'wp-bulk-delete' ) );
|
100 |
-
}
|
101 |
-
}
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Render meta cleanup options
|
105 |
-
*
|
106 |
-
* @since 1.1.0
|
107 |
-
* @return void
|
108 |
-
*/
|
109 |
-
function wpbd_render_meta_cleanup(){
|
110 |
-
// Counts
|
111 |
-
$orphan_postmeta_count = wpbulkdelete()->api->get_post_count('orphan_postmeta');
|
112 |
-
$duplicated_postmeta_count = wpbulkdelete()->api->get_post_count('duplicated_postmeta');
|
113 |
-
$orphan_commentmeta_count = wpbulkdelete()->api->get_post_count('orphan_commentmeta');
|
114 |
-
$duplicated_commentmeta_count = wpbulkdelete()->api->get_post_count('duplicated_commentmeta');
|
115 |
-
$orphan_usermeta_count = wpbulkdelete()->api->get_post_count('orphan_usermeta');
|
116 |
-
$duplicated_usermeta_count = wpbulkdelete()->api->get_post_count('duplicated_usermeta');
|
117 |
-
$orphan_termmeta_count = wpbulkdelete()->api->get_post_count('orphan_termmeta');
|
118 |
-
$duplicated_termmeta_count = wpbulkdelete()->api->get_post_count('duplicated_termmeta');
|
119 |
-
?>
|
120 |
-
<tr>
|
121 |
-
<th scope="row">
|
122 |
-
<?php _e('Cleanup Meta :','wp-bulk-delete'); ?>
|
123 |
-
</th>
|
124 |
-
<td>
|
125 |
-
<fieldset>
|
126 |
-
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_orphan_postmeta" type="checkbox" value="orphan_postmeta" checked="checked">
|
127 |
-
<label for="cleanup_orphan_postmeta">
|
128 |
-
<?php printf( __( 'Orphaned Post Meta (%d Post Meta)', 'wp-bulk-delete' ), $orphan_postmeta_count ); ?>
|
129 |
-
</label>
|
130 |
-
</fieldset>
|
131 |
-
|
132 |
-
<fieldset>
|
133 |
-
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_duplicated_postmeta" type="checkbox" value="duplicated_postmeta" checked="checked">
|
134 |
-
<label for="cleanup_duplicated_postmeta">
|
135 |
-
<?php printf( __( 'Duplicated Post Meta (%d Post Meta)', 'wp-bulk-delete' ), $duplicated_postmeta_count ); ?>
|
136 |
-
</label>
|
137 |
-
</fieldset>
|
138 |
-
|
139 |
-
<fieldset>
|
140 |
-
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_orphan_commentmeta" type="checkbox" value="orphan_commentmeta" checked="checked">
|
141 |
-
<label for="cleanup_orphan_commentmeta">
|
142 |
-
<?php printf( __( 'Orphaned Comment Meta (%d Comment Meta)', 'wp-bulk-delete' ), $orphan_commentmeta_count ); ?>
|
143 |
-
</label>
|
144 |
-
</fieldset>
|
145 |
-
|
146 |
-
<fieldset>
|
147 |
-
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_duplicated_commentmeta" type="checkbox" value="duplicated_commentmeta" checked="checked">
|
148 |
-
<label for="cleanup_duplicated_commentmeta">
|
149 |
-
<?php printf( __( 'Duplicated Comment Meta (%d Comment Meta)', 'wp-bulk-delete' ), $duplicated_commentmeta_count ); ?>
|
150 |
-
</label>
|
151 |
-
</fieldset>
|
152 |
-
|
153 |
-
<fieldset>
|
154 |
-
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_orphan_usermeta" type="checkbox" value="orphan_usermeta" checked="checked">
|
155 |
-
<label for="cleanup_orphan_usermeta">
|
156 |
-
<?php printf( __( 'Orphaned User Meta (%d User Meta)', 'wp-bulk-delete' ), $orphan_usermeta_count ); ?>
|
157 |
-
</label>
|
158 |
-
</fieldset>
|
159 |
-
|
160 |
-
<fieldset>
|
161 |
-
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_duplicated_usermeta" type="checkbox" value="duplicated_usermeta" checked="checked">
|
162 |
-
<label for="cleanup_duplicated_usermeta">
|
163 |
-
<?php printf( __( 'Duplicated User Meta (%d User Meta)', 'wp-bulk-delete' ), $duplicated_usermeta_count ); ?>
|
164 |
-
</label>
|
165 |
-
</fieldset>
|
166 |
-
|
167 |
-
<fieldset>
|
168 |
-
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_orphan_termmeta" type="checkbox" value="orphan_termmeta" checked="checked">
|
169 |
-
<label for="cleanup_orphan_termmeta">
|
170 |
-
<?php printf( __( 'Orphaned Term Meta (%d Term Meta)', 'wp-bulk-delete' ), $orphan_commentmeta_count ); ?>
|
171 |
-
</label>
|
172 |
-
</fieldset>
|
173 |
-
|
174 |
-
<fieldset>
|
175 |
-
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_duplicated_termmeta" type="checkbox" value="duplicated_termmeta" checked="checked">
|
176 |
-
<label for="cleanup_duplicated_termmeta">
|
177 |
-
<?php printf( __( 'Duplicated Term Meta (%d Term Meta)', 'wp-bulk-delete' ), $duplicated_termmeta_count ); ?>
|
178 |
-
</label>
|
179 |
-
</fieldset>
|
180 |
-
|
181 |
-
</td>
|
182 |
-
</tr>
|
183 |
-
<?php
|
184 |
-
}
|
185 |
-
|
186 |
-
/**
|
187 |
-
* Render post meta post options
|
188 |
-
*
|
189 |
-
* @since 1.1.0
|
190 |
-
* @return void
|
191 |
-
*/
|
192 |
-
function wpdb_render_meta_form_posttype(){
|
193 |
-
global $wp_post_types;
|
194 |
-
$ingnore_types = array('attachment','revision','nav_menu_item');
|
195 |
-
$types = array();
|
196 |
-
if( !empty( $wp_post_types ) ){
|
197 |
-
foreach( $wp_post_types as $key_type => $post_type ){
|
198 |
-
if( in_array( $key_type, $ingnore_types ) ){
|
199 |
-
continue;
|
200 |
-
}else{
|
201 |
-
$types[$key_type] = $post_type->labels->name;
|
202 |
-
}
|
203 |
-
}
|
204 |
-
}
|
205 |
-
?>
|
206 |
-
<tr>
|
207 |
-
<th scope="row">
|
208 |
-
<?php _e('Post type:','wp-bulk-delete'); ?>
|
209 |
-
</th>
|
210 |
-
<td>
|
211 |
-
<select name="meta_post_type" class="meta_post_type" id="meta_post_type" required="required">
|
212 |
-
<?php
|
213 |
-
if( !empty( $types ) ){
|
214 |
-
foreach( $types as $key_type => $type ){
|
215 |
-
?>
|
216 |
-
<fieldset>
|
217 |
-
<label for="meta_post_type">
|
218 |
-
<option value="<?php echo $key_type; ?>">
|
219 |
-
<?php printf( __( '%s', 'wp-bulk-delete' ), $type ); ?>
|
220 |
-
</option>
|
221 |
-
</label>
|
222 |
-
</fieldset>
|
223 |
-
<?php
|
224 |
-
}
|
225 |
-
}else{
|
226 |
-
_e('No post types are there, WP Bulk Delete will not work.','wp-bulk-delete');
|
227 |
-
}
|
228 |
-
?>
|
229 |
-
</select>
|
230 |
-
<p class="description">
|
231 |
-
<?php esc_html_e('Select the post type whose post meta fields you want to delete.','wp-bulk-delete'); ?>
|
232 |
-
</p>
|
233 |
-
</td>
|
234 |
-
</tr>
|
235 |
-
<?php
|
236 |
-
}
|
237 |
-
|
238 |
-
|
239 |
-
/**
|
240 |
-
* Render meta Fields.
|
241 |
-
*
|
242 |
-
* @since 1.1.0
|
243 |
-
* @return void
|
244 |
-
*/
|
245 |
-
function wpbd_render_meta_fields(){
|
246 |
-
?>
|
247 |
-
<tr>
|
248 |
-
<th scope="row">
|
249 |
-
<?php _e('Meta fields','wp-bulk-delete'); ?> :
|
250 |
-
</th>
|
251 |
-
<td>
|
252 |
-
<?php esc_html_e( 'Meta key', 'wp-bulk-delete' ); ?>
|
253 |
-
<input type="text" id="custom_field_key" name="custom_field_key" class="custom_field_key" placeholder="<?php esc_html_e( 'Meta key (Required)', 'wp-bulk-delete' ); ?>" required="required" />
|
254 |
-
<select name="custom_field_compare">
|
255 |
-
<option value="equal_to_str"><?php esc_html_e( 'equal to ( string )', 'wp-bulk-delete' ); ?></option>
|
256 |
-
<option value="notequal_to_str"><?php esc_html_e( 'not equal to ( string )', 'wp-bulk-delete' ); ?></option>
|
257 |
-
<option value="like_str"><?php esc_html_e( 'like ( string )', 'wp-bulk-delete' ); ?></option>
|
258 |
-
<option value="notlike_str"><?php esc_html_e( 'not like ( string )', 'wp-bulk-delete' ); ?></option><option value="equal_to_date"><?php esc_html_e( 'equal to ( date )', 'wp-bulk-delete' ); ?></option>
|
259 |
-
<option value="notequal_to_date"><?php esc_html_e( 'not equal to ( date )', 'wp-bulk-delete' ); ?></option>
|
260 |
-
<option value="lessthen_date"><?php esc_html_e( 'less then ( date )', 'wp-bulk-delete' ); ?></option>
|
261 |
-
<option value="lessthenequal_date"><?php esc_html_e( 'less then and equal to ( date )', 'wp-bulk-delete' ); ?></option>
|
262 |
-
<option value="greaterthen_date"><?php esc_html_e( 'greater then ( date )', 'wp-bulk-delete' ); ?></option>
|
263 |
-
<option value="greaterthenequal_date"><?php esc_html_e( 'greater then and equal to ( date )', 'wp-bulk-delete' ); ?></option>
|
264 |
-
<option value="equal_to_number"><?php esc_html_e( 'equal to ( number )', 'wp-bulk-delete' ); ?></option>
|
265 |
-
<option value="notequal_to_number"><?php esc_html_e( 'not equal to ( number )', 'wp-bulk-delete' ); ?></option>
|
266 |
-
<option value="lessthen_number"><?php esc_html_e( 'less then ( number )', 'wp-bulk-delete' ); ?></option>
|
267 |
-
<option value="lessthenequal_number"><?php esc_html_e( 'less then and equal to ( number )', 'wp-bulk-delete' ); ?></option>
|
268 |
-
<option value="greaterthen_number"><?php esc_html_e( 'greater then ( number )', 'wp-bulk-delete' ); ?></option>
|
269 |
-
<option value="greaterthenequal_number"><?php esc_html_e( 'greater then and equal to ( number )', 'wp-bulk-delete' ); ?></option>
|
270 |
-
</select>
|
271 |
-
<?php esc_html_e( 'Value', 'wp-bulk-delete' ); ?>
|
272 |
-
<input type="text" id="custom_field_value" name="custom_field_value" class="custom_field_value" placeholder="<?php esc_html_e( 'Meta value (Optional)', 'wp-bulk-delete' ); ?>" />
|
273 |
-
<p class="description">
|
274 |
-
<?php esc_html_e('Enter the meta key for delete meta, please consider following points in to meta delete.','wp-bulk-delete'); ?><br>
|
275 |
-
<?php esc_html_e('1. If you want to delete meta by meta key only enter meta key.','wp-bulk-delete'); ?><br>
|
276 |
-
<?php esc_html_e('2. If you want to delete meta by meta key and meta value then enter both values.','wp-bulk-delete'); ?><br>
|
277 |
-
</p>
|
278 |
-
</td>
|
279 |
-
</tr>
|
280 |
-
<?php
|
281 |
-
}
|
282 |
-
|
283 |
-
|
284 |
-
/**
|
285 |
-
* Render Postmeta Date intervals.
|
286 |
-
*
|
287 |
-
* @since 1.0
|
288 |
-
* @return void
|
289 |
-
*/
|
290 |
-
function wpbd_render_meta_date_interval(){
|
291 |
-
?>
|
292 |
-
<tr>
|
293 |
-
<th scope="row">
|
294 |
-
<?php _e('Date interval :','wp-bulk-delete'); ?>
|
295 |
-
</th>
|
296 |
-
<td>
|
297 |
-
<?php _e('Delete meta for for posts/comments/users which are','wp-bulk-delete'); ?>
|
298 |
-
<select name="date_type" class="date_type">
|
299 |
-
<option value="older_than"><?php _e('older than','wp-bulk-delete'); ?></option>
|
300 |
-
<option value="within_last"><?php _e('created within last','wp-bulk-delete'); ?></option>
|
301 |
-
<option value="custom_date"><?php _e('created between','wp-bulk-delete'); ?></option>
|
302 |
-
</select>
|
303 |
-
<div class="wpbd_date_days wpbd_inline">
|
304 |
-
<input type="number" id="input_days" name="input_days" class="wpbd_input_days" placeholder="0" min="0" /> <?php _e('days','wp-bulk-delete'); ?>
|
305 |
-
</div>
|
306 |
-
<div class="wpbd_custom_interval wpbd_inline" style="display:none;">
|
307 |
-
<input type="text" id="delete_start_date" name="delete_start_date" class="delete_all_datepicker" placeholder="<?php _e('Start Date','wp-bulk-delete'); ?>" />
|
308 |
-
-
|
309 |
-
<input type="text" id="delete_end_date" name="delete_end_date" class="delete_all_datepicker" placeholder="<?php _e('End Date','wp-bulk-delete'); ?>" />
|
310 |
-
<p class="description">
|
311 |
-
<?php _e('Set the date interval for posts/comments/users whose meta fields will be delete, or leave these fields blank to select all meta. The dates must be specified in the following format: <strong>YYYY-MM-DD</strong>','wp-bulk-delete'); ?>
|
312 |
-
</p>
|
313 |
-
</div>
|
314 |
-
</td>
|
315 |
-
</tr>
|
316 |
-
<?php
|
317 |
-
}
|
318 |
-
|
319 |
-
/**
|
320 |
-
* Render Userroles dropdown.
|
321 |
-
*
|
322 |
-
* @since 1.0
|
323 |
-
* @return void
|
324 |
-
*/
|
325 |
-
function wpbd_render_meta_userroles(){
|
326 |
-
$userroles = count_users();
|
327 |
-
?>
|
328 |
-
<tr>
|
329 |
-
<th scope="row">
|
330 |
-
<?php _e( 'User roles', 'wp-bulk-delete' ); ?> :
|
331 |
-
</th>
|
332 |
-
<td>
|
333 |
-
<?php
|
334 |
-
if( ! empty( $userroles['avail_roles'] ) ){
|
335 |
-
foreach ($userroles['avail_roles'] as $userrole => $count ) {
|
336 |
-
?>
|
337 |
-
<input name="delete_user_roles[]" class="delete_user_roles" id="user_role_<?php echo $userrole; ?>" type="checkbox" value="<?php echo $userrole; ?>" >
|
338 |
-
<label for="user_role_<?php echo $userrole; ?>">
|
339 |
-
<?php echo $userrole . ' ' . sprintf( __( '( %s Users )', 'wp-bulk-delete' ), $count ); ?>
|
340 |
-
</label><br/>
|
341 |
-
<?php
|
342 |
-
}
|
343 |
-
}
|
344 |
-
?>
|
345 |
-
<p class="description">
|
346 |
-
<?php _e('Select the user roles from which you want to delete user meta.','wp-bulk-delete'); ?>
|
347 |
-
</p>
|
348 |
-
</td>
|
349 |
-
</tr>
|
350 |
-
<?php
|
351 |
-
}
|
352 |
-
|
353 |
-
/**
|
354 |
-
* Render post dropdown based on posttype selection.
|
355 |
-
*
|
356 |
-
* @since 1.1
|
357 |
-
* @return void
|
358 |
-
*/
|
359 |
-
function wpdb_render_meta_form_postdropdown(){
|
360 |
-
?>
|
361 |
-
<tr>
|
362 |
-
<th scope="row">
|
363 |
-
<?php _e('Post :','wp-bulk-delete'); ?>
|
364 |
-
</th>
|
365 |
-
<td>
|
366 |
-
<div <?php if(wpbd_is_pro()){ ?>class="postdropdown_space"<?php } ?>>
|
367 |
-
<select name="sample_post_dropdown" disabled="disabled">
|
368 |
-
<option value=""> <?php esc_html_e( 'Select post', 'wp-bulk-delete' ); ?></option>
|
369 |
-
</select>
|
370 |
-
</div>
|
371 |
-
<p class="description">
|
372 |
-
<?php esc_html_e('Select the post whose post meta fields you want to delete.','wp-bulk-delete'); ?>
|
373 |
-
</p>
|
374 |
-
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
375 |
-
</td>
|
376 |
-
</tr>
|
377 |
-
<script>
|
378 |
-
jQuery(document).ready(function(){
|
379 |
-
jQuery('#meta_post_type').trigger( 'change' );
|
380 |
-
});
|
381 |
-
</script>
|
382 |
-
<?php
|
383 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Form Process
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Form Process
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
/** Actions *************************************************************/
|
15 |
+
// postmeta
|
16 |
+
add_action( 'render_postmeta_form', 'wpdb_render_meta_form_posttype', 10 );
|
17 |
+
add_action( 'render_postmeta_form', 'wpdb_render_meta_form_postdropdown', 10 );
|
18 |
+
add_action( 'render_postmeta_form', 'wpbd_render_meta_fields', 10 );
|
19 |
+
add_action( 'render_postmeta_form', 'wpbd_render_meta_date_interval', 10 );
|
20 |
+
|
21 |
+
// commentmeta
|
22 |
+
add_action( 'render_commentmeta_form', 'wpbd_render_meta_fields', 10 );
|
23 |
+
add_action( 'render_commentmeta_form', 'wpbd_render_meta_date_interval', 10 );
|
24 |
+
|
25 |
+
// usermeta
|
26 |
+
add_action( 'render_usermeta_form', 'wpbd_render_meta_userroles', 10 );
|
27 |
+
add_action( 'render_usermeta_form', 'wpbd_render_meta_fields', 10 );
|
28 |
+
add_action( 'render_usermeta_form', 'wpbd_render_meta_date_interval', 10 );
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Process Delete meta form
|
32 |
+
*
|
33 |
+
*
|
34 |
+
* @since 1.0
|
35 |
+
* @param array $data meta form data.
|
36 |
+
* @return array | with status and message.
|
37 |
+
*/
|
38 |
+
function wpbd_delete_meta_form_process( $data ) {
|
39 |
+
$error = $meta_results = array();
|
40 |
+
$meta_count = 0;
|
41 |
+
|
42 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
43 |
+
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
44 |
+
}
|
45 |
+
|
46 |
+
if ( isset( $data['_delete_meta_wpnonce'] ) && wp_verify_nonce( $data['_delete_meta_wpnonce'], 'delete_meta_nonce' ) ) {
|
47 |
+
|
48 |
+
if( empty( $error ) ){
|
49 |
+
$delete_time = ( $data['delete_time'] ) ? $data['delete_time'] : 'now';
|
50 |
+
$delete_datetime = ( $data['delete_datetime'] ) ? $data['delete_datetime'] : '';
|
51 |
+
if( $delete_time === 'scheduled' && !empty($delete_datetime) && wpbd_is_pro() ) {
|
52 |
+
$data['delete_entity'] = $data['meta_type'];
|
53 |
+
return wpbd_save_scheduled_delete($data);
|
54 |
+
}
|
55 |
+
|
56 |
+
// Get meta_results for delete based on user input.
|
57 |
+
if( 'postmeta' == $data['meta_type'] ) {
|
58 |
+
$meta_results = wpbulkdelete()->api->get_delete_postmeta_ids( $data );
|
59 |
+
|
60 |
+
} elseif('usermeta' == $data['meta_type'] ) {
|
61 |
+
$meta_results = wpbulkdelete()->api->get_delete_usermeta_ids( $data );
|
62 |
+
|
63 |
+
} elseif('commentmeta' == $data['meta_type'] ) {
|
64 |
+
$meta_results = wpbulkdelete()->api->get_delete_commentmeta_ids( $data );
|
65 |
+
}
|
66 |
+
|
67 |
+
if ( ! empty( $meta_results ) && count( $meta_results ) > 0 ) {
|
68 |
+
|
69 |
+
if( 'postmeta' == $data['meta_type'] ) {
|
70 |
+
$meta_count = wpbulkdelete()->api->do_delete_postmetas( $meta_results );
|
71 |
+
|
72 |
+
} elseif('usermeta' == $data['meta_type'] ) {
|
73 |
+
$meta_count = wpbulkdelete()->api->do_delete_usermetas( $meta_results );
|
74 |
+
|
75 |
+
} elseif('commentmeta' == $data['meta_type'] ) {
|
76 |
+
$meta_count = wpbulkdelete()->api->do_delete_commentmetas( $meta_results );
|
77 |
+
|
78 |
+
}
|
79 |
+
|
80 |
+
return array(
|
81 |
+
'status' => 1,
|
82 |
+
'messages' => array( sprintf( esc_html__( '%d Meta deleted successfully.', 'wp-bulk-delete' ), $meta_count)
|
83 |
+
) );
|
84 |
+
} else {
|
85 |
+
return array(
|
86 |
+
'status' => 1,
|
87 |
+
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
88 |
+
);
|
89 |
+
}
|
90 |
+
|
91 |
+
} else {
|
92 |
+
return array(
|
93 |
+
'status' => 0,
|
94 |
+
'messages' => $error,
|
95 |
+
);
|
96 |
+
}
|
97 |
+
|
98 |
+
} else {
|
99 |
+
wp_die( esc_html__( 'Sorry, Your nonce did not verify.', 'wp-bulk-delete' ) );
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Render meta cleanup options
|
105 |
+
*
|
106 |
+
* @since 1.1.0
|
107 |
+
* @return void
|
108 |
+
*/
|
109 |
+
function wpbd_render_meta_cleanup(){
|
110 |
+
// Counts
|
111 |
+
$orphan_postmeta_count = wpbulkdelete()->api->get_post_count('orphan_postmeta');
|
112 |
+
$duplicated_postmeta_count = wpbulkdelete()->api->get_post_count('duplicated_postmeta');
|
113 |
+
$orphan_commentmeta_count = wpbulkdelete()->api->get_post_count('orphan_commentmeta');
|
114 |
+
$duplicated_commentmeta_count = wpbulkdelete()->api->get_post_count('duplicated_commentmeta');
|
115 |
+
$orphan_usermeta_count = wpbulkdelete()->api->get_post_count('orphan_usermeta');
|
116 |
+
$duplicated_usermeta_count = wpbulkdelete()->api->get_post_count('duplicated_usermeta');
|
117 |
+
$orphan_termmeta_count = wpbulkdelete()->api->get_post_count('orphan_termmeta');
|
118 |
+
$duplicated_termmeta_count = wpbulkdelete()->api->get_post_count('duplicated_termmeta');
|
119 |
+
?>
|
120 |
+
<tr>
|
121 |
+
<th scope="row">
|
122 |
+
<?php _e('Cleanup Meta :','wp-bulk-delete'); ?>
|
123 |
+
</th>
|
124 |
+
<td>
|
125 |
+
<fieldset>
|
126 |
+
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_orphan_postmeta" type="checkbox" value="orphan_postmeta" checked="checked">
|
127 |
+
<label for="cleanup_orphan_postmeta">
|
128 |
+
<?php printf( __( 'Orphaned Post Meta (%d Post Meta)', 'wp-bulk-delete' ), $orphan_postmeta_count ); ?>
|
129 |
+
</label>
|
130 |
+
</fieldset>
|
131 |
+
|
132 |
+
<fieldset>
|
133 |
+
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_duplicated_postmeta" type="checkbox" value="duplicated_postmeta" checked="checked">
|
134 |
+
<label for="cleanup_duplicated_postmeta">
|
135 |
+
<?php printf( __( 'Duplicated Post Meta (%d Post Meta)', 'wp-bulk-delete' ), $duplicated_postmeta_count ); ?>
|
136 |
+
</label>
|
137 |
+
</fieldset>
|
138 |
+
|
139 |
+
<fieldset>
|
140 |
+
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_orphan_commentmeta" type="checkbox" value="orphan_commentmeta" checked="checked">
|
141 |
+
<label for="cleanup_orphan_commentmeta">
|
142 |
+
<?php printf( __( 'Orphaned Comment Meta (%d Comment Meta)', 'wp-bulk-delete' ), $orphan_commentmeta_count ); ?>
|
143 |
+
</label>
|
144 |
+
</fieldset>
|
145 |
+
|
146 |
+
<fieldset>
|
147 |
+
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_duplicated_commentmeta" type="checkbox" value="duplicated_commentmeta" checked="checked">
|
148 |
+
<label for="cleanup_duplicated_commentmeta">
|
149 |
+
<?php printf( __( 'Duplicated Comment Meta (%d Comment Meta)', 'wp-bulk-delete' ), $duplicated_commentmeta_count ); ?>
|
150 |
+
</label>
|
151 |
+
</fieldset>
|
152 |
+
|
153 |
+
<fieldset>
|
154 |
+
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_orphan_usermeta" type="checkbox" value="orphan_usermeta" checked="checked">
|
155 |
+
<label for="cleanup_orphan_usermeta">
|
156 |
+
<?php printf( __( 'Orphaned User Meta (%d User Meta)', 'wp-bulk-delete' ), $orphan_usermeta_count ); ?>
|
157 |
+
</label>
|
158 |
+
</fieldset>
|
159 |
+
|
160 |
+
<fieldset>
|
161 |
+
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_duplicated_usermeta" type="checkbox" value="duplicated_usermeta" checked="checked">
|
162 |
+
<label for="cleanup_duplicated_usermeta">
|
163 |
+
<?php printf( __( 'Duplicated User Meta (%d User Meta)', 'wp-bulk-delete' ), $duplicated_usermeta_count ); ?>
|
164 |
+
</label>
|
165 |
+
</fieldset>
|
166 |
+
|
167 |
+
<fieldset>
|
168 |
+
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_orphan_termmeta" type="checkbox" value="orphan_termmeta" checked="checked">
|
169 |
+
<label for="cleanup_orphan_termmeta">
|
170 |
+
<?php printf( __( 'Orphaned Term Meta (%d Term Meta)', 'wp-bulk-delete' ), $orphan_commentmeta_count ); ?>
|
171 |
+
</label>
|
172 |
+
</fieldset>
|
173 |
+
|
174 |
+
<fieldset>
|
175 |
+
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_duplicated_termmeta" type="checkbox" value="duplicated_termmeta" checked="checked">
|
176 |
+
<label for="cleanup_duplicated_termmeta">
|
177 |
+
<?php printf( __( 'Duplicated Term Meta (%d Term Meta)', 'wp-bulk-delete' ), $duplicated_termmeta_count ); ?>
|
178 |
+
</label>
|
179 |
+
</fieldset>
|
180 |
+
|
181 |
+
</td>
|
182 |
+
</tr>
|
183 |
+
<?php
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Render post meta post options
|
188 |
+
*
|
189 |
+
* @since 1.1.0
|
190 |
+
* @return void
|
191 |
+
*/
|
192 |
+
function wpdb_render_meta_form_posttype(){
|
193 |
+
global $wp_post_types;
|
194 |
+
$ingnore_types = array('attachment','revision','nav_menu_item');
|
195 |
+
$types = array();
|
196 |
+
if( !empty( $wp_post_types ) ){
|
197 |
+
foreach( $wp_post_types as $key_type => $post_type ){
|
198 |
+
if( in_array( $key_type, $ingnore_types ) ){
|
199 |
+
continue;
|
200 |
+
}else{
|
201 |
+
$types[$key_type] = $post_type->labels->name;
|
202 |
+
}
|
203 |
+
}
|
204 |
+
}
|
205 |
+
?>
|
206 |
+
<tr>
|
207 |
+
<th scope="row">
|
208 |
+
<?php _e('Post type:','wp-bulk-delete'); ?>
|
209 |
+
</th>
|
210 |
+
<td>
|
211 |
+
<select name="meta_post_type" class="meta_post_type" id="meta_post_type" required="required">
|
212 |
+
<?php
|
213 |
+
if( !empty( $types ) ){
|
214 |
+
foreach( $types as $key_type => $type ){
|
215 |
+
?>
|
216 |
+
<fieldset>
|
217 |
+
<label for="meta_post_type">
|
218 |
+
<option value="<?php echo $key_type; ?>">
|
219 |
+
<?php printf( __( '%s', 'wp-bulk-delete' ), $type ); ?>
|
220 |
+
</option>
|
221 |
+
</label>
|
222 |
+
</fieldset>
|
223 |
+
<?php
|
224 |
+
}
|
225 |
+
}else{
|
226 |
+
_e('No post types are there, WP Bulk Delete will not work.','wp-bulk-delete');
|
227 |
+
}
|
228 |
+
?>
|
229 |
+
</select>
|
230 |
+
<p class="description">
|
231 |
+
<?php esc_html_e('Select the post type whose post meta fields you want to delete.','wp-bulk-delete'); ?>
|
232 |
+
</p>
|
233 |
+
</td>
|
234 |
+
</tr>
|
235 |
+
<?php
|
236 |
+
}
|
237 |
+
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Render meta Fields.
|
241 |
+
*
|
242 |
+
* @since 1.1.0
|
243 |
+
* @return void
|
244 |
+
*/
|
245 |
+
function wpbd_render_meta_fields(){
|
246 |
+
?>
|
247 |
+
<tr>
|
248 |
+
<th scope="row">
|
249 |
+
<?php _e('Meta fields','wp-bulk-delete'); ?> :
|
250 |
+
</th>
|
251 |
+
<td>
|
252 |
+
<?php esc_html_e( 'Meta key', 'wp-bulk-delete' ); ?>
|
253 |
+
<input type="text" id="custom_field_key" name="custom_field_key" class="custom_field_key" placeholder="<?php esc_html_e( 'Meta key (Required)', 'wp-bulk-delete' ); ?>" required="required" />
|
254 |
+
<select name="custom_field_compare">
|
255 |
+
<option value="equal_to_str"><?php esc_html_e( 'equal to ( string )', 'wp-bulk-delete' ); ?></option>
|
256 |
+
<option value="notequal_to_str"><?php esc_html_e( 'not equal to ( string )', 'wp-bulk-delete' ); ?></option>
|
257 |
+
<option value="like_str"><?php esc_html_e( 'like ( string )', 'wp-bulk-delete' ); ?></option>
|
258 |
+
<option value="notlike_str"><?php esc_html_e( 'not like ( string )', 'wp-bulk-delete' ); ?></option><option value="equal_to_date"><?php esc_html_e( 'equal to ( date )', 'wp-bulk-delete' ); ?></option>
|
259 |
+
<option value="notequal_to_date"><?php esc_html_e( 'not equal to ( date )', 'wp-bulk-delete' ); ?></option>
|
260 |
+
<option value="lessthen_date"><?php esc_html_e( 'less then ( date )', 'wp-bulk-delete' ); ?></option>
|
261 |
+
<option value="lessthenequal_date"><?php esc_html_e( 'less then and equal to ( date )', 'wp-bulk-delete' ); ?></option>
|
262 |
+
<option value="greaterthen_date"><?php esc_html_e( 'greater then ( date )', 'wp-bulk-delete' ); ?></option>
|
263 |
+
<option value="greaterthenequal_date"><?php esc_html_e( 'greater then and equal to ( date )', 'wp-bulk-delete' ); ?></option>
|
264 |
+
<option value="equal_to_number"><?php esc_html_e( 'equal to ( number )', 'wp-bulk-delete' ); ?></option>
|
265 |
+
<option value="notequal_to_number"><?php esc_html_e( 'not equal to ( number )', 'wp-bulk-delete' ); ?></option>
|
266 |
+
<option value="lessthen_number"><?php esc_html_e( 'less then ( number )', 'wp-bulk-delete' ); ?></option>
|
267 |
+
<option value="lessthenequal_number"><?php esc_html_e( 'less then and equal to ( number )', 'wp-bulk-delete' ); ?></option>
|
268 |
+
<option value="greaterthen_number"><?php esc_html_e( 'greater then ( number )', 'wp-bulk-delete' ); ?></option>
|
269 |
+
<option value="greaterthenequal_number"><?php esc_html_e( 'greater then and equal to ( number )', 'wp-bulk-delete' ); ?></option>
|
270 |
+
</select>
|
271 |
+
<?php esc_html_e( 'Value', 'wp-bulk-delete' ); ?>
|
272 |
+
<input type="text" id="custom_field_value" name="custom_field_value" class="custom_field_value" placeholder="<?php esc_html_e( 'Meta value (Optional)', 'wp-bulk-delete' ); ?>" />
|
273 |
+
<p class="description">
|
274 |
+
<?php esc_html_e('Enter the meta key for delete meta, please consider following points in to meta delete.','wp-bulk-delete'); ?><br>
|
275 |
+
<?php esc_html_e('1. If you want to delete meta by meta key only enter meta key.','wp-bulk-delete'); ?><br>
|
276 |
+
<?php esc_html_e('2. If you want to delete meta by meta key and meta value then enter both values.','wp-bulk-delete'); ?><br>
|
277 |
+
</p>
|
278 |
+
</td>
|
279 |
+
</tr>
|
280 |
+
<?php
|
281 |
+
}
|
282 |
+
|
283 |
+
|
284 |
+
/**
|
285 |
+
* Render Postmeta Date intervals.
|
286 |
+
*
|
287 |
+
* @since 1.0
|
288 |
+
* @return void
|
289 |
+
*/
|
290 |
+
function wpbd_render_meta_date_interval(){
|
291 |
+
?>
|
292 |
+
<tr>
|
293 |
+
<th scope="row">
|
294 |
+
<?php _e('Date interval :','wp-bulk-delete'); ?>
|
295 |
+
</th>
|
296 |
+
<td>
|
297 |
+
<?php _e('Delete meta for for posts/comments/users which are','wp-bulk-delete'); ?>
|
298 |
+
<select name="date_type" class="date_type">
|
299 |
+
<option value="older_than"><?php _e('older than','wp-bulk-delete'); ?></option>
|
300 |
+
<option value="within_last"><?php _e('created within last','wp-bulk-delete'); ?></option>
|
301 |
+
<option value="custom_date"><?php _e('created between','wp-bulk-delete'); ?></option>
|
302 |
+
</select>
|
303 |
+
<div class="wpbd_date_days wpbd_inline">
|
304 |
+
<input type="number" id="input_days" name="input_days" class="wpbd_input_days" placeholder="0" min="0" /> <?php _e('days','wp-bulk-delete'); ?>
|
305 |
+
</div>
|
306 |
+
<div class="wpbd_custom_interval wpbd_inline" style="display:none;">
|
307 |
+
<input type="text" id="delete_start_date" name="delete_start_date" class="delete_all_datepicker" placeholder="<?php _e('Start Date','wp-bulk-delete'); ?>" />
|
308 |
+
-
|
309 |
+
<input type="text" id="delete_end_date" name="delete_end_date" class="delete_all_datepicker" placeholder="<?php _e('End Date','wp-bulk-delete'); ?>" />
|
310 |
+
<p class="description">
|
311 |
+
<?php _e('Set the date interval for posts/comments/users whose meta fields will be delete, or leave these fields blank to select all meta. The dates must be specified in the following format: <strong>YYYY-MM-DD</strong>','wp-bulk-delete'); ?>
|
312 |
+
</p>
|
313 |
+
</div>
|
314 |
+
</td>
|
315 |
+
</tr>
|
316 |
+
<?php
|
317 |
+
}
|
318 |
+
|
319 |
+
/**
|
320 |
+
* Render Userroles dropdown.
|
321 |
+
*
|
322 |
+
* @since 1.0
|
323 |
+
* @return void
|
324 |
+
*/
|
325 |
+
function wpbd_render_meta_userroles(){
|
326 |
+
$userroles = count_users();
|
327 |
+
?>
|
328 |
+
<tr>
|
329 |
+
<th scope="row">
|
330 |
+
<?php _e( 'User roles', 'wp-bulk-delete' ); ?> :
|
331 |
+
</th>
|
332 |
+
<td>
|
333 |
+
<?php
|
334 |
+
if( ! empty( $userroles['avail_roles'] ) ){
|
335 |
+
foreach ($userroles['avail_roles'] as $userrole => $count ) {
|
336 |
+
?>
|
337 |
+
<input name="delete_user_roles[]" class="delete_user_roles" id="user_role_<?php echo $userrole; ?>" type="checkbox" value="<?php echo $userrole; ?>" >
|
338 |
+
<label for="user_role_<?php echo $userrole; ?>">
|
339 |
+
<?php echo $userrole . ' ' . sprintf( __( '( %s Users )', 'wp-bulk-delete' ), $count ); ?>
|
340 |
+
</label><br/>
|
341 |
+
<?php
|
342 |
+
}
|
343 |
+
}
|
344 |
+
?>
|
345 |
+
<p class="description">
|
346 |
+
<?php _e('Select the user roles from which you want to delete user meta.','wp-bulk-delete'); ?>
|
347 |
+
</p>
|
348 |
+
</td>
|
349 |
+
</tr>
|
350 |
+
<?php
|
351 |
+
}
|
352 |
+
|
353 |
+
/**
|
354 |
+
* Render post dropdown based on posttype selection.
|
355 |
+
*
|
356 |
+
* @since 1.1
|
357 |
+
* @return void
|
358 |
+
*/
|
359 |
+
function wpdb_render_meta_form_postdropdown(){
|
360 |
+
?>
|
361 |
+
<tr>
|
362 |
+
<th scope="row">
|
363 |
+
<?php _e('Post :','wp-bulk-delete'); ?>
|
364 |
+
</th>
|
365 |
+
<td>
|
366 |
+
<div <?php if(wpbd_is_pro()){ ?>class="postdropdown_space"<?php } ?>>
|
367 |
+
<select name="sample_post_dropdown" disabled="disabled">
|
368 |
+
<option value=""> <?php esc_html_e( 'Select post', 'wp-bulk-delete' ); ?></option>
|
369 |
+
</select>
|
370 |
+
</div>
|
371 |
+
<p class="description">
|
372 |
+
<?php esc_html_e('Select the post whose post meta fields you want to delete.','wp-bulk-delete'); ?>
|
373 |
+
</p>
|
374 |
+
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
375 |
+
</td>
|
376 |
+
</tr>
|
377 |
+
<script>
|
378 |
+
jQuery(document).ready(function(){
|
379 |
+
jQuery('#meta_post_type').trigger( 'change' );
|
380 |
+
});
|
381 |
+
</script>
|
382 |
+
<?php
|
383 |
}
|
includes/delele-posts-form-functions.php
CHANGED
@@ -1,604 +1,624 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Form Process
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Form Process
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
/** Actions *************************************************************/
|
15 |
-
// By Posttype
|
16 |
-
add_action( 'render_form_by_posttype', 'wpbd_render_form_posttype' );
|
17 |
-
add_action( 'render_form_by_posttype', 'wpbd_render_common_form' );
|
18 |
-
|
19 |
-
// By Author
|
20 |
-
add_action( 'render_form_by_author', 'wpbd_render_form_posttype' );
|
21 |
-
add_action( 'render_form_by_author', 'wpbd_render_form_users' );
|
22 |
-
add_action( 'render_form_by_author', 'wpbd_render_common_form' );
|
23 |
-
|
24 |
-
|
25 |
-
// By Title & Content
|
26 |
-
add_action( 'render_form_by_title', 'wpbd_render_form_posttype', 10 );
|
27 |
-
add_action( 'render_form_by_title', 'wpbd_render_form_post_contains', 20 );
|
28 |
-
add_action( 'render_form_by_title', 'wpbd_render_common_form', 30 );
|
29 |
-
|
30 |
-
// By Taxonomy.
|
31 |
-
add_action( 'render_form_by_taxonomy', 'wpbd_render_form_posttype_dropdown' );
|
32 |
-
add_action( 'render_form_by_taxonomy', 'wpbd_render_form_taxonomy' );
|
33 |
-
add_action( 'render_form_by_taxonomy', 'wpbd_render_common_form' );
|
34 |
-
|
35 |
-
// By Custom Fields
|
36 |
-
add_action( 'render_form_by_custom_fields', 'wpbd_render_form_posttype', 10 );
|
37 |
-
add_action( 'render_form_by_custom_fields', 'wpbd_render_form_custom_fields', 20 );
|
38 |
-
add_action( 'render_form_by_custom_fields', 'wpbd_render_common_form', 30 );
|
39 |
-
|
40 |
-
// General
|
41 |
-
add_action( 'render_form_general', 'wpbd_render_form_posttype_dropdown', 10 );
|
42 |
-
add_action( 'render_form_general', 'wpbd_render_form_taxonomy', 20 );
|
43 |
-
add_action( 'render_form_general', 'wpbd_render_form_users', 30 );
|
44 |
-
add_action( 'render_form_general', 'wpbd_render_form_custom_fields', 40 );
|
45 |
-
add_action( 'render_form_general', 'wpbd_render_form_post_contains', 50 );
|
46 |
-
add_action( 'render_form_general', 'wpbd_render_common_form', 60 );
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Process Delete posts form
|
50 |
-
*
|
51 |
-
*
|
52 |
-
* @since 1.0
|
53 |
-
* @param array $data Form pot Data.
|
54 |
-
* @return array | posts ID to be delete.
|
55 |
-
*/
|
56 |
-
function xt_delete_posts_form_process( $data ) {
|
57 |
-
$error = array();
|
58 |
-
|
59 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
60 |
-
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
61 |
-
}
|
62 |
-
|
63 |
-
if ( isset( $data['_delete_all_posts_wpnonce'] ) && wp_verify_nonce( $data['_delete_all_posts_wpnonce'], 'delete_posts_nonce' ) ) {
|
64 |
-
|
65 |
-
if( empty( $error ) ) {
|
66 |
-
$delete_time = ( $data['delete_time'] ) ? $data['delete_time'] : 'now';
|
67 |
-
$delete_datetime = ( $data['delete_datetime'] ) ? $data['delete_datetime'] : '';
|
68 |
-
if( $delete_time === 'scheduled' && !empty($delete_datetime) && wpbd_is_pro() ) {
|
69 |
-
$data['delete_entity'] = 'post';
|
70 |
-
return wpbd_save_scheduled_delete($data);
|
71 |
-
}
|
72 |
-
|
73 |
-
// Get post_ids for delete based on user input.
|
74 |
-
$post_ids = wpbulkdelete()->api->get_delete_posts_ids( $data );
|
75 |
-
if ( ! empty( $post_ids ) && count( $post_ids ) > 0 ) {
|
76 |
-
$force_delete = false;
|
77 |
-
if ( $data['delete_type'] === 'permenant' ) {
|
78 |
-
$force_delete = true;
|
79 |
-
}
|
80 |
-
|
81 |
-
$post_count = wpbulkdelete()->api->do_delete_posts( $post_ids, $force_delete );
|
82 |
-
return array(
|
83 |
-
'status' => 1,
|
84 |
-
'messages' => array( sprintf( esc_html__( '%d Record deleted successfully.', 'wp-bulk-delete' ), $post_count)
|
85 |
-
) );
|
86 |
-
} else {
|
87 |
-
return array(
|
88 |
-
'status' => 1,
|
89 |
-
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
90 |
-
);
|
91 |
-
}
|
92 |
-
|
93 |
-
} else {
|
94 |
-
return array(
|
95 |
-
'status' => 0,
|
96 |
-
'messages' => $error,
|
97 |
-
);
|
98 |
-
}
|
99 |
-
|
100 |
-
} else {
|
101 |
-
wp_die( esc_html__( 'Sorry, Your nonce did not verify.', 'wp-bulk-delete' ) );
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
/**
|
106 |
-
* Render Posttype checkboxes.
|
107 |
-
*
|
108 |
-
* @since 1.0
|
109 |
-
* @return void
|
110 |
-
*/
|
111 |
-
function wpbd_render_form_posttype(){
|
112 |
-
global $wp_post_types;
|
113 |
-
$ingnore_types = array('attachment','revision','nav_menu_item');
|
114 |
-
$types = array();
|
115 |
-
if( !empty( $wp_post_types ) ){
|
116 |
-
foreach( $wp_post_types as $key_type => $post_type ){
|
117 |
-
if( in_array( $key_type, $ingnore_types ) ){
|
118 |
-
continue;
|
119 |
-
}else{
|
120 |
-
$types[$key_type] = $post_type->labels->name;
|
121 |
-
}
|
122 |
-
}
|
123 |
-
}
|
124 |
-
?>
|
125 |
-
<tr>
|
126 |
-
<th scope="row">
|
127 |
-
<?php _e('Post type of items to delete :','wp-bulk-delete'); ?>
|
128 |
-
</th>
|
129 |
-
<td>
|
130 |
-
<?php
|
131 |
-
if( !empty( $types ) ){
|
132 |
-
foreach( $types as $key_type => $type ){
|
133 |
-
?>
|
134 |
-
<fieldset>
|
135 |
-
<label for="delete_post_type">
|
136 |
-
<input name="delete_post_type[]" class="delete_post_type" id="<?php echo $key_type; ?>" type="checkbox" value="<?php echo $key_type; ?>" <?php if( 'post' == $key_type ){ echo 'checked="checked"'; } ?>>
|
137 |
-
<?php printf( __( '%s', 'wp-bulk-delete' ), $type ); ?>
|
138 |
-
<?php $post_count = wpbd_get_posttype_post_count( $key_type );
|
139 |
-
if( $post_count >= 0 ){
|
140 |
-
echo '('.$post_count .' '. $type .')';
|
141 |
-
}
|
142 |
-
?>
|
143 |
-
</label>
|
144 |
-
</fieldset>
|
145 |
-
<?php
|
146 |
-
}
|
147 |
-
}else{
|
148 |
-
_e('No post types are there, WP Bulk Delete will not work.','wp-bulk-delete');
|
149 |
-
}
|
150 |
-
?>
|
151 |
-
</td>
|
152 |
-
</tr>
|
153 |
-
<?php
|
154 |
-
}
|
155 |
-
|
156 |
-
/**
|
157 |
-
* Render Post type Dropdown.
|
158 |
-
*
|
159 |
-
* @since 1.0
|
160 |
-
* @return void
|
161 |
-
*/
|
162 |
-
function wpbd_render_form_posttype_dropdown(){
|
163 |
-
global $wp_post_types;
|
164 |
-
$ingnore_types = array('attachment','revision','nav_menu_item');
|
165 |
-
$types = array();
|
166 |
-
if( !empty( $wp_post_types ) ){
|
167 |
-
foreach( $wp_post_types as $key_type => $post_type ){
|
168 |
-
if( in_array( $key_type, $ingnore_types ) ){
|
169 |
-
continue;
|
170 |
-
}else{
|
171 |
-
$types[$key_type] = $post_type->labels->name;
|
172 |
-
}
|
173 |
-
}
|
174 |
-
}
|
175 |
-
?>
|
176 |
-
<tr>
|
177 |
-
<th scope="row">
|
178 |
-
<?php _e('Post type of items to delete :','wp-bulk-delete'); ?>
|
179 |
-
</th>
|
180 |
-
<td>
|
181 |
-
<select name="delete_post_type" class="delete_post_type" id="delete_post_type" required="required">
|
182 |
-
<?php
|
183 |
-
if( !empty( $types ) ){
|
184 |
-
foreach( $types as $key_type => $type ){
|
185 |
-
?>
|
186 |
-
<fieldset>
|
187 |
-
<label for="delete_post_type">
|
188 |
-
<option value="<?php echo $key_type; ?>">
|
189 |
-
<?php printf( __( '%s', 'wp-bulk-delete' ), $type ); ?>
|
190 |
-
</option>
|
191 |
-
</label>
|
192 |
-
</fieldset>
|
193 |
-
<?php
|
194 |
-
}
|
195 |
-
}else{
|
196 |
-
_e('No post types are there, WP Bulk Delete will not work.','wp-bulk-delete');
|
197 |
-
}
|
198 |
-
?>
|
199 |
-
</select>
|
200 |
-
</td>
|
201 |
-
</tr>
|
202 |
-
<?php
|
203 |
-
}
|
204 |
-
|
205 |
-
/**
|
206 |
-
* Render taxonomies.
|
207 |
-
*
|
208 |
-
* @since 1.0
|
209 |
-
* @return void
|
210 |
-
*/
|
211 |
-
function wpbd_render_form_taxonomy(){
|
212 |
-
?>
|
213 |
-
<tr>
|
214 |
-
<th scope="row">
|
215 |
-
<?php _e('Post Taxonomy :','wp-bulk-delete'); ?>
|
216 |
-
</th>
|
217 |
-
<td>
|
218 |
-
<div class="post_taxonomy">
|
219 |
-
</div>
|
220 |
-
</td>
|
221 |
-
</tr>
|
222 |
-
<tr>
|
223 |
-
<th scope="row" class="taxo_terms_title">
|
224 |
-
|
225 |
-
<?php //_e('Post Taxonomy :','wp-bulk-delete'); ?>
|
226 |
-
</th>
|
227 |
-
<td>
|
228 |
-
<div class="post_taxo_terms">
|
229 |
-
</div>
|
230 |
-
</td>
|
231 |
-
</tr>
|
232 |
-
<script>
|
233 |
-
jQuery(document).ready(function(){
|
234 |
-
jQuery('#delete_post_type').trigger( 'change' );
|
235 |
-
});
|
236 |
-
</script>
|
237 |
-
<?php
|
238 |
-
}
|
239 |
-
|
240 |
-
/**
|
241 |
-
* Render Post Statuses.
|
242 |
-
*
|
243 |
-
* @since 1.0
|
244 |
-
* @return void
|
245 |
-
*/
|
246 |
-
function wpbd_render_form_poststatus(){
|
247 |
-
?>
|
248 |
-
<tr>
|
249 |
-
<th scope="row">Post Status</th>
|
250 |
-
<td>
|
251 |
-
<fieldset>
|
252 |
-
<label for="delete_post_status">
|
253 |
-
<input name="delete_post_status[]" id="publish" value="publish" type="checkbox" checked="checked">
|
254 |
-
Published
|
255 |
-
</label>
|
256 |
-
</fieldset>
|
257 |
-
<fieldset>
|
258 |
-
<label for="delete_post_status">
|
259 |
-
<input name="delete_post_status[]" id="future" value="future" type="checkbox">
|
260 |
-
Scheduled
|
261 |
-
</label>
|
262 |
-
</fieldset>
|
263 |
-
<fieldset>
|
264 |
-
<label for="delete_post_status">
|
265 |
-
<input name="delete_post_status[]" id="draft" value="draft" type="checkbox">
|
266 |
-
Draft
|
267 |
-
</label>
|
268 |
-
</fieldset>
|
269 |
-
<fieldset>
|
270 |
-
<label for="delete_post_status">
|
271 |
-
<input name="delete_post_status[]" id="pending" value="pending" type="checkbox">
|
272 |
-
Pending
|
273 |
-
</label>
|
274 |
-
</fieldset>
|
275 |
-
<fieldset>
|
276 |
-
<label for="delete_post_status">
|
277 |
-
<input name="delete_post_status[]" id="private" value="private" type="checkbox">
|
278 |
-
Private
|
279 |
-
</label>
|
280 |
-
</fieldset>
|
281 |
-
</td>
|
282 |
-
</tr>
|
283 |
-
<?php
|
284 |
-
}
|
285 |
-
|
286 |
-
/**
|
287 |
-
* Render Date intervals.
|
288 |
-
*
|
289 |
-
* @since 1.0
|
290 |
-
* @return void
|
291 |
-
*/
|
292 |
-
function wpbd_render_form_date_interval(){
|
293 |
-
?>
|
294 |
-
<tr>
|
295 |
-
<th scope="row">
|
296 |
-
<?php _e('Post Date :','wp-bulk-delete'); ?>
|
297 |
-
</th>
|
298 |
-
<td>
|
299 |
-
<?php _e('Delete Posts which are','wp-bulk-delete'); ?>
|
300 |
-
<select name="date_type" class="date_type">
|
301 |
-
<option value="older_than"><?php _e('older than','wp-bulk-delete'); ?></option>
|
302 |
-
<option value="within_last"><?php _e('posted within last','wp-bulk-delete'); ?></option>
|
303 |
-
<option value="custom_date"><?php _e('posted between','wp-bulk-delete'); ?></option>
|
304 |
-
</select>
|
305 |
-
<div class="wpbd_date_days wpbd_inline">
|
306 |
-
<input type="number" id="input_days" name="input_days" class="wpbd_input_days" placeholder="0" min="0" /> <?php _e('days','wp-bulk-delete'); ?>
|
307 |
-
</div>
|
308 |
-
<div class="wpbd_custom_interval wpbd_inline" style="display:none;">
|
309 |
-
<input type="text" id="delete_start_date" name="delete_start_date" class="delete_all_datepicker" placeholder="<?php _e('Start Date','wp-bulk-delete'); ?>" />
|
310 |
-
-
|
311 |
-
<input type="text" id="delete_end_date" name="delete_end_date" class="delete_all_datepicker" placeholder="<?php _e('End Date','wp-bulk-delete'); ?>" />
|
312 |
-
<p class="description">
|
313 |
-
<?php _e('Set the date interval for items to delete, or leave these fields blank to select all posts. The dates must be specified in the following format: <strong>YYYY-MM-DD</strong>','wp-bulk-delete'); ?>
|
314 |
-
</p>
|
315 |
-
</div>
|
316 |
-
</td>
|
317 |
-
</tr>
|
318 |
-
<?php
|
319 |
-
}
|
320 |
-
|
321 |
-
/**
|
322 |
-
* Render Post title and content contains.
|
323 |
-
*
|
324 |
-
* @since 1.0
|
325 |
-
* @return void
|
326 |
-
*/
|
327 |
-
function wpbd_render_form_post_contains(){
|
328 |
-
?>
|
329 |
-
<tr>
|
330 |
-
<th scope="row">
|
331 |
-
<?php _e('If Post Title Contains :','wp-bulk-delete'); ?>
|
332 |
-
</th>
|
333 |
-
<td>
|
334 |
-
<input type="text" id="disabled_sample4" name="disabled_sample4" class="disabled_sample4" disabled="disabled" />
|
335 |
-
<?php _e( 'Then', 'wp-bulk-delete' ); ?>
|
336 |
-
<select name="disabled_sample5" disabled="disabled">
|
337 |
-
<option value=""><?php _e( 'Delete It.', 'wp-bulk-delete' ); ?> </option>
|
338 |
-
<option value=""><?php _e( "Don't delete It.", "wp-bulk-delete" ); ?> </option>
|
339 |
-
</select>
|
340 |
-
<br/>
|
341 |
-
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
342 |
-
</td>
|
343 |
-
</tr>
|
344 |
-
<tr>
|
345 |
-
<th scope="row">
|
346 |
-
<?php _e('If Post Content Contains :','wp-bulk-delete'); ?>
|
347 |
-
</th>
|
348 |
-
<td>
|
349 |
-
<input type="text" id="disabled_sample6" name="disabled_sample6" class="disabled_sample6" disabled="disabled" />
|
350 |
-
<?php _e( 'Then', 'wp-bulk-delete' ); ?>
|
351 |
-
<select name="disabled_sample7" disabled="disabled">
|
352 |
-
<option value=""><?php _e( 'Delete It.', 'wp-bulk-delete' ); ?> </option>
|
353 |
-
<option value=""><?php _e( "Don't delete It.", "wp-bulk-delete" ); ?> </option>
|
354 |
-
</select>
|
355 |
-
<br/>
|
356 |
-
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
357 |
-
</td>
|
358 |
-
</tr>
|
359 |
-
<?php
|
360 |
-
}
|
361 |
-
|
362 |
-
/**
|
363 |
-
* Render Delete type.
|
364 |
-
*
|
365 |
-
* @since 1.0
|
366 |
-
* @return void
|
367 |
-
*/
|
368 |
-
function wpbd_render_form_delete_type(){
|
369 |
-
?>
|
370 |
-
<tr>
|
371 |
-
<th scope="row">
|
372 |
-
<?php _e('Post Delete Type :','wp-bulk-delete'); ?>
|
373 |
-
</th>
|
374 |
-
<td>
|
375 |
-
<input type="radio" id="delete_type" name="delete_type" class="delete_type" value="trash" checked="checked"/>
|
376 |
-
<?php _e( 'Move to Trash', 'wp-bulk-delete' ); ?>
|
377 |
-
<input type="radio" id="delete_type" name="delete_type" class="delete_type" value="permenant" />
|
378 |
-
<?php _e( 'Delete permanently', 'wp-bulk-delete' ); ?>
|
379 |
-
</td>
|
380 |
-
</tr>
|
381 |
-
<?php
|
382 |
-
}
|
383 |
-
|
384 |
-
/**
|
385 |
-
* Render Post authors.
|
386 |
-
*
|
387 |
-
* @since 1.0
|
388 |
-
* @return void
|
389 |
-
*/
|
390 |
-
function wpbd_render_form_users(){
|
391 |
-
?>
|
392 |
-
<tr>
|
393 |
-
<th scope="row">
|
394 |
-
<?php _e('Authors :','wp-bulk-delete'); ?>
|
395 |
-
</th>
|
396 |
-
<td>
|
397 |
-
<?php $args = array(
|
398 |
-
'orderby' => 'display_name',
|
399 |
-
'order' => 'ASC',
|
400 |
-
'fields' => array( 'display_name', 'ID'),
|
401 |
-
);
|
402 |
-
$authors = get_users( $args );
|
403 |
-
if( !empty($authors) ){
|
404 |
-
?>
|
405 |
-
<select name="delete_authors[]" multiple="multiple">
|
406 |
-
<?php foreach($authors as $author){
|
407 |
-
?>
|
408 |
-
<option value="<?php echo $author->ID; ?>"><?php printf( __( '%s', 'wp-bulk-delete' ), $author->display_name ) ; ?></option>
|
409 |
-
<?php
|
410 |
-
}
|
411 |
-
?>
|
412 |
-
</select>
|
413 |
-
<?php
|
414 |
-
}
|
415 |
-
?>
|
416 |
-
</td>
|
417 |
-
</tr>
|
418 |
-
|
419 |
-
|
420 |
-
<?php
|
421 |
-
}
|
422 |
-
|
423 |
-
/**
|
424 |
-
* Render Post limit.
|
425 |
-
*
|
426 |
-
* @since 1.0
|
427 |
-
* @return void
|
428 |
-
*/
|
429 |
-
function wpbd_render_limit_post(){
|
430 |
-
?>
|
431 |
-
<tr>
|
432 |
-
<th scope="row">
|
433 |
-
<?php _e('Limit :','wp-bulk-delete'); ?>
|
434 |
-
</th>
|
435 |
-
<td>
|
436 |
-
<input type="number" min="1" id="limit_post" name="limit_post" class="limit_post_input" />
|
437 |
-
<p class="description">
|
438 |
-
<?php _e('Set the limit over post delete. It will delete only first limit posts. This option will help you in case of you have lots of posts to delete and script timeout.','wp-bulk-delete'); ?>
|
439 |
-
</p>
|
440 |
-
</td>
|
441 |
-
</tr>
|
442 |
-
<?php
|
443 |
-
}
|
444 |
-
|
445 |
-
/**
|
446 |
-
* Render Custom Fields.
|
447 |
-
*
|
448 |
-
* @since 1.0
|
449 |
-
* @return void
|
450 |
-
*/
|
451 |
-
function wpbd_render_form_custom_fields(){
|
452 |
-
?>
|
453 |
-
<tr>
|
454 |
-
<th scope="row">
|
455 |
-
<?php _e('Custom fields settings :','wp-bulk-delete'); ?>
|
456 |
-
</th>
|
457 |
-
<td>
|
458 |
-
<?php esc_html_e( 'Custom Fields Key', 'wp-bulk-delete' ); ?>
|
459 |
-
<input type="text" id="disabled_sample1" name="disabled_sample1" class="disabled_sample1" disabled="disabled" />
|
460 |
-
<select name="disabled_sample2" disabled="disabled">
|
461 |
-
<option value="equal_to_str"><?php esc_html_e( 'equal to ( string )', 'wp-bulk-delete' ); ?></option>
|
462 |
-
</select>
|
463 |
-
<?php esc_html_e( 'Value', 'wp-bulk-delete' ); ?>
|
464 |
-
<input type="text" id="disabled_sample3" name="disabled_sample3" class="disabled_sample3" disabled="disabled" />
|
465 |
-
<br />
|
466 |
-
<span style="color: red">Available in Pro version. </span><a href="<?php echo esc_url(WPBD_PLUGIN_BUY_NOW_URL); ?>">Buy Now</a>
|
467 |
-
</td>
|
468 |
-
</tr>
|
469 |
-
<?php
|
470 |
-
}
|
471 |
-
|
472 |
-
/**
|
473 |
-
* Render cleup options
|
474 |
-
*
|
475 |
-
* @since 1.0
|
476 |
-
* @return void
|
477 |
-
*/
|
478 |
-
function wpbd_render_post_cleanup(){
|
479 |
-
?>
|
480 |
-
<tr>
|
481 |
-
<th scope="row">
|
482 |
-
<?php _e('Cleanup Posts :','wp-bulk-delete'); ?>
|
483 |
-
</th>
|
484 |
-
<td>
|
485 |
-
<fieldset>
|
486 |
-
<label for="cleanup_post_type">
|
487 |
-
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_revision" type="checkbox" value="revision" checked="checked">
|
488 |
-
<?php printf( __( 'Revisions (%d Revisions)', 'wp-bulk-delete' ), wpbulkdelete()->api->get_post_count('revision') ); ?>
|
489 |
-
</label>
|
490 |
-
</fieldset>
|
491 |
-
|
492 |
-
<fieldset>
|
493 |
-
<label for="cleanup_post_type">
|
494 |
-
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_trash" type="checkbox" value="trash" checked="checked">
|
495 |
-
<?php printf( __( 'Trash (Deleted Posts) (%d Trash)', 'wp-bulk-delete' ), wpbulkdelete()->api->get_post_count('trash') ); ?>
|
496 |
-
</label>
|
497 |
-
</fieldset>
|
498 |
-
|
499 |
-
<fieldset>
|
500 |
-
<label for="cleanup_post_type">
|
501 |
-
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_revision" type="checkbox" value="auto_drafts" checked="checked">
|
502 |
-
<?php printf( __( 'Auto Drafts (%d Auto Drafts)', 'wp-bulk-delete' ), wpbulkdelete()->api->get_post_count('auto_drafts') ); ?>
|
503 |
-
</label>
|
504 |
-
</fieldset>
|
505 |
-
</td>
|
506 |
-
</tr>
|
507 |
-
<?php
|
508 |
-
}
|
509 |
-
|
510 |
-
/**
|
511 |
-
* Render Delete Time.
|
512 |
-
*
|
513 |
-
* @since 1.2
|
514 |
-
* @return void
|
515 |
-
*/
|
516 |
-
function wpbd_render_delete_time(){
|
517 |
-
?>
|
518 |
-
<tr>
|
519 |
-
<th scope="row">
|
520 |
-
<?php _e('Delete Time :','wp-bulk-delete'); ?>
|
521 |
-
</th>
|
522 |
-
<td>
|
523 |
-
<input type="radio" id="delete_time_now" name="delete_time" class="delete_time" value="now" checked="checked"/>
|
524 |
-
<?php _e( 'Delete now', 'wp-bulk-delete' ); ?><br />
|
525 |
-
<input type="radio" id="delete_time_later" name="delete_time" class="delete_time" value="scheduled" <?php echo( ( ! wpbd_is_pro() ) ? 'disabled="disabled"' : '' ); ?>/>
|
526 |
-
<?php _e( 'Schedule delete at', 'wp-bulk-delete' ); ?>
|
527 |
-
<input type="text" id="delete_datetime" name="delete_datetime" class="delete_all_datetimepicker" placeholder="YYYY-MM-DD HH:mm:ss" <?php echo( ( ! wpbd_is_pro() ) ? 'disabled="disabled"' : '' ); ?>/>
|
528 |
-
<?php
|
529 |
-
_e( 'repeat', 'wp-bulk-delete' );
|
530 |
-
wpbd_render_import_frequency();
|
531 |
-
do_action( 'wpbd_display_available_in_pro');
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
*
|
545 |
-
*
|
546 |
-
* @
|
547 |
-
* @
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
*
|
581 |
-
*
|
582 |
-
*
|
583 |
-
*
|
584 |
-
* @
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Form Process
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Form Process
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
/** Actions *************************************************************/
|
15 |
+
// By Posttype
|
16 |
+
add_action( 'render_form_by_posttype', 'wpbd_render_form_posttype' );
|
17 |
+
add_action( 'render_form_by_posttype', 'wpbd_render_common_form' );
|
18 |
+
|
19 |
+
// By Author
|
20 |
+
add_action( 'render_form_by_author', 'wpbd_render_form_posttype' );
|
21 |
+
add_action( 'render_form_by_author', 'wpbd_render_form_users' );
|
22 |
+
add_action( 'render_form_by_author', 'wpbd_render_common_form' );
|
23 |
+
|
24 |
+
|
25 |
+
// By Title & Content
|
26 |
+
add_action( 'render_form_by_title', 'wpbd_render_form_posttype', 10 );
|
27 |
+
add_action( 'render_form_by_title', 'wpbd_render_form_post_contains', 20 );
|
28 |
+
add_action( 'render_form_by_title', 'wpbd_render_common_form', 30 );
|
29 |
+
|
30 |
+
// By Taxonomy.
|
31 |
+
add_action( 'render_form_by_taxonomy', 'wpbd_render_form_posttype_dropdown' );
|
32 |
+
add_action( 'render_form_by_taxonomy', 'wpbd_render_form_taxonomy' );
|
33 |
+
add_action( 'render_form_by_taxonomy', 'wpbd_render_common_form' );
|
34 |
+
|
35 |
+
// By Custom Fields
|
36 |
+
add_action( 'render_form_by_custom_fields', 'wpbd_render_form_posttype', 10 );
|
37 |
+
add_action( 'render_form_by_custom_fields', 'wpbd_render_form_custom_fields', 20 );
|
38 |
+
add_action( 'render_form_by_custom_fields', 'wpbd_render_common_form', 30 );
|
39 |
+
|
40 |
+
// General
|
41 |
+
add_action( 'render_form_general', 'wpbd_render_form_posttype_dropdown', 10 );
|
42 |
+
add_action( 'render_form_general', 'wpbd_render_form_taxonomy', 20 );
|
43 |
+
add_action( 'render_form_general', 'wpbd_render_form_users', 30 );
|
44 |
+
add_action( 'render_form_general', 'wpbd_render_form_custom_fields', 40 );
|
45 |
+
add_action( 'render_form_general', 'wpbd_render_form_post_contains', 50 );
|
46 |
+
add_action( 'render_form_general', 'wpbd_render_common_form', 60 );
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Process Delete posts form
|
50 |
+
*
|
51 |
+
*
|
52 |
+
* @since 1.0
|
53 |
+
* @param array $data Form pot Data.
|
54 |
+
* @return array | posts ID to be delete.
|
55 |
+
*/
|
56 |
+
function xt_delete_posts_form_process( $data ) {
|
57 |
+
$error = array();
|
58 |
+
|
59 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
60 |
+
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
61 |
+
}
|
62 |
+
|
63 |
+
if ( isset( $data['_delete_all_posts_wpnonce'] ) && wp_verify_nonce( $data['_delete_all_posts_wpnonce'], 'delete_posts_nonce' ) ) {
|
64 |
+
|
65 |
+
if( empty( $error ) ) {
|
66 |
+
$delete_time = ( $data['delete_time'] ) ? $data['delete_time'] : 'now';
|
67 |
+
$delete_datetime = ( $data['delete_datetime'] ) ? $data['delete_datetime'] : '';
|
68 |
+
if( $delete_time === 'scheduled' && !empty($delete_datetime) && wpbd_is_pro() ) {
|
69 |
+
$data['delete_entity'] = 'post';
|
70 |
+
return wpbd_save_scheduled_delete($data);
|
71 |
+
}
|
72 |
+
|
73 |
+
// Get post_ids for delete based on user input.
|
74 |
+
$post_ids = wpbulkdelete()->api->get_delete_posts_ids( $data );
|
75 |
+
if ( ! empty( $post_ids ) && count( $post_ids ) > 0 ) {
|
76 |
+
$force_delete = false;
|
77 |
+
if ( $data['delete_type'] === 'permenant' ) {
|
78 |
+
$force_delete = true;
|
79 |
+
}
|
80 |
+
|
81 |
+
$post_count = wpbulkdelete()->api->do_delete_posts( $post_ids, $force_delete );
|
82 |
+
return array(
|
83 |
+
'status' => 1,
|
84 |
+
'messages' => array( sprintf( esc_html__( '%d Record deleted successfully.', 'wp-bulk-delete' ), $post_count)
|
85 |
+
) );
|
86 |
+
} else {
|
87 |
+
return array(
|
88 |
+
'status' => 1,
|
89 |
+
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
90 |
+
);
|
91 |
+
}
|
92 |
+
|
93 |
+
} else {
|
94 |
+
return array(
|
95 |
+
'status' => 0,
|
96 |
+
'messages' => $error,
|
97 |
+
);
|
98 |
+
}
|
99 |
+
|
100 |
+
} else {
|
101 |
+
wp_die( esc_html__( 'Sorry, Your nonce did not verify.', 'wp-bulk-delete' ) );
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Render Posttype checkboxes.
|
107 |
+
*
|
108 |
+
* @since 1.0
|
109 |
+
* @return void
|
110 |
+
*/
|
111 |
+
function wpbd_render_form_posttype(){
|
112 |
+
global $wp_post_types;
|
113 |
+
$ingnore_types = array('attachment','revision','nav_menu_item');
|
114 |
+
$types = array();
|
115 |
+
if( !empty( $wp_post_types ) ){
|
116 |
+
foreach( $wp_post_types as $key_type => $post_type ){
|
117 |
+
if( in_array( $key_type, $ingnore_types ) ){
|
118 |
+
continue;
|
119 |
+
}else{
|
120 |
+
$types[$key_type] = $post_type->labels->name;
|
121 |
+
}
|
122 |
+
}
|
123 |
+
}
|
124 |
+
?>
|
125 |
+
<tr>
|
126 |
+
<th scope="row">
|
127 |
+
<?php _e('Post type of items to delete :','wp-bulk-delete'); ?>
|
128 |
+
</th>
|
129 |
+
<td>
|
130 |
+
<?php
|
131 |
+
if( !empty( $types ) ){
|
132 |
+
foreach( $types as $key_type => $type ){
|
133 |
+
?>
|
134 |
+
<fieldset>
|
135 |
+
<label for="delete_post_type">
|
136 |
+
<input name="delete_post_type[]" class="delete_post_type" id="<?php echo $key_type; ?>" type="checkbox" value="<?php echo $key_type; ?>" <?php if( 'post' == $key_type ){ echo 'checked="checked"'; } ?>>
|
137 |
+
<?php printf( __( '%s', 'wp-bulk-delete' ), $type ); ?>
|
138 |
+
<?php $post_count = wpbd_get_posttype_post_count( $key_type );
|
139 |
+
if( $post_count >= 0 ){
|
140 |
+
echo '('.$post_count .' '. $type .')';
|
141 |
+
}
|
142 |
+
?>
|
143 |
+
</label>
|
144 |
+
</fieldset>
|
145 |
+
<?php
|
146 |
+
}
|
147 |
+
}else{
|
148 |
+
_e('No post types are there, WP Bulk Delete will not work.','wp-bulk-delete');
|
149 |
+
}
|
150 |
+
?>
|
151 |
+
</td>
|
152 |
+
</tr>
|
153 |
+
<?php
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Render Post type Dropdown.
|
158 |
+
*
|
159 |
+
* @since 1.0
|
160 |
+
* @return void
|
161 |
+
*/
|
162 |
+
function wpbd_render_form_posttype_dropdown(){
|
163 |
+
global $wp_post_types;
|
164 |
+
$ingnore_types = array('attachment','revision','nav_menu_item');
|
165 |
+
$types = array();
|
166 |
+
if( !empty( $wp_post_types ) ){
|
167 |
+
foreach( $wp_post_types as $key_type => $post_type ){
|
168 |
+
if( in_array( $key_type, $ingnore_types ) ){
|
169 |
+
continue;
|
170 |
+
}else{
|
171 |
+
$types[$key_type] = $post_type->labels->name;
|
172 |
+
}
|
173 |
+
}
|
174 |
+
}
|
175 |
+
?>
|
176 |
+
<tr>
|
177 |
+
<th scope="row">
|
178 |
+
<?php _e('Post type of items to delete :','wp-bulk-delete'); ?>
|
179 |
+
</th>
|
180 |
+
<td>
|
181 |
+
<select name="delete_post_type" class="delete_post_type" id="delete_post_type" required="required">
|
182 |
+
<?php
|
183 |
+
if( !empty( $types ) ){
|
184 |
+
foreach( $types as $key_type => $type ){
|
185 |
+
?>
|
186 |
+
<fieldset>
|
187 |
+
<label for="delete_post_type">
|
188 |
+
<option value="<?php echo $key_type; ?>">
|
189 |
+
<?php printf( __( '%s', 'wp-bulk-delete' ), $type ); ?>
|
190 |
+
</option>
|
191 |
+
</label>
|
192 |
+
</fieldset>
|
193 |
+
<?php
|
194 |
+
}
|
195 |
+
}else{
|
196 |
+
_e('No post types are there, WP Bulk Delete will not work.','wp-bulk-delete');
|
197 |
+
}
|
198 |
+
?>
|
199 |
+
</select>
|
200 |
+
</td>
|
201 |
+
</tr>
|
202 |
+
<?php
|
203 |
+
}
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Render taxonomies.
|
207 |
+
*
|
208 |
+
* @since 1.0
|
209 |
+
* @return void
|
210 |
+
*/
|
211 |
+
function wpbd_render_form_taxonomy(){
|
212 |
+
?>
|
213 |
+
<tr>
|
214 |
+
<th scope="row">
|
215 |
+
<?php _e('Post Taxonomy :','wp-bulk-delete'); ?>
|
216 |
+
</th>
|
217 |
+
<td>
|
218 |
+
<div class="post_taxonomy">
|
219 |
+
</div>
|
220 |
+
</td>
|
221 |
+
</tr>
|
222 |
+
<tr>
|
223 |
+
<th scope="row" class="taxo_terms_title">
|
224 |
+
|
225 |
+
<?php //_e('Post Taxonomy :','wp-bulk-delete'); ?>
|
226 |
+
</th>
|
227 |
+
<td>
|
228 |
+
<div class="post_taxo_terms">
|
229 |
+
</div>
|
230 |
+
</td>
|
231 |
+
</tr>
|
232 |
+
<script>
|
233 |
+
jQuery(document).ready(function(){
|
234 |
+
jQuery('#delete_post_type').trigger( 'change' );
|
235 |
+
});
|
236 |
+
</script>
|
237 |
+
<?php
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Render Post Statuses.
|
242 |
+
*
|
243 |
+
* @since 1.0
|
244 |
+
* @return void
|
245 |
+
*/
|
246 |
+
function wpbd_render_form_poststatus(){
|
247 |
+
?>
|
248 |
+
<tr>
|
249 |
+
<th scope="row">Post Status</th>
|
250 |
+
<td>
|
251 |
+
<fieldset>
|
252 |
+
<label for="delete_post_status">
|
253 |
+
<input name="delete_post_status[]" id="publish" value="publish" type="checkbox" checked="checked">
|
254 |
+
Published
|
255 |
+
</label>
|
256 |
+
</fieldset>
|
257 |
+
<fieldset>
|
258 |
+
<label for="delete_post_status">
|
259 |
+
<input name="delete_post_status[]" id="future" value="future" type="checkbox">
|
260 |
+
Scheduled
|
261 |
+
</label>
|
262 |
+
</fieldset>
|
263 |
+
<fieldset>
|
264 |
+
<label for="delete_post_status">
|
265 |
+
<input name="delete_post_status[]" id="draft" value="draft" type="checkbox">
|
266 |
+
Draft
|
267 |
+
</label>
|
268 |
+
</fieldset>
|
269 |
+
<fieldset>
|
270 |
+
<label for="delete_post_status">
|
271 |
+
<input name="delete_post_status[]" id="pending" value="pending" type="checkbox">
|
272 |
+
Pending
|
273 |
+
</label>
|
274 |
+
</fieldset>
|
275 |
+
<fieldset>
|
276 |
+
<label for="delete_post_status">
|
277 |
+
<input name="delete_post_status[]" id="private" value="private" type="checkbox">
|
278 |
+
Private
|
279 |
+
</label>
|
280 |
+
</fieldset>
|
281 |
+
</td>
|
282 |
+
</tr>
|
283 |
+
<?php
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Render Date intervals.
|
288 |
+
*
|
289 |
+
* @since 1.0
|
290 |
+
* @return void
|
291 |
+
*/
|
292 |
+
function wpbd_render_form_date_interval(){
|
293 |
+
?>
|
294 |
+
<tr>
|
295 |
+
<th scope="row">
|
296 |
+
<?php _e('Post Date :','wp-bulk-delete'); ?>
|
297 |
+
</th>
|
298 |
+
<td>
|
299 |
+
<?php _e('Delete Posts which are','wp-bulk-delete'); ?>
|
300 |
+
<select name="date_type" class="date_type">
|
301 |
+
<option value="older_than"><?php _e('older than','wp-bulk-delete'); ?></option>
|
302 |
+
<option value="within_last"><?php _e('posted within last','wp-bulk-delete'); ?></option>
|
303 |
+
<option value="custom_date"><?php _e('posted between','wp-bulk-delete'); ?></option>
|
304 |
+
</select>
|
305 |
+
<div class="wpbd_date_days wpbd_inline">
|
306 |
+
<input type="number" id="input_days" name="input_days" class="wpbd_input_days" placeholder="0" min="0" /> <?php _e('days','wp-bulk-delete'); ?>
|
307 |
+
</div>
|
308 |
+
<div class="wpbd_custom_interval wpbd_inline" style="display:none;">
|
309 |
+
<input type="text" id="delete_start_date" name="delete_start_date" class="delete_all_datepicker" placeholder="<?php _e('Start Date','wp-bulk-delete'); ?>" />
|
310 |
+
-
|
311 |
+
<input type="text" id="delete_end_date" name="delete_end_date" class="delete_all_datepicker" placeholder="<?php _e('End Date','wp-bulk-delete'); ?>" />
|
312 |
+
<p class="description">
|
313 |
+
<?php _e('Set the date interval for items to delete, or leave these fields blank to select all posts. The dates must be specified in the following format: <strong>YYYY-MM-DD</strong>','wp-bulk-delete'); ?>
|
314 |
+
</p>
|
315 |
+
</div>
|
316 |
+
</td>
|
317 |
+
</tr>
|
318 |
+
<?php
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* Render Post title and content contains.
|
323 |
+
*
|
324 |
+
* @since 1.0
|
325 |
+
* @return void
|
326 |
+
*/
|
327 |
+
function wpbd_render_form_post_contains(){
|
328 |
+
?>
|
329 |
+
<tr>
|
330 |
+
<th scope="row">
|
331 |
+
<?php _e('If Post Title Contains :','wp-bulk-delete'); ?>
|
332 |
+
</th>
|
333 |
+
<td>
|
334 |
+
<input type="text" id="disabled_sample4" name="disabled_sample4" class="disabled_sample4" disabled="disabled" />
|
335 |
+
<?php _e( 'Then', 'wp-bulk-delete' ); ?>
|
336 |
+
<select name="disabled_sample5" disabled="disabled">
|
337 |
+
<option value=""><?php _e( 'Delete It.', 'wp-bulk-delete' ); ?> </option>
|
338 |
+
<option value=""><?php _e( "Don't delete It.", "wp-bulk-delete" ); ?> </option>
|
339 |
+
</select>
|
340 |
+
<br/>
|
341 |
+
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
342 |
+
</td>
|
343 |
+
</tr>
|
344 |
+
<tr>
|
345 |
+
<th scope="row">
|
346 |
+
<?php _e('If Post Content Contains :','wp-bulk-delete'); ?>
|
347 |
+
</th>
|
348 |
+
<td>
|
349 |
+
<input type="text" id="disabled_sample6" name="disabled_sample6" class="disabled_sample6" disabled="disabled" />
|
350 |
+
<?php _e( 'Then', 'wp-bulk-delete' ); ?>
|
351 |
+
<select name="disabled_sample7" disabled="disabled">
|
352 |
+
<option value=""><?php _e( 'Delete It.', 'wp-bulk-delete' ); ?> </option>
|
353 |
+
<option value=""><?php _e( "Don't delete It.", "wp-bulk-delete" ); ?> </option>
|
354 |
+
</select>
|
355 |
+
<br/>
|
356 |
+
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
357 |
+
</td>
|
358 |
+
</tr>
|
359 |
+
<?php
|
360 |
+
}
|
361 |
+
|
362 |
+
/**
|
363 |
+
* Render Delete type.
|
364 |
+
*
|
365 |
+
* @since 1.0
|
366 |
+
* @return void
|
367 |
+
*/
|
368 |
+
function wpbd_render_form_delete_type(){
|
369 |
+
?>
|
370 |
+
<tr>
|
371 |
+
<th scope="row">
|
372 |
+
<?php _e('Post Delete Type :','wp-bulk-delete'); ?>
|
373 |
+
</th>
|
374 |
+
<td>
|
375 |
+
<input type="radio" id="delete_type" name="delete_type" class="delete_type" value="trash" checked="checked"/>
|
376 |
+
<?php _e( 'Move to Trash', 'wp-bulk-delete' ); ?>
|
377 |
+
<input type="radio" id="delete_type" name="delete_type" class="delete_type" value="permenant" />
|
378 |
+
<?php _e( 'Delete permanently', 'wp-bulk-delete' ); ?>
|
379 |
+
</td>
|
380 |
+
</tr>
|
381 |
+
<?php
|
382 |
+
}
|
383 |
+
|
384 |
+
/**
|
385 |
+
* Render Post authors.
|
386 |
+
*
|
387 |
+
* @since 1.0
|
388 |
+
* @return void
|
389 |
+
*/
|
390 |
+
function wpbd_render_form_users(){
|
391 |
+
?>
|
392 |
+
<tr>
|
393 |
+
<th scope="row">
|
394 |
+
<?php _e('Authors :','wp-bulk-delete'); ?>
|
395 |
+
</th>
|
396 |
+
<td>
|
397 |
+
<?php $args = array(
|
398 |
+
'orderby' => 'display_name',
|
399 |
+
'order' => 'ASC',
|
400 |
+
'fields' => array( 'display_name', 'ID'),
|
401 |
+
);
|
402 |
+
$authors = get_users( $args );
|
403 |
+
if( !empty($authors) ){
|
404 |
+
?>
|
405 |
+
<select name="delete_authors[]" multiple="multiple">
|
406 |
+
<?php foreach($authors as $author){
|
407 |
+
?>
|
408 |
+
<option value="<?php echo $author->ID; ?>"><?php printf( __( '%s', 'wp-bulk-delete' ), $author->display_name ) ; ?></option>
|
409 |
+
<?php
|
410 |
+
}
|
411 |
+
?>
|
412 |
+
</select>
|
413 |
+
<?php
|
414 |
+
}
|
415 |
+
?>
|
416 |
+
</td>
|
417 |
+
</tr>
|
418 |
+
|
419 |
+
|
420 |
+
<?php
|
421 |
+
}
|
422 |
+
|
423 |
+
/**
|
424 |
+
* Render Post limit.
|
425 |
+
*
|
426 |
+
* @since 1.0
|
427 |
+
* @return void
|
428 |
+
*/
|
429 |
+
function wpbd_render_limit_post(){
|
430 |
+
?>
|
431 |
+
<tr>
|
432 |
+
<th scope="row">
|
433 |
+
<?php _e('Limit :','wp-bulk-delete'); ?>
|
434 |
+
</th>
|
435 |
+
<td>
|
436 |
+
<input type="number" min="1" id="limit_post" name="limit_post" class="limit_post_input" />
|
437 |
+
<p class="description">
|
438 |
+
<?php _e('Set the limit over post delete. It will delete only first limit posts. This option will help you in case of you have lots of posts to delete and script timeout.','wp-bulk-delete'); ?>
|
439 |
+
</p>
|
440 |
+
</td>
|
441 |
+
</tr>
|
442 |
+
<?php
|
443 |
+
}
|
444 |
+
|
445 |
+
/**
|
446 |
+
* Render Custom Fields.
|
447 |
+
*
|
448 |
+
* @since 1.0
|
449 |
+
* @return void
|
450 |
+
*/
|
451 |
+
function wpbd_render_form_custom_fields(){
|
452 |
+
?>
|
453 |
+
<tr>
|
454 |
+
<th scope="row">
|
455 |
+
<?php _e('Custom fields settings :','wp-bulk-delete'); ?>
|
456 |
+
</th>
|
457 |
+
<td>
|
458 |
+
<?php esc_html_e( 'Custom Fields Key', 'wp-bulk-delete' ); ?>
|
459 |
+
<input type="text" id="disabled_sample1" name="disabled_sample1" class="disabled_sample1" disabled="disabled" />
|
460 |
+
<select name="disabled_sample2" disabled="disabled">
|
461 |
+
<option value="equal_to_str"><?php esc_html_e( 'equal to ( string )', 'wp-bulk-delete' ); ?></option>
|
462 |
+
</select>
|
463 |
+
<?php esc_html_e( 'Value', 'wp-bulk-delete' ); ?>
|
464 |
+
<input type="text" id="disabled_sample3" name="disabled_sample3" class="disabled_sample3" disabled="disabled" />
|
465 |
+
<br />
|
466 |
+
<span style="color: red">Available in Pro version. </span><a href="<?php echo esc_url(WPBD_PLUGIN_BUY_NOW_URL); ?>">Buy Now</a>
|
467 |
+
</td>
|
468 |
+
</tr>
|
469 |
+
<?php
|
470 |
+
}
|
471 |
+
|
472 |
+
/**
|
473 |
+
* Render cleup options
|
474 |
+
*
|
475 |
+
* @since 1.0
|
476 |
+
* @return void
|
477 |
+
*/
|
478 |
+
function wpbd_render_post_cleanup(){
|
479 |
+
?>
|
480 |
+
<tr>
|
481 |
+
<th scope="row">
|
482 |
+
<?php _e('Cleanup Posts :','wp-bulk-delete'); ?>
|
483 |
+
</th>
|
484 |
+
<td>
|
485 |
+
<fieldset>
|
486 |
+
<label for="cleanup_post_type">
|
487 |
+
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_revision" type="checkbox" value="revision" checked="checked">
|
488 |
+
<?php printf( __( 'Revisions (%d Revisions)', 'wp-bulk-delete' ), wpbulkdelete()->api->get_post_count('revision') ); ?>
|
489 |
+
</label>
|
490 |
+
</fieldset>
|
491 |
+
|
492 |
+
<fieldset>
|
493 |
+
<label for="cleanup_post_type">
|
494 |
+
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_trash" type="checkbox" value="trash" checked="checked">
|
495 |
+
<?php printf( __( 'Trash (Deleted Posts) (%d Trash)', 'wp-bulk-delete' ), wpbulkdelete()->api->get_post_count('trash') ); ?>
|
496 |
+
</label>
|
497 |
+
</fieldset>
|
498 |
+
|
499 |
+
<fieldset>
|
500 |
+
<label for="cleanup_post_type">
|
501 |
+
<input name="cleanup_post_type[]" class="cleanup_post_type" id="cleanup_revision" type="checkbox" value="auto_drafts" checked="checked">
|
502 |
+
<?php printf( __( 'Auto Drafts (%d Auto Drafts)', 'wp-bulk-delete' ), wpbulkdelete()->api->get_post_count('auto_drafts') ); ?>
|
503 |
+
</label>
|
504 |
+
</fieldset>
|
505 |
+
</td>
|
506 |
+
</tr>
|
507 |
+
<?php
|
508 |
+
}
|
509 |
+
|
510 |
+
/**
|
511 |
+
* Render Delete Time.
|
512 |
+
*
|
513 |
+
* @since 1.2
|
514 |
+
* @return void
|
515 |
+
*/
|
516 |
+
function wpbd_render_delete_time(){
|
517 |
+
?>
|
518 |
+
<tr>
|
519 |
+
<th scope="row">
|
520 |
+
<?php _e('Delete Time :','wp-bulk-delete'); ?>
|
521 |
+
</th>
|
522 |
+
<td>
|
523 |
+
<input type="radio" id="delete_time_now" name="delete_time" class="delete_time" value="now" checked="checked"/>
|
524 |
+
<?php _e( 'Delete now', 'wp-bulk-delete' ); ?><br />
|
525 |
+
<input type="radio" id="delete_time_later" name="delete_time" class="delete_time" value="scheduled" <?php echo( ( ! wpbd_is_pro() ) ? 'disabled="disabled"' : '' ); ?>/>
|
526 |
+
<?php _e( 'Schedule delete at', 'wp-bulk-delete' ); ?>
|
527 |
+
<input type="text" id="delete_datetime" name="delete_datetime" class="delete_all_datetimepicker" placeholder="YYYY-MM-DD HH:mm:ss" <?php echo( ( ! wpbd_is_pro() ) ? 'disabled="disabled"' : '' ); ?>/>
|
528 |
+
<?php
|
529 |
+
_e( 'repeat', 'wp-bulk-delete' );
|
530 |
+
wpbd_render_import_frequency();
|
531 |
+
do_action( 'wpbd_display_available_in_pro');
|
532 |
+
$timezone = wpbd_get_timezone_string();
|
533 |
+
?>
|
534 |
+
<p class="description">
|
535 |
+
<strong><?php printf( esc_html__( 'Timezone: (%s)', 'wp-bulk-delete' ), $timezone ); ?></strong><br/>
|
536 |
+
<?php _e('Scheduled delete runs using cron and backgroud process. So, its useful for delete huge number of records and repeatative delete.','wp-bulk-delete'); ?>
|
537 |
+
</p>
|
538 |
+
</td>
|
539 |
+
</tr>
|
540 |
+
<?php
|
541 |
+
}
|
542 |
+
|
543 |
+
/**
|
544 |
+
* Render import Frequency
|
545 |
+
*
|
546 |
+
* @since 1.2.0
|
547 |
+
* @param string $selected Selected import frequency.
|
548 |
+
* @return void
|
549 |
+
*/
|
550 |
+
function wpbd_render_import_frequency( $selected = 'not_repeat' ) {
|
551 |
+
?>
|
552 |
+
<select name="delete_frequency" class="delete_frequency" <?php echo( ( ! wpbd_is_pro() ) ? 'disabled="disabled"' : '' ); ?> >
|
553 |
+
<option value='not_repeat' <?php selected( $selected, 'not_repeat' ); ?>>
|
554 |
+
<?php esc_html_e( 'Don\'t repeat', 'wp-bulk-delete' ); ?>
|
555 |
+
</option>
|
556 |
+
<option value='hourly' <?php selected( $selected, 'hourly' ); ?>>
|
557 |
+
<?php esc_html_e( 'Once Hourly', 'wp-bulk-delete' ); ?>
|
558 |
+
</option>
|
559 |
+
<option value='twicedaily' <?php selected( $selected, 'twicedaily' ); ?>>
|
560 |
+
<?php esc_html_e( 'Twice Daily', 'wp-bulk-delete' ); ?>
|
561 |
+
</option>
|
562 |
+
<option value="daily" <?php selected( $selected, 'daily' ); ?> >
|
563 |
+
<?php esc_html_e( 'Once Daily', 'wp-bulk-delete' ); ?>
|
564 |
+
</option>
|
565 |
+
<option value="weekly" <?php selected( $selected, 'weekly' ); ?>>
|
566 |
+
<?php esc_html_e( 'Once Weekly', 'wp-bulk-delete' ); ?>
|
567 |
+
</option>
|
568 |
+
<option value="monthly" <?php selected( $selected, 'monthly' ); ?>>
|
569 |
+
<?php esc_html_e( 'Once a Month', 'wp-bulk-delete' ); ?>
|
570 |
+
</option>
|
571 |
+
</select>
|
572 |
+
<span class="wpbd_schedule_name_wrap" style="display:none;">
|
573 |
+
<?php _e( 'Save it as ', 'wp-bulk-delete' ); ?>
|
574 |
+
<input type="text" name="schedule_name" placeholder="<?php _e( 'eg: Daily Post Delete', 'wp-bulk-delete' ); ?>" class="wpbd_schedule_name"/>
|
575 |
+
</span>
|
576 |
+
<?php
|
577 |
+
}
|
578 |
+
|
579 |
+
/**
|
580 |
+
* Render Common form.
|
581 |
+
*
|
582 |
+
* Render common component of form.
|
583 |
+
*
|
584 |
+
* @since 1.0
|
585 |
+
* @return void
|
586 |
+
*/
|
587 |
+
function wpbd_render_common_form(){
|
588 |
+
?>
|
589 |
+
<tr>
|
590 |
+
<th scope="row">
|
591 |
+
<?php _e('Filter your posts :','wp-bulk-delete'); ?>
|
592 |
+
</th>
|
593 |
+
</tr>
|
594 |
+
<?php
|
595 |
+
|
596 |
+
wpbd_render_form_poststatus();
|
597 |
+
|
598 |
+
wpbd_render_form_date_interval();
|
599 |
+
|
600 |
+
wpbd_render_form_delete_type();
|
601 |
+
|
602 |
+
wpbd_render_limit_post();
|
603 |
+
|
604 |
+
wpbd_render_delete_time();
|
605 |
+
}
|
606 |
+
|
607 |
+
function wpbd_get_timezone_string() {
|
608 |
+
$timezone_string = get_option( 'timezone_string' );
|
609 |
+
|
610 |
+
if ( $timezone_string ) {
|
611 |
+
return $timezone_string;
|
612 |
+
}
|
613 |
+
|
614 |
+
$offset = (float) get_option( 'gmt_offset' );
|
615 |
+
$hours = (int) $offset;
|
616 |
+
$minutes = ( $offset - $hours );
|
617 |
+
|
618 |
+
$sign = ( $offset < 0 ) ? '-' : '+';
|
619 |
+
$abs_hour = abs( $hours );
|
620 |
+
$abs_mins = abs( $minutes * 60 );
|
621 |
+
$tz_offset = sprintf( '%s%02d:%02d', $sign, $abs_hour, $abs_mins );
|
622 |
+
|
623 |
+
return $tz_offset;
|
624 |
+
}
|
includes/delele-terms-form-functions.php
CHANGED
@@ -1,95 +1,95 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Delete Terms Form Funcitons
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Delete Terms Form Funcitons
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
/** Actions *************************************************************/
|
15 |
-
add_action( 'wpbd_delete_terms_form', 'wpbd_render_form_posttype_dropdown' );
|
16 |
-
add_action( 'wpbd_delete_terms_form', 'wpbd_render_delete_terms_taxonomy' );
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Process Delete Terms form
|
20 |
-
*
|
21 |
-
*
|
22 |
-
* @since 1.1.0
|
23 |
-
* @param array $data Form post Data.
|
24 |
-
* @return array | posts ID to be delete.
|
25 |
-
*/
|
26 |
-
function xt_delete_terms_form_process( $data ) {
|
27 |
-
$error = array();
|
28 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
29 |
-
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
30 |
-
}
|
31 |
-
if( $data['delete_post_type'] == '' || $data['post_taxonomy'] == '' ){
|
32 |
-
$error[] = esc_html__('Please select required fields for proceed delete operation.', 'wp-bulk-delete' );
|
33 |
-
}
|
34 |
-
|
35 |
-
if ( !isset( $data['_delete_terms_wpnonce'] ) || !wp_verify_nonce( $data['_delete_terms_wpnonce'], 'delete_terms_nonce' ) ) {
|
36 |
-
wp_die( esc_html__( 'Sorry, Your nonce did not verify.', 'wp-bulk-delete' ) );
|
37 |
-
}
|
38 |
-
|
39 |
-
if( empty( $error ) ){
|
40 |
-
|
41 |
-
$term_count = wpbulkdelete()->api->do_delete_terms( $data );
|
42 |
-
if( false === $term_count ){
|
43 |
-
return array(
|
44 |
-
'status' => 0,
|
45 |
-
'messages' => array( esc_html__( 'Something went wrong pelase try again!!', 'wp-bulk-delete' ) ),
|
46 |
-
);
|
47 |
-
}
|
48 |
-
|
49 |
-
if ( ! empty( $term_count ) && $term_count > 0 ) {
|
50 |
-
return array(
|
51 |
-
'status' => 1,
|
52 |
-
'messages' => array( sprintf( esc_html__( '%d Term(s) deleted successfully.', 'wp-bulk-delete' ), $term_count )
|
53 |
-
) );
|
54 |
-
} else {
|
55 |
-
return array(
|
56 |
-
'status' => 1,
|
57 |
-
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
58 |
-
);
|
59 |
-
}
|
60 |
-
|
61 |
-
} else {
|
62 |
-
return array(
|
63 |
-
'status' => 0,
|
64 |
-
'messages' => $error,
|
65 |
-
);
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Render taxonomies for terms.
|
72 |
-
*
|
73 |
-
* @since 1.0
|
74 |
-
* @return void
|
75 |
-
*/
|
76 |
-
function wpbd_render_delete_terms_taxonomy(){?>
|
77 |
-
<tr>
|
78 |
-
<th scope="row">
|
79 |
-
<?php _e('Post Taxonomy :','wp-bulk-delete'); ?>
|
80 |
-
</th>
|
81 |
-
<td>
|
82 |
-
<div class="post_taxonomy">
|
83 |
-
</div>
|
84 |
-
<p class="description">
|
85 |
-
<?php _e( 'Select the post taxonomy whose terms you want to delete.', 'wp-bulk-delete' ); ?>
|
86 |
-
</p>
|
87 |
-
</td>
|
88 |
-
</tr>
|
89 |
-
<script>
|
90 |
-
jQuery(document).ready(function(){
|
91 |
-
jQuery('#delete_post_type').trigger( 'change' );
|
92 |
-
});
|
93 |
-
</script>
|
94 |
-
<?php
|
95 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Delete Terms Form Funcitons
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Delete Terms Form Funcitons
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
/** Actions *************************************************************/
|
15 |
+
add_action( 'wpbd_delete_terms_form', 'wpbd_render_form_posttype_dropdown' );
|
16 |
+
add_action( 'wpbd_delete_terms_form', 'wpbd_render_delete_terms_taxonomy' );
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Process Delete Terms form
|
20 |
+
*
|
21 |
+
*
|
22 |
+
* @since 1.1.0
|
23 |
+
* @param array $data Form post Data.
|
24 |
+
* @return array | posts ID to be delete.
|
25 |
+
*/
|
26 |
+
function xt_delete_terms_form_process( $data ) {
|
27 |
+
$error = array();
|
28 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
29 |
+
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
30 |
+
}
|
31 |
+
if( $data['delete_post_type'] == '' || $data['post_taxonomy'] == '' ){
|
32 |
+
$error[] = esc_html__('Please select required fields for proceed delete operation.', 'wp-bulk-delete' );
|
33 |
+
}
|
34 |
+
|
35 |
+
if ( !isset( $data['_delete_terms_wpnonce'] ) || !wp_verify_nonce( $data['_delete_terms_wpnonce'], 'delete_terms_nonce' ) ) {
|
36 |
+
wp_die( esc_html__( 'Sorry, Your nonce did not verify.', 'wp-bulk-delete' ) );
|
37 |
+
}
|
38 |
+
|
39 |
+
if( empty( $error ) ){
|
40 |
+
|
41 |
+
$term_count = wpbulkdelete()->api->do_delete_terms( $data );
|
42 |
+
if( false === $term_count ){
|
43 |
+
return array(
|
44 |
+
'status' => 0,
|
45 |
+
'messages' => array( esc_html__( 'Something went wrong pelase try again!!', 'wp-bulk-delete' ) ),
|
46 |
+
);
|
47 |
+
}
|
48 |
+
|
49 |
+
if ( ! empty( $term_count ) && $term_count > 0 ) {
|
50 |
+
return array(
|
51 |
+
'status' => 1,
|
52 |
+
'messages' => array( sprintf( esc_html__( '%d Term(s) deleted successfully.', 'wp-bulk-delete' ), $term_count )
|
53 |
+
) );
|
54 |
+
} else {
|
55 |
+
return array(
|
56 |
+
'status' => 1,
|
57 |
+
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
58 |
+
);
|
59 |
+
}
|
60 |
+
|
61 |
+
} else {
|
62 |
+
return array(
|
63 |
+
'status' => 0,
|
64 |
+
'messages' => $error,
|
65 |
+
);
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Render taxonomies for terms.
|
72 |
+
*
|
73 |
+
* @since 1.0
|
74 |
+
* @return void
|
75 |
+
*/
|
76 |
+
function wpbd_render_delete_terms_taxonomy(){?>
|
77 |
+
<tr>
|
78 |
+
<th scope="row">
|
79 |
+
<?php _e('Post Taxonomy :','wp-bulk-delete'); ?>
|
80 |
+
</th>
|
81 |
+
<td>
|
82 |
+
<div class="post_taxonomy">
|
83 |
+
</div>
|
84 |
+
<p class="description">
|
85 |
+
<?php _e( 'Select the post taxonomy whose terms you want to delete.', 'wp-bulk-delete' ); ?>
|
86 |
+
</p>
|
87 |
+
</td>
|
88 |
+
</tr>
|
89 |
+
<script>
|
90 |
+
jQuery(document).ready(function(){
|
91 |
+
jQuery('#delete_post_type').trigger( 'change' );
|
92 |
+
});
|
93 |
+
</script>
|
94 |
+
<?php
|
95 |
+
}
|
includes/delele-users-form-functions.php
CHANGED
@@ -1,230 +1,230 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Delete Users Form Funcitons
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Delete Users Form Funcitons
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
/** Actions *************************************************************/
|
15 |
-
add_action( 'wpbd_delete_users_form', 'wpdb_render_delete_users_userroles', 10 );
|
16 |
-
add_action( 'wpbd_delete_users_form', 'wpdb_render_delete_users_usermeta', 20 );
|
17 |
-
add_action( 'wpbd_delete_users_form', 'wpdb_render_delete_users_assignuser', 30 );
|
18 |
-
add_action( 'wpbd_delete_users_form', 'wpdb_render_delete_users_date_interval', 40 );
|
19 |
-
add_action( 'wpbd_delete_users_form', 'wpdb_render_delete_users_limit', 50 );
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Process Delete Users form form
|
23 |
-
*
|
24 |
-
*
|
25 |
-
* @since 1.0
|
26 |
-
* @param array $data Form pot Data.
|
27 |
-
* @return array | posts ID to be delete.
|
28 |
-
*/
|
29 |
-
function xt_delete_users_form_process( $data ) {
|
30 |
-
$error = array();
|
31 |
-
if ( ! current_user_can( 'delete_users' ) ) {
|
32 |
-
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
33 |
-
}
|
34 |
-
if( empty( $data['delete_user_roles'] ) && ( $data['user_meta_key'] == '' || $data['user_meta_value'] == '' ) ){
|
35 |
-
$error[] = esc_html__('Please select user role or add usermeta key and value.', 'wp-bulk-delete' );
|
36 |
-
}
|
37 |
-
|
38 |
-
if ( isset( $data['_delete_users_wpnonce'] ) && wp_verify_nonce( $data['_delete_users_wpnonce'], 'delete_users_nonce' ) ) {
|
39 |
-
|
40 |
-
if( empty( $error ) ){
|
41 |
-
$delete_time = ( $data['delete_time'] ) ? $data['delete_time'] : 'now';
|
42 |
-
$delete_datetime = ( $data['delete_datetime'] ) ? $data['delete_datetime'] : '';
|
43 |
-
if( $delete_time === 'scheduled' && !empty($delete_datetime) && wpbd_is_pro() ) {
|
44 |
-
$data['delete_entity'] = 'user';
|
45 |
-
return wpbd_save_scheduled_delete($data);
|
46 |
-
}
|
47 |
-
|
48 |
-
// Get post_ids for delete based on user input.
|
49 |
-
$user_ids = wpbulkdelete()->api->get_delete_user_ids( $data );
|
50 |
-
if ( ! empty( $user_ids ) && count( $user_ids ) > 0 ) {
|
51 |
-
if( !wpbd_is_pro() ){
|
52 |
-
$user_count = wpbulkdelete()->api->do_delete_users( $user_ids );
|
53 |
-
} else {
|
54 |
-
$user_count = wpbulkdelete()->api->do_delete_users( $user_ids, (int)$data['reassign_user'] );
|
55 |
-
}
|
56 |
-
return array(
|
57 |
-
'status' => 1,
|
58 |
-
'messages' => array( sprintf( esc_html__( '%d User(s) deleted successfully.', 'wp-bulk-delete' ), $user_count )
|
59 |
-
) );
|
60 |
-
} else {
|
61 |
-
return array(
|
62 |
-
'status' => 1,
|
63 |
-
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
64 |
-
);
|
65 |
-
}
|
66 |
-
|
67 |
-
} else {
|
68 |
-
return array(
|
69 |
-
'status' => 0,
|
70 |
-
'messages' => $error,
|
71 |
-
);
|
72 |
-
}
|
73 |
-
|
74 |
-
} else {
|
75 |
-
wp_die( esc_html__( 'Sorry, Your nonce did not verify.', 'wp-bulk-delete' ) );
|
76 |
-
}
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Render Userroles checkboxes.
|
81 |
-
*
|
82 |
-
* @since 1.0
|
83 |
-
* @return void
|
84 |
-
*/
|
85 |
-
function wpdb_render_delete_users_userroles(){
|
86 |
-
$userroles = count_users();
|
87 |
-
?>
|
88 |
-
<tr>
|
89 |
-
<th scope="row">
|
90 |
-
<?php _e( 'User roles', 'wp-bulk-delete' ); ?> :
|
91 |
-
</th>
|
92 |
-
<td>
|
93 |
-
<?php
|
94 |
-
if( ! empty( $userroles['avail_roles'] ) ){
|
95 |
-
foreach ($userroles['avail_roles'] as $userrole => $count ) {
|
96 |
-
if( $userrole != 'none' ){
|
97 |
-
?>
|
98 |
-
<input name="delete_user_roles[]" class="delete_user_roles" id="user_role_<?php echo $userrole; ?>" type="checkbox" value="<?php echo $userrole; ?>" >
|
99 |
-
<label for="user_role_<?php echo $userrole; ?>">
|
100 |
-
<?php echo $userrole . ' ' . sprintf( __( '( %s Users )', 'wp-bulk-delete' ), $count ); ?>
|
101 |
-
</label><br/>
|
102 |
-
<?php
|
103 |
-
}
|
104 |
-
}
|
105 |
-
}
|
106 |
-
?>
|
107 |
-
<p class="description">
|
108 |
-
<?php _e('Select the user roles from which you want to delete users.','wp-bulk-delete'); ?>
|
109 |
-
</p>
|
110 |
-
</td>
|
111 |
-
</tr>
|
112 |
-
<?php
|
113 |
-
}
|
114 |
-
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Render Userroles checkboxes.
|
118 |
-
*
|
119 |
-
* @since 1.0
|
120 |
-
* @return void
|
121 |
-
*/
|
122 |
-
function wpdb_render_delete_users_usermeta(){
|
123 |
-
?>
|
124 |
-
<tr>
|
125 |
-
<th scope="row">
|
126 |
-
<?php _e('User Meta','wp-bulk-delete'); ?> :
|
127 |
-
</th>
|
128 |
-
<td>
|
129 |
-
<?php esc_html_e( 'User Meta Key', 'wp-bulk-delete' ); ?>
|
130 |
-
<input type="text" id="sample1" name="sample1" class="sample1" placeholder="meta_key" disabled="disabled"/>
|
131 |
-
<select name="sample2" disabled="disabled" >
|
132 |
-
<option value="equal_to_str"><?php esc_html_e( 'equal to ( string )', 'wp-bulk-delete' ); ?></option>
|
133 |
-
</select>
|
134 |
-
<?php esc_html_e( 'Value', 'wp-bulk-delete' ); ?>
|
135 |
-
<input type="text" id="sample3" name="sample3" class="sample3" placeholder="meta_value" disabled="disabled" /><br/>
|
136 |
-
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
137 |
-
</td>
|
138 |
-
</tr>
|
139 |
-
<?php
|
140 |
-
}
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Render User registration date interval.
|
144 |
-
*
|
145 |
-
* @since 1.0
|
146 |
-
* @return void
|
147 |
-
*/
|
148 |
-
function wpdb_render_delete_users_date_interval(){
|
149 |
-
?>
|
150 |
-
<tr>
|
151 |
-
<th scope="row">
|
152 |
-
<?php _e('User Registration Date :','wp-bulk-delete'); ?>
|
153 |
-
</th>
|
154 |
-
<td>
|
155 |
-
<?php _e('Delete Users which are','wp-bulk-delete'); ?>
|
156 |
-
<select name="date_type" class="date_type">
|
157 |
-
<option value="older_than"><?php _e('older than','wp-bulk-delete'); ?></option>
|
158 |
-
<option value="within_last"><?php _e('registered within last','wp-bulk-delete'); ?></option>
|
159 |
-
<option value="custom_date"><?php _e('registered between','wp-bulk-delete'); ?></option>
|
160 |
-
</select>
|
161 |
-
<div class="wpbd_date_days wpbd_inline">
|
162 |
-
<input type="number" id="input_days" name="input_days" class="wpbd_input_days" placeholder="0" min="0" /> <?php _e('days','wp-bulk-delete'); ?>
|
163 |
-
</div>
|
164 |
-
<div class="wpbd_custom_interval wpbd_inline" style="display:none;">
|
165 |
-
<input type="text" id="delete_start_date" name="delete_start_date" class="delete_all_datepicker" placeholder="<?php _e('Start Date','wp-bulk-delete'); ?>" />
|
166 |
-
-
|
167 |
-
<input type="text" id="delete_end_date" name="delete_end_date" class="delete_all_datepicker" placeholder="<?php _e('End Date','wp-bulk-delete'); ?>" />
|
168 |
-
<p class="description">
|
169 |
-
<?php _e('Set the reigration date interval for users to delete ( only delete users register between these dates ) or leave these fields blank to select all users. The dates must be specified in the following format: <strong>YYYY-MM-DD</strong>','wp-bulk-delete'); ?>
|
170 |
-
</p>
|
171 |
-
</div>
|
172 |
-
</td>
|
173 |
-
</tr>
|
174 |
-
<?php
|
175 |
-
}
|
176 |
-
|
177 |
-
/**
|
178 |
-
* Render User delete limit.
|
179 |
-
*
|
180 |
-
* @since 1.0
|
181 |
-
* @return void
|
182 |
-
*/
|
183 |
-
function wpdb_render_delete_users_limit(){
|
184 |
-
?>
|
185 |
-
<tr>
|
186 |
-
<th scope="row">
|
187 |
-
<?php _e('Limit :','wp-bulk-delete'); ?>
|
188 |
-
</th>
|
189 |
-
<td>
|
190 |
-
<input type="number" min="1" id="limit_user" name="limit_user" class="limit_user_input" />
|
191 |
-
<p class="description">
|
192 |
-
<?php _e('Set the limit over user delete. It will delete only first limited users. This option will help you in case of you have lots of users to delete and script timeout.','wp-bulk-delete'); ?>
|
193 |
-
</p>
|
194 |
-
</td>
|
195 |
-
</tr>
|
196 |
-
<?php
|
197 |
-
}
|
198 |
-
|
199 |
-
/**
|
200 |
-
* Render Users Dropdown for assign user.
|
201 |
-
*
|
202 |
-
* @since 1.1
|
203 |
-
* @return void
|
204 |
-
*/
|
205 |
-
function wpdb_render_delete_users_assignuser(){
|
206 |
-
?>
|
207 |
-
<tr>
|
208 |
-
<th scope="row">
|
209 |
-
<?php _e('Assign deleted user\'s data to','wp-bulk-delete'); ?> :
|
210 |
-
</th>
|
211 |
-
<td>
|
212 |
-
<?php
|
213 |
-
if( wpbd_is_pro() ) {
|
214 |
-
wp_dropdown_users( array( 'show_option_none' => esc_attr__( 'Select User', 'wp-bulk-delete'), 'name' => 'reassign_user' ) );
|
215 |
-
} else {
|
216 |
-
?>
|
217 |
-
<select name="sample_user" disabled="disabled">
|
218 |
-
<option value=""><?php esc_attr_e( 'Select User','wp-bulk-delete'); ?></option>
|
219 |
-
</select>
|
220 |
-
<?php
|
221 |
-
}
|
222 |
-
?>
|
223 |
-
<p class="description">
|
224 |
-
<?php _e('Select user to whom you want to assign deleted user\'s data.','wp-bulk-delete'); ?>
|
225 |
-
</p>
|
226 |
-
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
227 |
-
</td>
|
228 |
-
</tr>
|
229 |
-
<?php
|
230 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Delete Users Form Funcitons
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Delete Users Form Funcitons
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
/** Actions *************************************************************/
|
15 |
+
add_action( 'wpbd_delete_users_form', 'wpdb_render_delete_users_userroles', 10 );
|
16 |
+
add_action( 'wpbd_delete_users_form', 'wpdb_render_delete_users_usermeta', 20 );
|
17 |
+
add_action( 'wpbd_delete_users_form', 'wpdb_render_delete_users_assignuser', 30 );
|
18 |
+
add_action( 'wpbd_delete_users_form', 'wpdb_render_delete_users_date_interval', 40 );
|
19 |
+
add_action( 'wpbd_delete_users_form', 'wpdb_render_delete_users_limit', 50 );
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Process Delete Users form form
|
23 |
+
*
|
24 |
+
*
|
25 |
+
* @since 1.0
|
26 |
+
* @param array $data Form pot Data.
|
27 |
+
* @return array | posts ID to be delete.
|
28 |
+
*/
|
29 |
+
function xt_delete_users_form_process( $data ) {
|
30 |
+
$error = array();
|
31 |
+
if ( ! current_user_can( 'delete_users' ) ) {
|
32 |
+
$error[] = esc_html__('You don\'t have enough permission for this operation.', 'wp-bulk-delete' );
|
33 |
+
}
|
34 |
+
if( empty( $data['delete_user_roles'] ) && ( $data['user_meta_key'] == '' || $data['user_meta_value'] == '' ) ){
|
35 |
+
$error[] = esc_html__('Please select user role or add usermeta key and value.', 'wp-bulk-delete' );
|
36 |
+
}
|
37 |
+
|
38 |
+
if ( isset( $data['_delete_users_wpnonce'] ) && wp_verify_nonce( $data['_delete_users_wpnonce'], 'delete_users_nonce' ) ) {
|
39 |
+
|
40 |
+
if( empty( $error ) ){
|
41 |
+
$delete_time = ( $data['delete_time'] ) ? $data['delete_time'] : 'now';
|
42 |
+
$delete_datetime = ( $data['delete_datetime'] ) ? $data['delete_datetime'] : '';
|
43 |
+
if( $delete_time === 'scheduled' && !empty($delete_datetime) && wpbd_is_pro() ) {
|
44 |
+
$data['delete_entity'] = 'user';
|
45 |
+
return wpbd_save_scheduled_delete($data);
|
46 |
+
}
|
47 |
+
|
48 |
+
// Get post_ids for delete based on user input.
|
49 |
+
$user_ids = wpbulkdelete()->api->get_delete_user_ids( $data );
|
50 |
+
if ( ! empty( $user_ids ) && count( $user_ids ) > 0 ) {
|
51 |
+
if( !wpbd_is_pro() ){
|
52 |
+
$user_count = wpbulkdelete()->api->do_delete_users( $user_ids );
|
53 |
+
} else {
|
54 |
+
$user_count = wpbulkdelete()->api->do_delete_users( $user_ids, (int)$data['reassign_user'] );
|
55 |
+
}
|
56 |
+
return array(
|
57 |
+
'status' => 1,
|
58 |
+
'messages' => array( sprintf( esc_html__( '%d User(s) deleted successfully.', 'wp-bulk-delete' ), $user_count )
|
59 |
+
) );
|
60 |
+
} else {
|
61 |
+
return array(
|
62 |
+
'status' => 1,
|
63 |
+
'messages' => array( esc_html__( 'Nothing to delete!!', 'wp-bulk-delete' ) ),
|
64 |
+
);
|
65 |
+
}
|
66 |
+
|
67 |
+
} else {
|
68 |
+
return array(
|
69 |
+
'status' => 0,
|
70 |
+
'messages' => $error,
|
71 |
+
);
|
72 |
+
}
|
73 |
+
|
74 |
+
} else {
|
75 |
+
wp_die( esc_html__( 'Sorry, Your nonce did not verify.', 'wp-bulk-delete' ) );
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Render Userroles checkboxes.
|
81 |
+
*
|
82 |
+
* @since 1.0
|
83 |
+
* @return void
|
84 |
+
*/
|
85 |
+
function wpdb_render_delete_users_userroles(){
|
86 |
+
$userroles = count_users();
|
87 |
+
?>
|
88 |
+
<tr>
|
89 |
+
<th scope="row">
|
90 |
+
<?php _e( 'User roles', 'wp-bulk-delete' ); ?> :
|
91 |
+
</th>
|
92 |
+
<td>
|
93 |
+
<?php
|
94 |
+
if( ! empty( $userroles['avail_roles'] ) ){
|
95 |
+
foreach ($userroles['avail_roles'] as $userrole => $count ) {
|
96 |
+
if( $userrole != 'none' ){
|
97 |
+
?>
|
98 |
+
<input name="delete_user_roles[]" class="delete_user_roles" id="user_role_<?php echo $userrole; ?>" type="checkbox" value="<?php echo $userrole; ?>" >
|
99 |
+
<label for="user_role_<?php echo $userrole; ?>">
|
100 |
+
<?php echo $userrole . ' ' . sprintf( __( '( %s Users )', 'wp-bulk-delete' ), $count ); ?>
|
101 |
+
</label><br/>
|
102 |
+
<?php
|
103 |
+
}
|
104 |
+
}
|
105 |
+
}
|
106 |
+
?>
|
107 |
+
<p class="description">
|
108 |
+
<?php _e('Select the user roles from which you want to delete users.','wp-bulk-delete'); ?>
|
109 |
+
</p>
|
110 |
+
</td>
|
111 |
+
</tr>
|
112 |
+
<?php
|
113 |
+
}
|
114 |
+
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Render Userroles checkboxes.
|
118 |
+
*
|
119 |
+
* @since 1.0
|
120 |
+
* @return void
|
121 |
+
*/
|
122 |
+
function wpdb_render_delete_users_usermeta(){
|
123 |
+
?>
|
124 |
+
<tr>
|
125 |
+
<th scope="row">
|
126 |
+
<?php _e('User Meta','wp-bulk-delete'); ?> :
|
127 |
+
</th>
|
128 |
+
<td>
|
129 |
+
<?php esc_html_e( 'User Meta Key', 'wp-bulk-delete' ); ?>
|
130 |
+
<input type="text" id="sample1" name="sample1" class="sample1" placeholder="meta_key" disabled="disabled"/>
|
131 |
+
<select name="sample2" disabled="disabled" >
|
132 |
+
<option value="equal_to_str"><?php esc_html_e( 'equal to ( string )', 'wp-bulk-delete' ); ?></option>
|
133 |
+
</select>
|
134 |
+
<?php esc_html_e( 'Value', 'wp-bulk-delete' ); ?>
|
135 |
+
<input type="text" id="sample3" name="sample3" class="sample3" placeholder="meta_value" disabled="disabled" /><br/>
|
136 |
+
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
137 |
+
</td>
|
138 |
+
</tr>
|
139 |
+
<?php
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Render User registration date interval.
|
144 |
+
*
|
145 |
+
* @since 1.0
|
146 |
+
* @return void
|
147 |
+
*/
|
148 |
+
function wpdb_render_delete_users_date_interval(){
|
149 |
+
?>
|
150 |
+
<tr>
|
151 |
+
<th scope="row">
|
152 |
+
<?php _e('User Registration Date :','wp-bulk-delete'); ?>
|
153 |
+
</th>
|
154 |
+
<td>
|
155 |
+
<?php _e('Delete Users which are','wp-bulk-delete'); ?>
|
156 |
+
<select name="date_type" class="date_type">
|
157 |
+
<option value="older_than"><?php _e('older than','wp-bulk-delete'); ?></option>
|
158 |
+
<option value="within_last"><?php _e('registered within last','wp-bulk-delete'); ?></option>
|
159 |
+
<option value="custom_date"><?php _e('registered between','wp-bulk-delete'); ?></option>
|
160 |
+
</select>
|
161 |
+
<div class="wpbd_date_days wpbd_inline">
|
162 |
+
<input type="number" id="input_days" name="input_days" class="wpbd_input_days" placeholder="0" min="0" /> <?php _e('days','wp-bulk-delete'); ?>
|
163 |
+
</div>
|
164 |
+
<div class="wpbd_custom_interval wpbd_inline" style="display:none;">
|
165 |
+
<input type="text" id="delete_start_date" name="delete_start_date" class="delete_all_datepicker" placeholder="<?php _e('Start Date','wp-bulk-delete'); ?>" />
|
166 |
+
-
|
167 |
+
<input type="text" id="delete_end_date" name="delete_end_date" class="delete_all_datepicker" placeholder="<?php _e('End Date','wp-bulk-delete'); ?>" />
|
168 |
+
<p class="description">
|
169 |
+
<?php _e('Set the reigration date interval for users to delete ( only delete users register between these dates ) or leave these fields blank to select all users. The dates must be specified in the following format: <strong>YYYY-MM-DD</strong>','wp-bulk-delete'); ?>
|
170 |
+
</p>
|
171 |
+
</div>
|
172 |
+
</td>
|
173 |
+
</tr>
|
174 |
+
<?php
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Render User delete limit.
|
179 |
+
*
|
180 |
+
* @since 1.0
|
181 |
+
* @return void
|
182 |
+
*/
|
183 |
+
function wpdb_render_delete_users_limit(){
|
184 |
+
?>
|
185 |
+
<tr>
|
186 |
+
<th scope="row">
|
187 |
+
<?php _e('Limit :','wp-bulk-delete'); ?>
|
188 |
+
</th>
|
189 |
+
<td>
|
190 |
+
<input type="number" min="1" id="limit_user" name="limit_user" class="limit_user_input" />
|
191 |
+
<p class="description">
|
192 |
+
<?php _e('Set the limit over user delete. It will delete only first limited users. This option will help you in case of you have lots of users to delete and script timeout.','wp-bulk-delete'); ?>
|
193 |
+
</p>
|
194 |
+
</td>
|
195 |
+
</tr>
|
196 |
+
<?php
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Render Users Dropdown for assign user.
|
201 |
+
*
|
202 |
+
* @since 1.1
|
203 |
+
* @return void
|
204 |
+
*/
|
205 |
+
function wpdb_render_delete_users_assignuser(){
|
206 |
+
?>
|
207 |
+
<tr>
|
208 |
+
<th scope="row">
|
209 |
+
<?php _e('Assign deleted user\'s data to','wp-bulk-delete'); ?> :
|
210 |
+
</th>
|
211 |
+
<td>
|
212 |
+
<?php
|
213 |
+
if( wpbd_is_pro() ) {
|
214 |
+
wp_dropdown_users( array( 'show_option_none' => esc_attr__( 'Select User', 'wp-bulk-delete'), 'name' => 'reassign_user' ) );
|
215 |
+
} else {
|
216 |
+
?>
|
217 |
+
<select name="sample_user" disabled="disabled">
|
218 |
+
<option value=""><?php esc_attr_e( 'Select User','wp-bulk-delete'); ?></option>
|
219 |
+
</select>
|
220 |
+
<?php
|
221 |
+
}
|
222 |
+
?>
|
223 |
+
<p class="description">
|
224 |
+
<?php _e('Select user to whom you want to assign deleted user\'s data.','wp-bulk-delete'); ?>
|
225 |
+
</p>
|
226 |
+
<?php do_action( 'wpbd_display_available_in_pro'); ?>
|
227 |
+
</td>
|
228 |
+
</tr>
|
229 |
+
<?php
|
230 |
}
|
includes/scripts.php
CHANGED
@@ -1,58 +1,58 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Scripts
|
4 |
-
*
|
5 |
-
* @package WP_Bulk_Delete
|
6 |
-
* @subpackage Functions
|
7 |
-
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
-
* @since 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Exit if accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Load Admin Scripts
|
17 |
-
*
|
18 |
-
* Enqueues the required admin scripts.
|
19 |
-
*
|
20 |
-
* @since 1.0
|
21 |
-
* @param string $hook Page hook
|
22 |
-
* @return void
|
23 |
-
*/
|
24 |
-
function wpbd_enqueue_admin_scripts( $hook ) {
|
25 |
-
$page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
|
26 |
-
if( 'delete_all_posts' == $page || 'delete_all_comments' == $page || 'delete_all_users' == $page || 'delete_all_meta' == $page || 'wpbd_delete_terms' == $page || 'wpbd_cleanup' == $page || 'wpbd_support' == $page || 'wpbd_schedule' == $page ){
|
27 |
-
$js_dir = WPBD_PLUGIN_URL . 'assets/js/';
|
28 |
-
wp_register_script( 'jquery-chosen', $js_dir . 'chosen.jquery.min.js', array('jquery'), WPBD_VERSION );
|
29 |
-
wp_register_script( 'wp-bulk-delete', $js_dir . 'wp-bulk-delete-admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker'), WPBD_VERSION );
|
30 |
-
wp_register_script( 'jquery-ui-timepicker-addon', $js_dir . 'jquery-ui-timepicker-addon.min.js', array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker'), WPBD_VERSION );
|
31 |
-
wp_enqueue_script( 'jquery-chosen' );
|
32 |
-
wp_enqueue_script( 'jquery-ui-timepicker-addon' );
|
33 |
-
wp_enqueue_script( 'wp-bulk-delete' );
|
34 |
-
}
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Load Admin Styles.
|
39 |
-
*
|
40 |
-
* Enqueues the required admin styles.
|
41 |
-
*
|
42 |
-
* @since 1.0
|
43 |
-
* @param string $hook Page hook
|
44 |
-
* @return void
|
45 |
-
*/
|
46 |
-
function wpbd_enqueue_admin_styles( $hook ) {
|
47 |
-
$page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
|
48 |
-
if( 'delete_all_posts' == $page || 'delete_all_comments' == $page || 'delete_all_users' == $page || 'delete_all_meta' == $page || 'wpbd_delete_terms' == $page || 'wpbd_cleanup' == $page || 'wpbd_support' == $page || 'wpbd_schedule' == $page ){
|
49 |
-
$css_dir = WPBD_PLUGIN_URL . 'assets/css/';
|
50 |
-
wp_enqueue_style('jquery-ui', $css_dir . 'jquery-ui.css', false, "1.12.0" );
|
51 |
-
wp_enqueue_style('wp-bulk-delete-css', $css_dir . 'wp-bulk-delete-admin.css', false, WPBD_VERSION );
|
52 |
-
wp_enqueue_style('jquery-chosen', $css_dir . 'chosen.min.css', false, "1.6.2" );
|
53 |
-
wp_enqueue_style('jquery-ui-timepicker-addon', $css_dir . 'jquery-ui-timepicker-addon.min.css', false, WPBD_VERSION );
|
54 |
-
}
|
55 |
-
}
|
56 |
-
|
57 |
-
add_action( 'admin_enqueue_scripts', 'wpbd_enqueue_admin_scripts' );
|
58 |
add_action( 'admin_enqueue_scripts', 'wpbd_enqueue_admin_styles' );
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Scripts
|
4 |
+
*
|
5 |
+
* @package WP_Bulk_Delete
|
6 |
+
* @subpackage Functions
|
7 |
+
* @copyright Copyright (c) 2016, Dharmesh Patel
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Load Admin Scripts
|
17 |
+
*
|
18 |
+
* Enqueues the required admin scripts.
|
19 |
+
*
|
20 |
+
* @since 1.0
|
21 |
+
* @param string $hook Page hook
|
22 |
+
* @return void
|
23 |
+
*/
|
24 |
+
function wpbd_enqueue_admin_scripts( $hook ) {
|
25 |
+
$page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
|
26 |
+
if( 'delete_all_posts' == $page || 'delete_all_comments' == $page || 'delete_all_users' == $page || 'delete_all_meta' == $page || 'wpbd_delete_terms' == $page || 'wpbd_cleanup' == $page || 'wpbd_support' == $page || 'wpbd_schedule' == $page ){
|
27 |
+
$js_dir = WPBD_PLUGIN_URL . 'assets/js/';
|
28 |
+
wp_register_script( 'jquery-chosen', $js_dir . 'chosen.jquery.min.js', array('jquery'), WPBD_VERSION );
|
29 |
+
wp_register_script( 'wp-bulk-delete', $js_dir . 'wp-bulk-delete-admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker'), WPBD_VERSION );
|
30 |
+
wp_register_script( 'jquery-ui-timepicker-addon', $js_dir . 'jquery-ui-timepicker-addon.min.js', array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker'), WPBD_VERSION );
|
31 |
+
wp_enqueue_script( 'jquery-chosen' );
|
32 |
+
wp_enqueue_script( 'jquery-ui-timepicker-addon' );
|
33 |
+
wp_enqueue_script( 'wp-bulk-delete' );
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Load Admin Styles.
|
39 |
+
*
|
40 |
+
* Enqueues the required admin styles.
|
41 |
+
*
|
42 |
+
* @since 1.0
|
43 |
+
* @param string $hook Page hook
|
44 |
+
* @return void
|
45 |
+
*/
|
46 |
+
function wpbd_enqueue_admin_styles( $hook ) {
|
47 |
+
$page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
|
48 |
+
if( 'delete_all_posts' == $page || 'delete_all_comments' == $page || 'delete_all_users' == $page || 'delete_all_meta' == $page || 'wpbd_delete_terms' == $page || 'wpbd_cleanup' == $page || 'wpbd_support' == $page || 'wpbd_schedule' == $page ){
|
49 |
+
$css_dir = WPBD_PLUGIN_URL . 'assets/css/';
|
50 |
+
wp_enqueue_style('jquery-ui', $css_dir . 'jquery-ui.css', false, "1.12.0" );
|
51 |
+
wp_enqueue_style('wp-bulk-delete-css', $css_dir . 'wp-bulk-delete-admin.css', false, WPBD_VERSION );
|
52 |
+
wp_enqueue_style('jquery-chosen', $css_dir . 'chosen.min.css', false, "1.6.2" );
|
53 |
+
wp_enqueue_style('jquery-ui-timepicker-addon', $css_dir . 'jquery-ui-timepicker-addon.min.css', false, WPBD_VERSION );
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
add_action( 'admin_enqueue_scripts', 'wpbd_enqueue_admin_scripts' );
|
58 |
add_action( 'admin_enqueue_scripts', 'wpbd_enqueue_admin_styles' );
|
languages/wp-bulk-delete.pot
CHANGED
@@ -1,23 +1,41 @@
|
|
1 |
-
# Copyright (C)
|
2 |
-
# This file is distributed under the same license as the WP Bulk Delete
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: WP Bulk Delete 1.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-bulk-delete\n"
|
7 |
-
"
|
|
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"
|
12 |
-
"
|
13 |
-
"
|
|
|
14 |
|
15 |
-
#.
|
16 |
-
#. Plugin Name of the plugin/theme
|
17 |
#: includes/admin/admin-pages.php:23
|
|
|
18 |
msgid "WP Bulk Delete"
|
19 |
msgstr ""
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
#: includes/admin/admin-pages.php:26
|
22 |
#: includes/admin/posts/display-delete-posts.php:26
|
23 |
msgid "Delete Posts"
|
@@ -44,17 +62,20 @@ msgstr ""
|
|
44 |
msgid "Delete Terms"
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: includes/admin/admin-pages.php:36
|
|
|
48 |
#: includes/admin/meta/display-delete-meta.php:47
|
49 |
#: includes/admin/posts/display-delete-posts.php:48
|
50 |
msgid "Cleanup"
|
51 |
msgstr ""
|
52 |
|
53 |
-
#: includes/admin/admin-pages.php:38
|
|
|
54 |
msgid "Support & Help"
|
55 |
msgstr ""
|
56 |
|
57 |
-
#: includes/admin/admin-sidebar.php:25
|
|
|
58 |
msgid "Upgrade to Pro"
|
59 |
msgstr ""
|
60 |
|
@@ -67,9 +88,7 @@ msgid "Custom WordPress Development Services"
|
|
67 |
msgstr ""
|
68 |
|
69 |
#: includes/admin/admin-sidebar.php:34
|
70 |
-
msgid ""
|
71 |
-
"From small blog to complex web apps, we push the limits of what's possible "
|
72 |
-
"with WordPress."
|
73 |
msgstr ""
|
74 |
|
75 |
#: includes/admin/admin-sidebar.php:36
|
@@ -84,9 +103,12 @@ msgstr ""
|
|
84 |
msgid "Get Premium"
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: includes/admin/cleanup/cleanup-form.php:27
|
88 |
-
#: includes/ajax-functions.php:
|
89 |
-
#: includes/ajax-functions.php:
|
|
|
|
|
|
|
90 |
#: includes/delele-comments-form-functions.php:31
|
91 |
#: includes/delele-meta-form-functions.php:43
|
92 |
#: includes/delele-posts-form-functions.php:60
|
@@ -95,9 +117,12 @@ msgstr ""
|
|
95 |
msgid "You don't have enough permission for this operation."
|
96 |
msgstr ""
|
97 |
|
98 |
-
#: includes/admin/cleanup/cleanup-form.php:38
|
99 |
-
#: includes/ajax-functions.php:
|
100 |
-
#: includes/ajax-functions.php:
|
|
|
|
|
|
|
101 |
#: includes/delele-comments-form-functions.php:75
|
102 |
#: includes/delele-meta-form-functions.php:99
|
103 |
#: includes/delele-posts-form-functions.php:101
|
@@ -115,15 +140,11 @@ msgid "Run Cleanup"
|
|
115 |
msgstr ""
|
116 |
|
117 |
#: includes/admin/cleanup/cleanup-page.php:30
|
118 |
-
msgid ""
|
119 |
-
"WARNING: Before you Cleanup any data please first take Backup, any delete "
|
120 |
-
"operation done is irreversible. Please use it with caution!"
|
121 |
msgstr ""
|
122 |
|
123 |
#: includes/admin/comments/display-delete-comments.php:39
|
124 |
-
msgid ""
|
125 |
-
"WARNING: Before you delete any comment please first take Backup, any delete "
|
126 |
-
"operation done is irreversible. Please use it with caution!"
|
127 |
msgstr ""
|
128 |
|
129 |
#: includes/admin/meta/display-delete-meta.php:26
|
@@ -131,9 +152,7 @@ msgid "Delete Meta"
|
|
131 |
msgstr ""
|
132 |
|
133 |
#: includes/admin/meta/display-delete-meta.php:35
|
134 |
-
msgid ""
|
135 |
-
"WARNING: Before you delete any meta please first take Backup, any delete "
|
136 |
-
"operation done is irreversible. Please use it with caution!"
|
137 |
msgstr ""
|
138 |
|
139 |
#: includes/admin/meta/display-delete-meta.php:50
|
@@ -150,9 +169,7 @@ msgid "Comment Meta"
|
|
150 |
msgstr ""
|
151 |
|
152 |
#: includes/admin/posts/display-delete-posts.php:35
|
153 |
-
msgid ""
|
154 |
-
"WARNING: Before you delete any post please first take Backup, any delete "
|
155 |
-
"operation done is irreversible. Please use it with caution!"
|
156 |
msgstr ""
|
157 |
|
158 |
#: includes/admin/posts/display-delete-posts.php:51
|
@@ -184,9 +201,7 @@ msgid "Getting Support"
|
|
184 |
msgstr ""
|
185 |
|
186 |
#: includes/admin/support-page.php:43
|
187 |
-
msgid ""
|
188 |
-
"Thanks you for using Import Facebook Events, We are sincerely appreciate "
|
189 |
-
"your support and we’re excited to see you using our plugins."
|
190 |
msgstr ""
|
191 |
|
192 |
#: includes/admin/support-page.php:44
|
@@ -206,9 +221,7 @@ msgid "Looking for more immediate support?"
|
|
206 |
msgstr ""
|
207 |
|
208 |
#: includes/admin/support-page.php:52
|
209 |
-
msgid ""
|
210 |
-
"We offer premium support on our website with the purchase of our premium "
|
211 |
-
"plugins."
|
212 |
msgstr ""
|
213 |
|
214 |
#: includes/admin/support-page.php:56
|
@@ -219,6 +232,18 @@ msgstr ""
|
|
219 |
msgid "Enjoying Import Facebook Events or have feedback?"
|
220 |
msgstr ""
|
221 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
#: includes/admin/support-page.php:75
|
223 |
msgid "Plugins you should try"
|
224 |
msgstr ""
|
@@ -243,7 +268,8 @@ msgstr ""
|
|
243 |
msgid "Install Now"
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: includes/admin/support-page.php:109
|
|
|
247 |
msgid "Buy Now"
|
248 |
msgstr ""
|
249 |
|
@@ -252,19 +278,17 @@ msgid "Delete Taxonomy Terms"
|
|
252 |
msgstr ""
|
253 |
|
254 |
#: includes/admin/terms/display-delete-terms.php:38
|
255 |
-
msgid ""
|
256 |
-
"WARNING: Before you delete any terms please first take Backup, any delete "
|
257 |
-
"operation done is irreversible. Please use it with caution!"
|
258 |
msgstr ""
|
259 |
|
260 |
#: includes/admin/users/display-delete-users.php:37
|
261 |
-
msgid ""
|
262 |
-
"WARNING: Before you delete any users please first take Backup, any delete "
|
263 |
-
"operation done is irreversible. Please use it with caution!"
|
264 |
msgstr ""
|
265 |
|
266 |
-
#: includes/ajax-functions.php:45
|
267 |
-
#: includes/ajax-functions.php:
|
|
|
|
|
268 |
#: includes/ajax-functions.php:366
|
269 |
#: includes/delele-comments-form-functions.php:63
|
270 |
#: includes/delele-meta-form-functions.php:87
|
@@ -279,18 +303,21 @@ msgstr ""
|
|
279 |
msgid "Please select Comment status for proceed delete operation."
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: includes/ajax-functions.php:209
|
|
|
283 |
#: includes/delele-comments-form-functions.php:51
|
284 |
#: includes/delele-terms-form-functions.php:45
|
285 |
msgid "Something went wrong pelase try again!!"
|
286 |
msgstr ""
|
287 |
|
288 |
-
#: includes/ajax-functions.php:262
|
|
|
289 |
#: includes/ajax-functions.php:273
|
290 |
msgid "Please select all required fields."
|
291 |
msgstr ""
|
292 |
|
293 |
-
#: includes/ajax-functions.php:341
|
|
|
294 |
msgid "Please select required fields for proceed delete operation."
|
295 |
msgstr ""
|
296 |
|
@@ -358,6 +385,79 @@ msgstr ""
|
|
358 |
msgid "Event Schema / Structured Data"
|
359 |
msgstr ""
|
360 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
#: includes/common-functions.php:102
|
362 |
msgid "Available in Pro version."
|
363 |
msgstr ""
|
@@ -455,10 +555,7 @@ msgid "End Date"
|
|
455 |
msgstr ""
|
456 |
|
457 |
#: includes/delele-comments-form-functions.php:149
|
458 |
-
msgid ""
|
459 |
-
"Set the date interval for comments to delete ( only delete comments between "
|
460 |
-
"these dates ) or leave these fields blank to select all comments. The dates "
|
461 |
-
"must be specified in the following format: <strong>YYYY-MM-DD</strong>"
|
462 |
msgstr ""
|
463 |
|
464 |
#: includes/delele-comments-form-functions.php:168
|
@@ -638,9 +735,7 @@ msgid "Meta value (Optional)"
|
|
638 |
msgstr ""
|
639 |
|
640 |
#: includes/delele-meta-form-functions.php:274
|
641 |
-
msgid ""
|
642 |
-
"Enter the meta key for delete meta, please consider following points in to "
|
643 |
-
"meta delete."
|
644 |
msgstr ""
|
645 |
|
646 |
#: includes/delele-meta-form-functions.php:275
|
@@ -648,9 +743,7 @@ msgid "1. If you want to delete meta by meta key only enter meta key."
|
|
648 |
msgstr ""
|
649 |
|
650 |
#: includes/delele-meta-form-functions.php:276
|
651 |
-
msgid ""
|
652 |
-
"2. If you want to delete meta by meta key and meta value then enter both "
|
653 |
-
"values."
|
654 |
msgstr ""
|
655 |
|
656 |
#: includes/delele-meta-form-functions.php:294
|
@@ -670,10 +763,7 @@ msgid "created between"
|
|
670 |
msgstr ""
|
671 |
|
672 |
#: includes/delele-meta-form-functions.php:311
|
673 |
-
msgid ""
|
674 |
-
"Set the date interval for posts/comments/users whose meta fields will be "
|
675 |
-
"delete, or leave these fields blank to select all meta. The dates must be "
|
676 |
-
"specified in the following format: <strong>YYYY-MM-DD</strong>"
|
677 |
msgstr ""
|
678 |
|
679 |
#: includes/delele-meta-form-functions.php:330
|
@@ -729,10 +819,7 @@ msgid "posted between"
|
|
729 |
msgstr ""
|
730 |
|
731 |
#: includes/delele-posts-form-functions.php:313
|
732 |
-
msgid ""
|
733 |
-
"Set the date interval for items to delete, or leave these fields blank to "
|
734 |
-
"select all posts. The dates must be specified in the following format: "
|
735 |
-
"<strong>YYYY-MM-DD</strong>"
|
736 |
msgstr ""
|
737 |
|
738 |
#: includes/delele-posts-form-functions.php:331
|
@@ -780,10 +867,7 @@ msgid "Limit :"
|
|
780 |
msgstr ""
|
781 |
|
782 |
#: includes/delele-posts-form-functions.php:438
|
783 |
-
msgid ""
|
784 |
-
"Set the limit over post delete. It will delete only first limit posts. This "
|
785 |
-
"option will help you in case of you have lots of posts to delete and script "
|
786 |
-
"timeout."
|
787 |
msgstr ""
|
788 |
|
789 |
#: includes/delele-posts-form-functions.php:455
|
@@ -826,49 +910,47 @@ msgstr ""
|
|
826 |
msgid "repeat"
|
827 |
msgstr ""
|
828 |
|
829 |
-
#: includes/delele-posts-form-functions.php:
|
830 |
msgid "Timezone: (%s)"
|
831 |
msgstr ""
|
832 |
|
833 |
-
#: includes/delele-posts-form-functions.php:
|
834 |
-
msgid ""
|
835 |
-
"Scheduled delete runs using cron and backgroud process. So, its useful for "
|
836 |
-
"delete huge number of records and repeatative delete."
|
837 |
msgstr ""
|
838 |
|
839 |
-
#: includes/delele-posts-form-functions.php:
|
840 |
msgid "Don't repeat"
|
841 |
msgstr ""
|
842 |
|
843 |
-
#: includes/delele-posts-form-functions.php:
|
844 |
msgid "Once Hourly"
|
845 |
msgstr ""
|
846 |
|
847 |
-
#: includes/delele-posts-form-functions.php:
|
848 |
msgid "Twice Daily"
|
849 |
msgstr ""
|
850 |
|
851 |
-
#: includes/delele-posts-form-functions.php:
|
852 |
msgid "Once Daily"
|
853 |
msgstr ""
|
854 |
|
855 |
-
#: includes/delele-posts-form-functions.php:
|
856 |
msgid "Once Weekly"
|
857 |
msgstr ""
|
858 |
|
859 |
-
#: includes/delele-posts-form-functions.php:
|
860 |
msgid "Once a Month"
|
861 |
msgstr ""
|
862 |
|
863 |
-
#: includes/delele-posts-form-functions.php:
|
864 |
msgid "Save it as "
|
865 |
msgstr ""
|
866 |
|
867 |
-
#: includes/delele-posts-form-functions.php:
|
868 |
msgid "eg: Daily Post Delete"
|
869 |
msgstr ""
|
870 |
|
871 |
-
#: includes/delele-posts-form-functions.php:
|
872 |
msgid "Filter your posts :"
|
873 |
msgstr ""
|
874 |
|
@@ -913,18 +995,11 @@ msgid "registered between"
|
|
913 |
msgstr ""
|
914 |
|
915 |
#: includes/delele-users-form-functions.php:169
|
916 |
-
msgid ""
|
917 |
-
"Set the reigration date interval for users to delete ( only delete users "
|
918 |
-
"register between these dates ) or leave these fields blank to select all "
|
919 |
-
"users. The dates must be specified in the following format: <strong>YYYY-MM-"
|
920 |
-
"DD</strong>"
|
921 |
msgstr ""
|
922 |
|
923 |
#: includes/delele-users-form-functions.php:192
|
924 |
-
msgid ""
|
925 |
-
"Set the limit over user delete. It will delete only first limited users. "
|
926 |
-
"This option will help you in case of you have lots of users to delete and "
|
927 |
-
"script timeout."
|
928 |
msgstr ""
|
929 |
|
930 |
#: includes/delele-users-form-functions.php:209
|
@@ -940,24 +1015,7 @@ msgstr ""
|
|
940 |
msgid "Select user to whom you want to assign deleted user's data."
|
941 |
msgstr ""
|
942 |
|
943 |
-
#: wp-bulk-delete.php:74
|
|
|
944 |
msgid "Cheatin’ huh?"
|
945 |
msgstr ""
|
946 |
-
|
947 |
-
#. Plugin URI of the plugin/theme
|
948 |
-
msgid "http://xylusthemes.com/plugins/wp-bulk-delete/"
|
949 |
-
msgstr ""
|
950 |
-
|
951 |
-
#. Description of the plugin/theme
|
952 |
-
msgid ""
|
953 |
-
"Bulk delete and cleanup anything like posts, comments, users, meta fields, "
|
954 |
-
"taxonomy terms. with powerful filter options."
|
955 |
-
msgstr ""
|
956 |
-
|
957 |
-
#. Author of the plugin/theme
|
958 |
-
msgid "Xylus Themes"
|
959 |
-
msgstr ""
|
960 |
-
|
961 |
-
#. Author URI of the plugin/theme
|
962 |
-
msgid "http://xylusthemes.com"
|
963 |
-
msgstr ""
|
1 |
+
# Copyright (C) 2021 Xylus Themes
|
2 |
+
# This file is distributed under the same license as the WP Bulk Delete plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: WP Bulk Delete 1.2.2\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-bulk-delete\n"
|
7 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2021-04-17T05:52:51+00:00\n"
|
13 |
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
+
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
+
"X-Domain: wp-bulk-delete\n"
|
16 |
|
17 |
+
#. Plugin Name of the plugin
|
|
|
18 |
#: includes/admin/admin-pages.php:23
|
19 |
+
#: includes/class-wpbd-plugin-deactivation.php:38
|
20 |
msgid "WP Bulk Delete"
|
21 |
msgstr ""
|
22 |
|
23 |
+
#. Plugin URI of the plugin
|
24 |
+
msgid "http://xylusthemes.com/plugins/wp-bulk-delete/"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#. Description of the plugin
|
28 |
+
msgid "Bulk delete and cleanup anything like posts, comments, users, meta fields, taxonomy terms. with powerful filter options."
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#. Author of the plugin
|
32 |
+
msgid "Xylus Themes"
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#. Author URI of the plugin
|
36 |
+
msgid "http://xylusthemes.com"
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
#: includes/admin/admin-pages.php:26
|
40 |
#: includes/admin/posts/display-delete-posts.php:26
|
41 |
msgid "Delete Posts"
|
62 |
msgid "Delete Terms"
|
63 |
msgstr ""
|
64 |
|
65 |
+
#: includes/admin/admin-pages.php:36
|
66 |
+
#: includes/admin/cleanup/cleanup-page.php:25
|
67 |
#: includes/admin/meta/display-delete-meta.php:47
|
68 |
#: includes/admin/posts/display-delete-posts.php:48
|
69 |
msgid "Cleanup"
|
70 |
msgstr ""
|
71 |
|
72 |
+
#: includes/admin/admin-pages.php:38
|
73 |
+
#: includes/admin/support-page.php:31
|
74 |
msgid "Support & Help"
|
75 |
msgstr ""
|
76 |
|
77 |
+
#: includes/admin/admin-sidebar.php:25
|
78 |
+
#: includes/admin/admin-sidebar.php:28
|
79 |
msgid "Upgrade to Pro"
|
80 |
msgstr ""
|
81 |
|
88 |
msgstr ""
|
89 |
|
90 |
#: includes/admin/admin-sidebar.php:34
|
91 |
+
msgid "From small blog to complex web apps, we push the limits of what's possible with WordPress."
|
|
|
|
|
92 |
msgstr ""
|
93 |
|
94 |
#: includes/admin/admin-sidebar.php:36
|
103 |
msgid "Get Premium"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: includes/admin/cleanup/cleanup-form.php:27
|
107 |
+
#: includes/ajax-functions.php:27
|
108 |
+
#: includes/ajax-functions.php:139
|
109 |
+
#: includes/ajax-functions.php:192
|
110 |
+
#: includes/ajax-functions.php:258
|
111 |
+
#: includes/ajax-functions.php:337
|
112 |
#: includes/delele-comments-form-functions.php:31
|
113 |
#: includes/delele-meta-form-functions.php:43
|
114 |
#: includes/delele-posts-form-functions.php:60
|
117 |
msgid "You don't have enough permission for this operation."
|
118 |
msgstr ""
|
119 |
|
120 |
+
#: includes/admin/cleanup/cleanup-form.php:38
|
121 |
+
#: includes/ajax-functions.php:57
|
122 |
+
#: includes/ajax-functions.php:168
|
123 |
+
#: includes/ajax-functions.php:233
|
124 |
+
#: includes/ajax-functions.php:312
|
125 |
+
#: includes/ajax-functions.php:378
|
126 |
#: includes/delele-comments-form-functions.php:75
|
127 |
#: includes/delele-meta-form-functions.php:99
|
128 |
#: includes/delele-posts-form-functions.php:101
|
140 |
msgstr ""
|
141 |
|
142 |
#: includes/admin/cleanup/cleanup-page.php:30
|
143 |
+
msgid "WARNING: Before you Cleanup any data please first take Backup, any delete operation done is irreversible. Please use it with caution!"
|
|
|
|
|
144 |
msgstr ""
|
145 |
|
146 |
#: includes/admin/comments/display-delete-comments.php:39
|
147 |
+
msgid "WARNING: Before you delete any comment please first take Backup, any delete operation done is irreversible. Please use it with caution!"
|
|
|
|
|
148 |
msgstr ""
|
149 |
|
150 |
#: includes/admin/meta/display-delete-meta.php:26
|
152 |
msgstr ""
|
153 |
|
154 |
#: includes/admin/meta/display-delete-meta.php:35
|
155 |
+
msgid "WARNING: Before you delete any meta please first take Backup, any delete operation done is irreversible. Please use it with caution!"
|
|
|
|
|
156 |
msgstr ""
|
157 |
|
158 |
#: includes/admin/meta/display-delete-meta.php:50
|
169 |
msgstr ""
|
170 |
|
171 |
#: includes/admin/posts/display-delete-posts.php:35
|
172 |
+
msgid "WARNING: Before you delete any post please first take Backup, any delete operation done is irreversible. Please use it with caution!"
|
|
|
|
|
173 |
msgstr ""
|
174 |
|
175 |
#: includes/admin/posts/display-delete-posts.php:51
|
201 |
msgstr ""
|
202 |
|
203 |
#: includes/admin/support-page.php:43
|
204 |
+
msgid "Thanks you for using Import Facebook Events, We are sincerely appreciate your support and we’re excited to see you using our plugins."
|
|
|
|
|
205 |
msgstr ""
|
206 |
|
207 |
#: includes/admin/support-page.php:44
|
221 |
msgstr ""
|
222 |
|
223 |
#: includes/admin/support-page.php:52
|
224 |
+
msgid "We offer premium support on our website with the purchase of our premium plugins."
|
|
|
|
|
225 |
msgstr ""
|
226 |
|
227 |
#: includes/admin/support-page.php:56
|
232 |
msgid "Enjoying Import Facebook Events or have feedback?"
|
233 |
msgstr ""
|
234 |
|
235 |
+
#: includes/admin/support-page.php:60
|
236 |
+
msgid "Leave us a review"
|
237 |
+
msgstr ""
|
238 |
+
|
239 |
+
#: includes/admin/support-page.php:61
|
240 |
+
msgid "Follow us on Twitter"
|
241 |
+
msgstr ""
|
242 |
+
|
243 |
+
#: includes/admin/support-page.php:62
|
244 |
+
msgid "Like us on Facebook"
|
245 |
+
msgstr ""
|
246 |
+
|
247 |
#: includes/admin/support-page.php:75
|
248 |
msgid "Plugins you should try"
|
249 |
msgstr ""
|
268 |
msgid "Install Now"
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: includes/admin/support-page.php:109
|
272 |
+
#: includes/common-functions.php:103
|
273 |
msgid "Buy Now"
|
274 |
msgstr ""
|
275 |
|
278 |
msgstr ""
|
279 |
|
280 |
#: includes/admin/terms/display-delete-terms.php:38
|
281 |
+
msgid "WARNING: Before you delete any terms please first take Backup, any delete operation done is irreversible. Please use it with caution!"
|
|
|
|
|
282 |
msgstr ""
|
283 |
|
284 |
#: includes/admin/users/display-delete-users.php:37
|
285 |
+
msgid "WARNING: Before you delete any users please first take Backup, any delete operation done is irreversible. Please use it with caution!"
|
|
|
|
|
286 |
msgstr ""
|
287 |
|
288 |
+
#: includes/ajax-functions.php:45
|
289 |
+
#: includes/ajax-functions.php:156
|
290 |
+
#: includes/ajax-functions.php:221
|
291 |
+
#: includes/ajax-functions.php:300
|
292 |
#: includes/ajax-functions.php:366
|
293 |
#: includes/delele-comments-form-functions.php:63
|
294 |
#: includes/delele-meta-form-functions.php:87
|
303 |
msgid "Please select Comment status for proceed delete operation."
|
304 |
msgstr ""
|
305 |
|
306 |
+
#: includes/ajax-functions.php:209
|
307 |
+
#: includes/ajax-functions.php:354
|
308 |
#: includes/delele-comments-form-functions.php:51
|
309 |
#: includes/delele-terms-form-functions.php:45
|
310 |
msgid "Something went wrong pelase try again!!"
|
311 |
msgstr ""
|
312 |
|
313 |
+
#: includes/ajax-functions.php:262
|
314 |
+
#: includes/ajax-functions.php:267
|
315 |
#: includes/ajax-functions.php:273
|
316 |
msgid "Please select all required fields."
|
317 |
msgstr ""
|
318 |
|
319 |
+
#: includes/ajax-functions.php:341
|
320 |
+
#: includes/delele-terms-form-functions.php:32
|
321 |
msgid "Please select required fields for proceed delete operation."
|
322 |
msgstr ""
|
323 |
|
385 |
msgid "Event Schema / Structured Data"
|
386 |
msgstr ""
|
387 |
|
388 |
+
#: includes/class-wpbd-plugin-deactivation.php:49
|
389 |
+
msgid "I couldn't understand how to make it work"
|
390 |
+
msgstr ""
|
391 |
+
|
392 |
+
#: includes/class-wpbd-plugin-deactivation.php:50
|
393 |
+
msgid "I found a better plugin"
|
394 |
+
msgstr ""
|
395 |
+
|
396 |
+
#: includes/class-wpbd-plugin-deactivation.php:51
|
397 |
+
msgid "The plugin is great, but I need specific feature that you don't support"
|
398 |
+
msgstr ""
|
399 |
+
|
400 |
+
#: includes/class-wpbd-plugin-deactivation.php:52
|
401 |
+
msgid "Plugin has bugs and it's not working"
|
402 |
+
msgstr ""
|
403 |
+
|
404 |
+
#: includes/class-wpbd-plugin-deactivation.php:53
|
405 |
+
msgid "It's not what I was looking for"
|
406 |
+
msgstr ""
|
407 |
+
|
408 |
+
#: includes/class-wpbd-plugin-deactivation.php:54
|
409 |
+
msgid "Plugin didn't work as expected"
|
410 |
+
msgstr ""
|
411 |
+
|
412 |
+
#: includes/class-wpbd-plugin-deactivation.php:55
|
413 |
+
msgid "It's temporary deactivatation, for debug an issue"
|
414 |
+
msgstr ""
|
415 |
+
|
416 |
+
#: includes/class-wpbd-plugin-deactivation.php:56
|
417 |
+
msgid "Other reasons"
|
418 |
+
msgstr ""
|
419 |
+
|
420 |
+
#: includes/class-wpbd-plugin-deactivation.php:169
|
421 |
+
msgid "Submit & Deactivate"
|
422 |
+
msgstr ""
|
423 |
+
|
424 |
+
#: includes/class-wpbd-plugin-deactivation.php:197
|
425 |
+
msgid "Skip"
|
426 |
+
msgstr ""
|
427 |
+
|
428 |
+
#: includes/class-wpbd-plugin-deactivation.php:214
|
429 |
+
msgid "Finding it confusing? let us know so that we can improve the interface"
|
430 |
+
msgstr ""
|
431 |
+
|
432 |
+
#: includes/class-wpbd-plugin-deactivation.php:217
|
433 |
+
msgid "Can you let us know the reason for deactivation (Required)"
|
434 |
+
msgstr ""
|
435 |
+
|
436 |
+
#: includes/class-wpbd-plugin-deactivation.php:221
|
437 |
+
msgid "Can you please let us know about the bug/issue in detail?"
|
438 |
+
msgstr ""
|
439 |
+
|
440 |
+
#: includes/class-wpbd-plugin-deactivation.php:224
|
441 |
+
msgid "Can you please let us know which plugin you found helpful"
|
442 |
+
msgstr ""
|
443 |
+
|
444 |
+
#: includes/class-wpbd-plugin-deactivation.php:227
|
445 |
+
msgid "Can you please let us know more about the feature you want"
|
446 |
+
msgstr ""
|
447 |
+
|
448 |
+
#: includes/class-wpbd-plugin-deactivation.php:230
|
449 |
+
msgid "Can you please let us know more about your requirement"
|
450 |
+
msgstr ""
|
451 |
+
|
452 |
+
#: includes/class-wpbd-plugin-deactivation.php:233
|
453 |
+
#: includes/class-wpbd-plugin-deactivation.php:271
|
454 |
+
msgid "Write your query here"
|
455 |
+
msgstr ""
|
456 |
+
|
457 |
+
#: includes/class-wpbd-plugin-deactivation.php:258
|
458 |
+
msgid "If you have a moment, please let us know why you are deactivating:"
|
459 |
+
msgstr ""
|
460 |
+
|
461 |
#: includes/common-functions.php:102
|
462 |
msgid "Available in Pro version."
|
463 |
msgstr ""
|
555 |
msgstr ""
|
556 |
|
557 |
#: includes/delele-comments-form-functions.php:149
|
558 |
+
msgid "Set the date interval for comments to delete ( only delete comments between these dates ) or leave these fields blank to select all comments. The dates must be specified in the following format: <strong>YYYY-MM-DD</strong>"
|
|
|
|
|
|
|
559 |
msgstr ""
|
560 |
|
561 |
#: includes/delele-comments-form-functions.php:168
|
735 |
msgstr ""
|
736 |
|
737 |
#: includes/delele-meta-form-functions.php:274
|
738 |
+
msgid "Enter the meta key for delete meta, please consider following points in to meta delete."
|
|
|
|
|
739 |
msgstr ""
|
740 |
|
741 |
#: includes/delele-meta-form-functions.php:275
|
743 |
msgstr ""
|
744 |
|
745 |
#: includes/delele-meta-form-functions.php:276
|
746 |
+
msgid "2. If you want to delete meta by meta key and meta value then enter both values."
|
|
|
|
|
747 |
msgstr ""
|
748 |
|
749 |
#: includes/delele-meta-form-functions.php:294
|
763 |
msgstr ""
|
764 |
|
765 |
#: includes/delele-meta-form-functions.php:311
|
766 |
+
msgid "Set the date interval for posts/comments/users whose meta fields will be delete, or leave these fields blank to select all meta. The dates must be specified in the following format: <strong>YYYY-MM-DD</strong>"
|
|
|
|
|
|
|
767 |
msgstr ""
|
768 |
|
769 |
#: includes/delele-meta-form-functions.php:330
|
819 |
msgstr ""
|
820 |
|
821 |
#: includes/delele-posts-form-functions.php:313
|
822 |
+
msgid "Set the date interval for items to delete, or leave these fields blank to select all posts. The dates must be specified in the following format: <strong>YYYY-MM-DD</strong>"
|
|
|
|
|
|
|
823 |
msgstr ""
|
824 |
|
825 |
#: includes/delele-posts-form-functions.php:331
|
867 |
msgstr ""
|
868 |
|
869 |
#: includes/delele-posts-form-functions.php:438
|
870 |
+
msgid "Set the limit over post delete. It will delete only first limit posts. This option will help you in case of you have lots of posts to delete and script timeout."
|
|
|
|
|
|
|
871 |
msgstr ""
|
872 |
|
873 |
#: includes/delele-posts-form-functions.php:455
|
910 |
msgid "repeat"
|
911 |
msgstr ""
|
912 |
|
913 |
+
#: includes/delele-posts-form-functions.php:535
|
914 |
msgid "Timezone: (%s)"
|
915 |
msgstr ""
|
916 |
|
917 |
+
#: includes/delele-posts-form-functions.php:536
|
918 |
+
msgid "Scheduled delete runs using cron and backgroud process. So, its useful for delete huge number of records and repeatative delete."
|
|
|
|
|
919 |
msgstr ""
|
920 |
|
921 |
+
#: includes/delele-posts-form-functions.php:554
|
922 |
msgid "Don't repeat"
|
923 |
msgstr ""
|
924 |
|
925 |
+
#: includes/delele-posts-form-functions.php:557
|
926 |
msgid "Once Hourly"
|
927 |
msgstr ""
|
928 |
|
929 |
+
#: includes/delele-posts-form-functions.php:560
|
930 |
msgid "Twice Daily"
|
931 |
msgstr ""
|
932 |
|
933 |
+
#: includes/delele-posts-form-functions.php:563
|
934 |
msgid "Once Daily"
|
935 |
msgstr ""
|
936 |
|
937 |
+
#: includes/delele-posts-form-functions.php:566
|
938 |
msgid "Once Weekly"
|
939 |
msgstr ""
|
940 |
|
941 |
+
#: includes/delele-posts-form-functions.php:569
|
942 |
msgid "Once a Month"
|
943 |
msgstr ""
|
944 |
|
945 |
+
#: includes/delele-posts-form-functions.php:573
|
946 |
msgid "Save it as "
|
947 |
msgstr ""
|
948 |
|
949 |
+
#: includes/delele-posts-form-functions.php:574
|
950 |
msgid "eg: Daily Post Delete"
|
951 |
msgstr ""
|
952 |
|
953 |
+
#: includes/delele-posts-form-functions.php:591
|
954 |
msgid "Filter your posts :"
|
955 |
msgstr ""
|
956 |
|
995 |
msgstr ""
|
996 |
|
997 |
#: includes/delele-users-form-functions.php:169
|
998 |
+
msgid "Set the reigration date interval for users to delete ( only delete users register between these dates ) or leave these fields blank to select all users. The dates must be specified in the following format: <strong>YYYY-MM-DD</strong>"
|
|
|
|
|
|
|
|
|
999 |
msgstr ""
|
1000 |
|
1001 |
#: includes/delele-users-form-functions.php:192
|
1002 |
+
msgid "Set the limit over user delete. It will delete only first limited users. This option will help you in case of you have lots of users to delete and script timeout."
|
|
|
|
|
|
|
1003 |
msgstr ""
|
1004 |
|
1005 |
#: includes/delele-users-form-functions.php:209
|
1015 |
msgid "Select user to whom you want to assign deleted user's data."
|
1016 |
msgstr ""
|
1017 |
|
1018 |
+
#: wp-bulk-delete.php:74
|
1019 |
+
#: wp-bulk-delete.php:81
|
1020 |
msgid "Cheatin’ huh?"
|
1021 |
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uninstall.php
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Fired when the plugin is uninstalled.
|
4 |
-
*
|
5 |
-
* When populating this file, consider the following flow
|
6 |
-
* of control:
|
7 |
-
*
|
8 |
-
* - This method should be static
|
9 |
-
* - Check if the $_REQUEST content actually is the plugin name
|
10 |
-
* - Run an admin referrer check to make sure it goes through authentication
|
11 |
-
* - Verify the output of $_GET makes sense
|
12 |
-
* - Repeat with other user roles. Best directly by using the links/query string parameters.
|
13 |
-
* - Repeat things for multisite. Once for a single site in the network, once sitewide.
|
14 |
-
*
|
15 |
-
* @link http://xylusthemes.com
|
16 |
-
* @since 1.0.0
|
17 |
-
*
|
18 |
-
* @package WP_Bulk_Delete
|
19 |
-
*/
|
20 |
-
|
21 |
-
// If uninstall not called from WordPress, then exit.
|
22 |
-
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
23 |
-
exit;
|
24 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fired when the plugin is uninstalled.
|
4 |
+
*
|
5 |
+
* When populating this file, consider the following flow
|
6 |
+
* of control:
|
7 |
+
*
|
8 |
+
* - This method should be static
|
9 |
+
* - Check if the $_REQUEST content actually is the plugin name
|
10 |
+
* - Run an admin referrer check to make sure it goes through authentication
|
11 |
+
* - Verify the output of $_GET makes sense
|
12 |
+
* - Repeat with other user roles. Best directly by using the links/query string parameters.
|
13 |
+
* - Repeat things for multisite. Once for a single site in the network, once sitewide.
|
14 |
+
*
|
15 |
+
* @link http://xylusthemes.com
|
16 |
+
* @since 1.0.0
|
17 |
+
*
|
18 |
+
* @package WP_Bulk_Delete
|
19 |
+
*/
|
20 |
+
|
21 |
+
// If uninstall not called from WordPress, then exit.
|
22 |
+
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
23 |
+
exit;
|
24 |
+
}
|
wp-bulk-delete.php
CHANGED
@@ -1,203 +1,204 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name: WP Bulk Delete
|
4 |
-
* Plugin URI: http://xylusthemes.com/plugins/wp-bulk-delete/
|
5 |
-
* Description: Bulk delete and cleanup anything like posts, comments, users, meta fields, taxonomy terms. with powerful filter options.
|
6 |
-
* Version: 1.2.
|
7 |
-
* Author: Xylus Themes
|
8 |
-
* Author URI: http://xylusthemes.com
|
9 |
-
* License: GPL-2.0+
|
10 |
-
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
11 |
-
* Text Domain: wp-bulk-delete
|
12 |
-
* Domain Path: /languages
|
13 |
-
*/
|
14 |
-
|
15 |
-
// If this file is called directly, abort.
|
16 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
17 |
-
|
18 |
-
if( ! class_exists( 'WP_Bulk_Delete' ) ):
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Main WP Bulk Delete class
|
22 |
-
*/
|
23 |
-
class WP_Bulk_Delete{
|
24 |
-
|
25 |
-
/** Singleton *************************************************************/
|
26 |
-
/**
|
27 |
-
* WP_Bulk_Delete The one true WP_Bulk_Delete.
|
28 |
-
*/
|
29 |
-
private static $instance;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Main WP Bulk Delete Instance.
|
33 |
-
*
|
34 |
-
* Insure that only one instance of WP_Bulk_Delete exists in memory at any one time.
|
35 |
-
* Also prevents needing to define globals all over the place.
|
36 |
-
*
|
37 |
-
* @since 1.0.0
|
38 |
-
* @static object $instance
|
39 |
-
* @uses WP_Bulk_Delete::setup_constants() Setup the constants needed.
|
40 |
-
* @uses WP_Bulk_Delete::includes() Include the required files.
|
41 |
-
* @uses WP_Bulk_Delete::laod_textdomain() load the language files.
|
42 |
-
* @see wpbulkdelete()
|
43 |
-
* @return object| WP Bulk Delete the one true WP Bulk Delete.
|
44 |
-
*/
|
45 |
-
public static function instance() {
|
46 |
-
if( ! isset( self::$instance ) && ! (self::$instance instanceof WP_Bulk_Delete ) ) {
|
47 |
-
self::$instance = new WP_Bulk_Delete();
|
48 |
-
self::$instance->setup_constants();
|
49 |
-
|
50 |
-
add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) );
|
51 |
-
|
52 |
-
self::$instance->includes();
|
53 |
-
self::$instance->api = new WPBD_Delete_API();
|
54 |
-
}
|
55 |
-
return self::$instance;
|
56 |
-
}
|
57 |
-
|
58 |
-
/** Magic Methods *********************************************************/
|
59 |
-
|
60 |
-
/**
|
61 |
-
* A dummy constructor to prevent WP_Bulk_Delete from being loaded more than once.
|
62 |
-
*
|
63 |
-
* @since 1.0.0
|
64 |
-
* @see WP_Bulk_Delete::instance()
|
65 |
-
* @see wpbulkdelete()
|
66 |
-
*/
|
67 |
-
private function __construct() { /* Do nothing here */ }
|
68 |
-
|
69 |
-
/**
|
70 |
-
* A dummy magic method to prevent WP_Bulk_Delete from being cloned.
|
71 |
-
*
|
72 |
-
* @since 1.0.0
|
73 |
-
*/
|
74 |
-
public function __clone() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'wp-bulk-delete' ), '1.2.
|
75 |
-
|
76 |
-
/**
|
77 |
-
* A dummy magic method to prevent WP_Bulk_Delete from being unserialized.
|
78 |
-
*
|
79 |
-
* @since 1.0.0
|
80 |
-
*/
|
81 |
-
public function __wakeup() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'wp-bulk-delete' ), '1.2.
|
82 |
-
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Setup plugins constants.
|
86 |
-
*
|
87 |
-
* @access private
|
88 |
-
* @since 1.0.0
|
89 |
-
* @return void
|
90 |
-
*/
|
91 |
-
private function setup_constants() {
|
92 |
-
|
93 |
-
// Plugin version.
|
94 |
-
if( ! defined( 'WPBD_VERSION' ) ){
|
95 |
-
define( 'WPBD_VERSION', '1.2.
|
96 |
-
}
|
97 |
-
|
98 |
-
// Plugin folder Path.
|
99 |
-
if( ! defined( 'WPBD_PLUGIN_DIR' ) ){
|
100 |
-
define( 'WPBD_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
101 |
-
}
|
102 |
-
|
103 |
-
// Plugin folder URL.
|
104 |
-
if( ! defined( 'WPBD_PLUGIN_URL' ) ){
|
105 |
-
define( 'WPBD_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
106 |
-
}
|
107 |
-
|
108 |
-
// Plugin root file.
|
109 |
-
if( ! defined( 'WPBD_PLUGIN_FILE' ) ){
|
110 |
-
define( 'WPBD_PLUGIN_FILE', __FILE__ );
|
111 |
-
}
|
112 |
-
// Pro plugin Buy now Link.
|
113 |
-
if( ! defined( 'WPBD_PLUGIN_BUY_NOW_URL' ) ){
|
114 |
-
define( 'WPBD_PLUGIN_BUY_NOW_URL', '
|
115 |
-
}
|
116 |
-
}
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Include required files.
|
120 |
-
*
|
121 |
-
* @access private
|
122 |
-
* @since 1.0.0
|
123 |
-
* @return void
|
124 |
-
*/
|
125 |
-
private function includes() {
|
126 |
-
require_once WPBD_PLUGIN_DIR . 'includes/scripts.php';
|
127 |
-
require_once WPBD_PLUGIN_DIR . 'includes/class-delete-api.php';
|
128 |
-
require_once WPBD_PLUGIN_DIR . 'includes/common-functions.php';
|
129 |
-
require_once WPBD_PLUGIN_DIR . 'includes/ajax-functions.php';
|
130 |
-
require_once WPBD_PLUGIN_DIR . 'includes/delele-posts-form-functions.php';
|
131 |
-
require_once WPBD_PLUGIN_DIR . 'includes/delele-users-form-functions.php';
|
132 |
-
require_once WPBD_PLUGIN_DIR . 'includes/delele-comments-form-functions.php';
|
133 |
-
require_once WPBD_PLUGIN_DIR . 'includes/delele-meta-form-functions.php';
|
134 |
-
require_once WPBD_PLUGIN_DIR . 'includes/delele-terms-form-functions.php';
|
135 |
-
require_once WPBD_PLUGIN_DIR . 'includes/
|
136 |
-
require_once WPBD_PLUGIN_DIR . 'includes/admin/admin-
|
137 |
-
require_once WPBD_PLUGIN_DIR . 'includes/admin/
|
138 |
-
require_once WPBD_PLUGIN_DIR . 'includes/admin/
|
139 |
-
require_once WPBD_PLUGIN_DIR . 'includes/admin/
|
140 |
-
require_once WPBD_PLUGIN_DIR . 'includes/admin/
|
141 |
-
require_once WPBD_PLUGIN_DIR . 'includes/admin/
|
142 |
-
require_once WPBD_PLUGIN_DIR . 'includes/admin/
|
143 |
-
require_once WPBD_PLUGIN_DIR . 'includes/admin/cleanup/cleanup-
|
144 |
-
require_once WPBD_PLUGIN_DIR . 'includes/admin/
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
*
|
150 |
-
*
|
151 |
-
* @
|
152 |
-
* @
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
*
|
171 |
-
*
|
172 |
-
*
|
173 |
-
*
|
174 |
-
*
|
175 |
-
*
|
176 |
-
*
|
177 |
-
*
|
178 |
-
*
|
179 |
-
*
|
180 |
-
* @
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
*
|
192 |
-
*
|
193 |
-
* @
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
|
|
203 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: WP Bulk Delete
|
4 |
+
* Plugin URI: http://xylusthemes.com/plugins/wp-bulk-delete/
|
5 |
+
* Description: Bulk delete and cleanup anything like posts, comments, users, meta fields, taxonomy terms. with powerful filter options.
|
6 |
+
* Version: 1.2.2
|
7 |
+
* Author: Xylus Themes
|
8 |
+
* Author URI: http://xylusthemes.com
|
9 |
+
* License: GPL-2.0+
|
10 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
11 |
+
* Text Domain: wp-bulk-delete
|
12 |
+
* Domain Path: /languages
|
13 |
+
*/
|
14 |
+
|
15 |
+
// If this file is called directly, abort.
|
16 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
17 |
+
|
18 |
+
if( ! class_exists( 'WP_Bulk_Delete' ) ):
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Main WP Bulk Delete class
|
22 |
+
*/
|
23 |
+
class WP_Bulk_Delete{
|
24 |
+
|
25 |
+
/** Singleton *************************************************************/
|
26 |
+
/**
|
27 |
+
* WP_Bulk_Delete The one true WP_Bulk_Delete.
|
28 |
+
*/
|
29 |
+
private static $instance;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Main WP Bulk Delete Instance.
|
33 |
+
*
|
34 |
+
* Insure that only one instance of WP_Bulk_Delete exists in memory at any one time.
|
35 |
+
* Also prevents needing to define globals all over the place.
|
36 |
+
*
|
37 |
+
* @since 1.0.0
|
38 |
+
* @static object $instance
|
39 |
+
* @uses WP_Bulk_Delete::setup_constants() Setup the constants needed.
|
40 |
+
* @uses WP_Bulk_Delete::includes() Include the required files.
|
41 |
+
* @uses WP_Bulk_Delete::laod_textdomain() load the language files.
|
42 |
+
* @see wpbulkdelete()
|
43 |
+
* @return object| WP Bulk Delete the one true WP Bulk Delete.
|
44 |
+
*/
|
45 |
+
public static function instance() {
|
46 |
+
if( ! isset( self::$instance ) && ! (self::$instance instanceof WP_Bulk_Delete ) ) {
|
47 |
+
self::$instance = new WP_Bulk_Delete();
|
48 |
+
self::$instance->setup_constants();
|
49 |
+
|
50 |
+
add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) );
|
51 |
+
|
52 |
+
self::$instance->includes();
|
53 |
+
self::$instance->api = new WPBD_Delete_API();
|
54 |
+
}
|
55 |
+
return self::$instance;
|
56 |
+
}
|
57 |
+
|
58 |
+
/** Magic Methods *********************************************************/
|
59 |
+
|
60 |
+
/**
|
61 |
+
* A dummy constructor to prevent WP_Bulk_Delete from being loaded more than once.
|
62 |
+
*
|
63 |
+
* @since 1.0.0
|
64 |
+
* @see WP_Bulk_Delete::instance()
|
65 |
+
* @see wpbulkdelete()
|
66 |
+
*/
|
67 |
+
private function __construct() { /* Do nothing here */ }
|
68 |
+
|
69 |
+
/**
|
70 |
+
* A dummy magic method to prevent WP_Bulk_Delete from being cloned.
|
71 |
+
*
|
72 |
+
* @since 1.0.0
|
73 |
+
*/
|
74 |
+
public function __clone() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'wp-bulk-delete' ), '1.2.2' ); }
|
75 |
+
|
76 |
+
/**
|
77 |
+
* A dummy magic method to prevent WP_Bulk_Delete from being unserialized.
|
78 |
+
*
|
79 |
+
* @since 1.0.0
|
80 |
+
*/
|
81 |
+
public function __wakeup() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'wp-bulk-delete' ), '1.2.2' ); }
|
82 |
+
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Setup plugins constants.
|
86 |
+
*
|
87 |
+
* @access private
|
88 |
+
* @since 1.0.0
|
89 |
+
* @return void
|
90 |
+
*/
|
91 |
+
private function setup_constants() {
|
92 |
+
|
93 |
+
// Plugin version.
|
94 |
+
if( ! defined( 'WPBD_VERSION' ) ){
|
95 |
+
define( 'WPBD_VERSION', '1.2.2' );
|
96 |
+
}
|
97 |
+
|
98 |
+
// Plugin folder Path.
|
99 |
+
if( ! defined( 'WPBD_PLUGIN_DIR' ) ){
|
100 |
+
define( 'WPBD_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
101 |
+
}
|
102 |
+
|
103 |
+
// Plugin folder URL.
|
104 |
+
if( ! defined( 'WPBD_PLUGIN_URL' ) ){
|
105 |
+
define( 'WPBD_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
106 |
+
}
|
107 |
+
|
108 |
+
// Plugin root file.
|
109 |
+
if( ! defined( 'WPBD_PLUGIN_FILE' ) ){
|
110 |
+
define( 'WPBD_PLUGIN_FILE', __FILE__ );
|
111 |
+
}
|
112 |
+
// Pro plugin Buy now Link.
|
113 |
+
if( ! defined( 'WPBD_PLUGIN_BUY_NOW_URL' ) ){
|
114 |
+
define( 'WPBD_PLUGIN_BUY_NOW_URL', 'https://xylusthemes.com/plugins/wp-bulk-delete/?utm_source=insideplugin&utm_medium=web&utm_content=sidebar&utm_campaign=freeplugin' );
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Include required files.
|
120 |
+
*
|
121 |
+
* @access private
|
122 |
+
* @since 1.0.0
|
123 |
+
* @return void
|
124 |
+
*/
|
125 |
+
private function includes() {
|
126 |
+
require_once WPBD_PLUGIN_DIR . 'includes/scripts.php';
|
127 |
+
require_once WPBD_PLUGIN_DIR . 'includes/class-delete-api.php';
|
128 |
+
require_once WPBD_PLUGIN_DIR . 'includes/common-functions.php';
|
129 |
+
require_once WPBD_PLUGIN_DIR . 'includes/ajax-functions.php';
|
130 |
+
require_once WPBD_PLUGIN_DIR . 'includes/delele-posts-form-functions.php';
|
131 |
+
require_once WPBD_PLUGIN_DIR . 'includes/delele-users-form-functions.php';
|
132 |
+
require_once WPBD_PLUGIN_DIR . 'includes/delele-comments-form-functions.php';
|
133 |
+
require_once WPBD_PLUGIN_DIR . 'includes/delele-meta-form-functions.php';
|
134 |
+
require_once WPBD_PLUGIN_DIR . 'includes/delele-terms-form-functions.php';
|
135 |
+
require_once WPBD_PLUGIN_DIR . 'includes/class-wpbd-plugin-deactivation.php';
|
136 |
+
require_once WPBD_PLUGIN_DIR . 'includes/admin/admin-pages.php';
|
137 |
+
require_once WPBD_PLUGIN_DIR . 'includes/admin/admin-sidebar.php';
|
138 |
+
require_once WPBD_PLUGIN_DIR . 'includes/admin/posts/display-delete-posts.php';
|
139 |
+
require_once WPBD_PLUGIN_DIR . 'includes/admin/comments/display-delete-comments.php';
|
140 |
+
require_once WPBD_PLUGIN_DIR . 'includes/admin/users/display-delete-users.php';
|
141 |
+
require_once WPBD_PLUGIN_DIR . 'includes/admin/meta/display-delete-meta.php';
|
142 |
+
require_once WPBD_PLUGIN_DIR . 'includes/admin/terms/display-delete-terms.php';
|
143 |
+
require_once WPBD_PLUGIN_DIR . 'includes/admin/cleanup/cleanup-form.php';
|
144 |
+
require_once WPBD_PLUGIN_DIR . 'includes/admin/cleanup/cleanup-page.php';
|
145 |
+
require_once WPBD_PLUGIN_DIR . 'includes/admin/support-page.php';
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Loads the plugin language files.
|
150 |
+
*
|
151 |
+
* @access public
|
152 |
+
* @since 1.0.0
|
153 |
+
* @return void
|
154 |
+
*/
|
155 |
+
public function load_textdomain(){
|
156 |
+
|
157 |
+
load_plugin_textdomain(
|
158 |
+
'wp-bulk-delete',
|
159 |
+
false,
|
160 |
+
basename( dirname( __FILE__ ) ) . '/languages'
|
161 |
+
);
|
162 |
+
|
163 |
+
}
|
164 |
+
|
165 |
+
}
|
166 |
+
|
167 |
+
endif; // End If class exists check.
|
168 |
+
|
169 |
+
/**
|
170 |
+
* The main function for that returns WP_Bulk_Delete
|
171 |
+
*
|
172 |
+
* The main function responsible for returning the one true WP_Bulk_Delete
|
173 |
+
* Instance to functions everywhere.
|
174 |
+
*
|
175 |
+
* Use this function like you would a global variable, except without needing
|
176 |
+
* to declare the global.
|
177 |
+
*
|
178 |
+
* Example: <?php $wpbulkdelete = wpbulkdelete(); ?>
|
179 |
+
*
|
180 |
+
* @since 1.0.0
|
181 |
+
* @return object|WP_Bulk_Delete The one true WP_Bulk_Delete Instance.
|
182 |
+
*/
|
183 |
+
function wpbulkdelete() {
|
184 |
+
return WP_Bulk_Delete::instance();
|
185 |
+
}
|
186 |
+
|
187 |
+
// Get WP_Bulk_Delete Running.
|
188 |
+
wpbulkdelete();
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Check is pro active or not.
|
192 |
+
*
|
193 |
+
* @since 1.2.0
|
194 |
+
* @return boolean
|
195 |
+
*/
|
196 |
+
function wpbd_is_pro() {
|
197 |
+
if( !function_exists( 'is_plugin_active' ) ){
|
198 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
199 |
+
}
|
200 |
+
if ( is_plugin_active( 'wp-bulk-delete-pro/wp-bulk-delete-pro.php' ) ) {
|
201 |
+
return true;
|
202 |
+
}
|
203 |
+
return false;
|
204 |
}
|