Version Description
- December 20th, 2016 =
- Version 1.5 includes a brand new feature - saved tabs - as well as a number of bug fixes, style tweaks, code clean-up, and comments
- UI: Complete overhaul of the custom tab interface for an easier, responsive tab creating experience.
- Saved Tabs: A new settings page has been added for users to create / update / delete saved tabs (see FAQ for more information)
- Saved Tabs: On the product edit page, a new button ('Add a Saved Tab') has been added that allows you to choose one of your saved tabs and add it to the current product
- Adding a new tab initializes a new wp_editor (WYSIWYG) instead of a plain textarea
- Added warning message when two tabs have the same title
- Tabs with empty titles are no longer shown on the product page
- Added ability to remove the first tab
- Adding, moving, and removing tabs works as expected when the user's 'Visual Editor' option is checked
- On the product & settings pages, WYSIWYG editors will default to the visual tab (this helps prevent errors with dynamic wp_editor generation)
- Added a filter
yikes_woocommerce_default_editor_mode
that can change the default-to-visual-tab behavior (use at your own risk!) - Updated the 'How To' text, and slight modification to the style
- Changed the JavaScript methods controlling how tabs were added, deleted, and moved up/down
- Cleaned up and commented on all PHP and JavaScript files
- Added proper i18n, with languages/ folder, .pot file, and
load_plugin_textdomain
hook - Incremented version #
Download this release
Release Info
Developer | yikesitskevin |
Plugin | ![]() |
Version | 1.5 |
Comparing to | |
See all releases |
Code changes from version 1.4.4 to 1.5
- LICENSE +340 -340
- admin/class.yikes-woo-generate-html.php +443 -0
- admin/page.yikes-woo-saved-tabs-single.php +97 -0
- admin/page.yikes-woo-saved-tabs.php +122 -0
- css/dist/lity.min.css +3 -0
- css/font/yikes-woo-font.svg +10 -10
- css/repeatable-custom-tabs.css +1 -1
- css/repeatable-custom-tabs.min.css +1 -8
- css/yikes-woo-tabs-font.css +27 -27
- js/lity.min.js +4 -0
- js/repeatable-custom-tabs-settings.js +183 -0
- js/repeatable-custom-tabs-settings.min.js +1 -0
- js/repeatable-custom-tabs-shared.js +221 -0
- js/repeatable-custom-tabs-shared.min.js +1 -0
- js/repeatable-custom-tabs.js +1 -1
- js/repeatable-custom-tabs.min.js +1 -8
- languages/yikes-inc-easy-custom-woocommerce-product-tabs.pot +204 -0
- readme.txt +58 -21
- yikes-inc-easy-custom-woocommerce-product-tabs.php +812 -185
LICENSE
CHANGED
@@ -1,340 +1,340 @@
|
|
1 |
-
GNU GENERAL PUBLIC LICENSE
|
2 |
-
Version 2, June 1991
|
3 |
-
|
4 |
-
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
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 |
-
{description}
|
294 |
-
Copyright (C) {year} {fullname}
|
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.
|
340 |
-
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 2, June 1991
|
3 |
+
|
4 |
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
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 |
+
{description}
|
294 |
+
Copyright (C) {year} {fullname}
|
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.
|
340 |
+
|
admin/class.yikes-woo-generate-html.php
ADDED
@@ -0,0 +1,443 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! class_exists( 'Yikes_Woo_Custom_Product_Tabs_HTML' ) ) {
|
4 |
+
class Yikes_Woo_Custom_Product_Tabs_HTML {
|
5 |
+
|
6 |
+
public function __construct() {
|
7 |
+
// empty...
|
8 |
+
}
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Creates all of the HTML required for tabs on the product edit screen
|
12 |
+
*
|
13 |
+
* @since 1.5
|
14 |
+
*/
|
15 |
+
public function generate_html() {
|
16 |
+
global $post;
|
17 |
+
|
18 |
+
// Pull the custom tab data out of the database
|
19 |
+
$tab_data = maybe_unserialize( get_post_meta( $post->ID, 'yikes_woo_products_tabs', true ) );
|
20 |
+
|
21 |
+
// If we don't have tab data, we display things slightly differently
|
22 |
+
$product_has_tabs = true;
|
23 |
+
if ( empty( $tab_data ) ) {
|
24 |
+
$product_has_tabs = false;
|
25 |
+
}
|
26 |
+
|
27 |
+
// Pull the saved array of reusable tabs
|
28 |
+
$reusable_tab_options_array = get_option( 'yikes_woo_reusable_products_tabs_applied', array() );
|
29 |
+
|
30 |
+
// Display the custom tab panel
|
31 |
+
echo '<div id="yikes_woocommerce_custom_product_tabs" class="panel wc-metaboxes-wrapper woocommerce_options_panel">';
|
32 |
+
echo '<div class="options_group">';
|
33 |
+
|
34 |
+
echo $this->display_yikes_how_to();
|
35 |
+
|
36 |
+
if ( $product_has_tabs === true ) {
|
37 |
+
|
38 |
+
// Loop through all the tabs and add all components
|
39 |
+
$this->generate_tab_html( $tab_data, $reusable_tab_options_array, $post );
|
40 |
+
}
|
41 |
+
|
42 |
+
// Add duplicate container
|
43 |
+
$this->generate_duplicate_html();
|
44 |
+
|
45 |
+
// Add a Saved Tab // Add Another Tab
|
46 |
+
echo $this->display_yikes_add_tabs_container( $product_has_tabs );
|
47 |
+
|
48 |
+
// Hidden input field holding # of tabs
|
49 |
+
echo $this->display_yikes_number_of_tabs( count( $tab_data ) );
|
50 |
+
|
51 |
+
echo '</div>';
|
52 |
+
echo '</div>';
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
/* Generate HTML Functions */
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Generate the duplicate HTML block
|
60 |
+
*
|
61 |
+
* @since 1.5
|
62 |
+
*
|
63 |
+
*/
|
64 |
+
protected function generate_duplicate_html() {
|
65 |
+
|
66 |
+
// duplicate_this_row content
|
67 |
+
echo '<div id="duplicate_this_row">';
|
68 |
+
|
69 |
+
// Override Saved Tab checkbox & hidden input fields (Duplicate)
|
70 |
+
echo $this->display_yikes_override_container_duplicate();
|
71 |
+
|
72 |
+
// Tab title input field
|
73 |
+
woocommerce_wp_text_input( array( 'id' => 'hidden_duplicator_row_title' , 'label' => __( 'Tab Title', 'yikes-inc-easy-custom-woocommerce-product-tabs' ), 'description' => '', 'placeholder' => __( 'Custom Tab Title' , 'yikes-inc-easy-custom-woocommerce-product-tabs' ), 'class' => 'yikes_woo_tabs_title_field yikes_woo_tabs_title_field_duplicate' ) );
|
74 |
+
|
75 |
+
// WYSIWYG Content field
|
76 |
+
$this->display_woocommerce_wp_wysiwyg_input_duplicate();
|
77 |
+
|
78 |
+
// Up & Down arrows && Remove Tab button (Duplicate)
|
79 |
+
echo $this->display_yikes_button_holder_container_duplicate();
|
80 |
+
|
81 |
+
echo '</div>';
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Generate the normal tab HTML block
|
86 |
+
*
|
87 |
+
* @since 1.5
|
88 |
+
*
|
89 |
+
* @param array | $tab_data | Array of tab data
|
90 |
+
* @param array | $reusable_tab_options | Array of saved tab data
|
91 |
+
* @param object| $post | The global $post object
|
92 |
+
*/
|
93 |
+
protected function generate_tab_html( $tab_data, $reusable_tab_options, $post ) {
|
94 |
+
$i = 1;
|
95 |
+
|
96 |
+
// Set up the initial display, by looping
|
97 |
+
foreach ( $tab_data as $tab ) {
|
98 |
+
|
99 |
+
$reusable_tab_flag = false;
|
100 |
+
$reusable_tab_id = '';
|
101 |
+
|
102 |
+
// If $tab is in the array of reusable tabs, set flag
|
103 |
+
if ( isset( $reusable_tab_options ) && isset( $reusable_tab_options[$post->ID] ) ) {
|
104 |
+
|
105 |
+
foreach( $reusable_tab_options[$post->ID] as $id => $reusable_tab_data ) {
|
106 |
+
if ( isset( $reusable_tab_data['tab_id'] ) && isset( $tab['id'] ) && $reusable_tab_data['tab_id'] === $tab['id'] ) {
|
107 |
+
$reusable_tab_flag = true;
|
108 |
+
$reusable_tab_id = $reusable_tab_data['reusable_tab_id'];
|
109 |
+
}
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
// Override Saved Tab checkbox & hidden input fields
|
114 |
+
echo $this->display_yikes_override_container( $i, $reusable_tab_flag, $reusable_tab_id );
|
115 |
+
|
116 |
+
// Tab Title input field
|
117 |
+
$this->display_woocommerce_wp_text_input( $i, $tab );
|
118 |
+
|
119 |
+
// Tab content wysiwyg
|
120 |
+
$this->display_woocommerce_wp_wysiwyg_input( $i, $tab );
|
121 |
+
|
122 |
+
// Up & Down arrows & Remove Tab button
|
123 |
+
echo $this->display_yikes_button_holder_container( $i );
|
124 |
+
|
125 |
+
// line separating tabs
|
126 |
+
echo $this->display_yikes_tab_divider( $i, count( $tab_data ) );
|
127 |
+
|
128 |
+
$i++;
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Add how-to info HTML to page
|
134 |
+
*
|
135 |
+
* @since 1.5
|
136 |
+
*
|
137 |
+
* @return string HTML
|
138 |
+
*/
|
139 |
+
protected function display_yikes_how_to() {
|
140 |
+
$return_html = '';
|
141 |
+
$return_html .= '<div class="yikes-woo-tabs-hidden-how-to-info">';
|
142 |
+
$return_html .= '<p class="yikes_woo_how_to_info">' . __( "For help using Custom Tabs please visit our <a href='https://yikesplugins.com/support/knowledge-base/product/easy-custom-product-tabs-for-woocommerce/' target='_blank'>Knowledge Base</a>" , 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</p>';
|
143 |
+
$return_html .= '</div>';
|
144 |
+
$return_html .= '<div id="yikes-woo-help-me-icon" class="dashicons dashicons-editor-help yikes-tabs-how-to-toggle" title="' . __( "Help Me!" , 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '"></div>';
|
145 |
+
|
146 |
+
return $return_html;
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Add override container HTML to page
|
151 |
+
*
|
152 |
+
* @since 1.5
|
153 |
+
*
|
154 |
+
* @param int $i Counter for tab generating loop
|
155 |
+
* @param bool $reusable_tab_flag Flag indicating whether this tab uses a saved/reusable tab
|
156 |
+
* @param int $reusable_tab_id ID of the saved/reusable tab
|
157 |
+
* @return string HTML
|
158 |
+
*/
|
159 |
+
protected function display_yikes_override_container( $i, $reusable_tab_flag, $reusable_tab_id ) {
|
160 |
+
$return_html = '';
|
161 |
+
|
162 |
+
if ( $reusable_tab_flag === true ) {
|
163 |
+
$return_html .= '<p class="yikes_wc_override_reusable_tab_container" id="_yikes_wc_override_reusable_tab_container_' . $i . '" data-reusable-tab="true">';
|
164 |
+
$return_html .= '<input type="checkbox" class="_yikes_wc_override_reusable_tab" id="_yikes_wc_override_reusable_tab_' . $i . '" data-tab-number="'. $i .'"';
|
165 |
+
$return_html .= 'title="' . __( 'Check this box to override the saved tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '">';
|
166 |
+
$return_html .= '<label id="_yikes_wc_override_reusable_tab_label_' . $i . '" for="_yikes_wc_override_reusable_tab_' . $i . '" class="_yikes_wc_override_reusable_tab_label">';
|
167 |
+
$return_html .= __( ' Override Saved Tab for this product' , 'yikes-inc-easy-custom-woocommerce-product-tabs' );
|
168 |
+
$return_html .= '</label>';
|
169 |
+
$return_html .= '<input type="hidden" name="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '_action" class="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_action"';
|
170 |
+
$return_html .= 'id="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '_action" value="none">';
|
171 |
+
$return_html .= '<input type="hidden" name="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '" class="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id"';
|
172 |
+
$return_html .= 'id="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '" value="' . $reusable_tab_id . '">';
|
173 |
+
$return_html .= '</p>';
|
174 |
+
} else {
|
175 |
+
$return_html .= '<p class="yikes_wc_override_reusable_tab_container" id="_yikes_wc_override_reusable_tab_container_' . $i . '" style="display: none;">';
|
176 |
+
$return_html .= '<input type="checkbox" class="_yikes_wc_override_reusable_tab" id="_yikes_wc_override_reusable_tab_' . $i . '" data-tab-number="'. $i .'"';
|
177 |
+
$return_html .= 'title="' . __( 'Check this box to override the saved tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '">';
|
178 |
+
$return_html .= '<label id="_yikes_wc_override_reusable_tab_label_' . $i . '" for="_yikes_wc_override_reusable_tab_' . $i . '" class="_yikes_wc_override_reusable_tab_label">';
|
179 |
+
$return_html .= __( ' Override Saved Tab for this product' , 'yikes-inc-easy-custom-woocommerce-product-tabs' );
|
180 |
+
$return_html .= '</label>';
|
181 |
+
$return_html .= '<input type="hidden" name="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '_action" class="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_action"';
|
182 |
+
$return_html .= 'id="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '_action" value="none">';
|
183 |
+
$return_html .= '<input type="hidden" name="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '" class="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id"';
|
184 |
+
$return_html .= 'id="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '" value="' . $reusable_tab_id . '">';
|
185 |
+
$return_html .= '</p>';
|
186 |
+
}
|
187 |
+
|
188 |
+
return $return_html;
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Add button holder container HTML to page
|
193 |
+
*
|
194 |
+
* @since 1.5
|
195 |
+
*
|
196 |
+
* @param int $i Counter for tab generating loop
|
197 |
+
* @return string HTML
|
198 |
+
*/
|
199 |
+
protected function display_yikes_button_holder_container( $i ) {
|
200 |
+
$return_html = '';
|
201 |
+
|
202 |
+
$return_html .= '<section class="button-holder" alt="' . $i . '">';
|
203 |
+
$return_html .= '<div class="yikes_wc_move_tab_container">';
|
204 |
+
$return_html .= '<p class="yikes_wc_move_tab">Move tab order</p>';
|
205 |
+
$return_html .= '<span class="dashicons dashicons-arrow-up move-tab-data-up"></span>';
|
206 |
+
$return_html .= '<span class="dashicons dashicons-arrow-down move-tab-data-down"></span>';
|
207 |
+
$return_html .= '</div>';
|
208 |
+
$return_html .= '<a href="#" onclick="return false;" class="button-secondary remove_this_tab"><span class="dashicons dashicons-no-alt"></span>';
|
209 |
+
$return_html .= __( 'Remove Tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' );
|
210 |
+
$return_html .= '</a>';
|
211 |
+
$return_html .= '</section>';
|
212 |
+
|
213 |
+
return $return_html;
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Add tab divider HTML to page
|
218 |
+
*
|
219 |
+
* @since 1.5
|
220 |
+
*
|
221 |
+
* @param int $i Counter for tab generating loop
|
222 |
+
* @param int $tab_count Total # of tabs
|
223 |
+
* @return string HTML
|
224 |
+
*/
|
225 |
+
protected function display_yikes_tab_divider( $i, $tab_count ) {
|
226 |
+
$return_html = '';
|
227 |
+
if ( $i != $tab_count ) {
|
228 |
+
$return_html .= '<div class="yikes-woo-custom-tab-divider"></div>';
|
229 |
+
}
|
230 |
+
|
231 |
+
return $return_html;
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Call input field generation function and echo HTML to page
|
236 |
+
*
|
237 |
+
* @since 1.5
|
238 |
+
*
|
239 |
+
* @param int $i Counter for tab generating loop
|
240 |
+
* @param array $tab Array of tab data
|
241 |
+
*/
|
242 |
+
protected function display_woocommerce_wp_text_input( $i, $tab ) {
|
243 |
+
|
244 |
+
woocommerce_wp_text_input( array( 'id' => '_yikes_wc_custom_repeatable_product_tabs_tab_title_' . $i , 'label' => __( 'Tab Title', 'yikes-inc-easy-custom-woocommerce-product-tabs' ), 'description' => '', 'value' => $tab['title'] , 'placeholder' => __( 'Custom Tab Title' , 'yikes-inc-easy-custom-woocommerce-product-tabs' ), 'class' => 'yikes_woo_tabs_title_field') );
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Call wp_editor wrapped function and echo HTML to page
|
249 |
+
*
|
250 |
+
* @since 1.5
|
251 |
+
*
|
252 |
+
* @param int $i Counter for tab generating loop
|
253 |
+
* @param array $tab Array of tab data
|
254 |
+
*/
|
255 |
+
protected function display_woocommerce_wp_wysiwyg_input( $i, $tab ) {
|
256 |
+
echo '<div class="form-field-tinymce _yikes_wc_custom_repeatable_product_tabs_tab_content_field _yikes_wc_custom_repeatable_product_tabs_tab_content_' . $i . '_field">';
|
257 |
+
$this->woocommerce_wp_wysiwyg_input( array(
|
258 |
+
'id' => '_yikes_wc_custom_repeatable_product_tabs_tab_content_' . $i ,
|
259 |
+
'label' => __( 'Content', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
260 |
+
'placeholder' => __( 'HTML and text to display.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
261 |
+
'value' => $tab['content'],
|
262 |
+
'style' => 'width:70%;height:10.5em;',
|
263 |
+
'class' => 'yikes_woo_tabs_content_field',
|
264 |
+
'number' => $i
|
265 |
+
) );
|
266 |
+
echo '</div>';
|
267 |
+
}
|
268 |
+
|
269 |
+
/* Hidden Duplicate HTML Section */
|
270 |
+
|
271 |
+
/**
|
272 |
+
* Add duplicate override container HTML to page
|
273 |
+
*
|
274 |
+
* @since 1.5
|
275 |
+
*
|
276 |
+
* @return string HTML
|
277 |
+
*/
|
278 |
+
protected function display_yikes_override_container_duplicate() {
|
279 |
+
$return_html = '';
|
280 |
+
|
281 |
+
$return_html .= '<p class="yikes_wc_override_reusable_tab_container _yikes_wc_override_reusable_tab_container_duplicate" id="_yikes_wc_override_reusable_tab_container_duplicate" style="display: none;">';
|
282 |
+
$return_html .= '<input type="checkbox" class="_yikes_wc_override_reusable_tab" id="_yikes_wc_override_reusable_tab_duplicate" title="' . __( 'Check this box to override the saved tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '" />';
|
283 |
+
$return_html .= '<label class="_yikes_wc_override_reusable_tab_label_duplicate">' . __( 'Override Saved Tab for this product' , 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</label>';
|
284 |
+
$return_html .= '<input type="hidden" class="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_action" id="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_action_duplicate" value="none">';
|
285 |
+
$return_html .= '<input type="hidden" class="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id" id="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_duplicate" value="">';
|
286 |
+
$return_html .= '</p>';
|
287 |
+
|
288 |
+
return $return_html;
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* Add duplicate remove tab button HTML to page
|
293 |
+
*
|
294 |
+
* @since 1.5
|
295 |
+
*
|
296 |
+
* @return string HTML
|
297 |
+
*/
|
298 |
+
protected function display_yikes_remove_tab_duplicate() {
|
299 |
+
$return_html = '';
|
300 |
+
|
301 |
+
$return_html .= '<a href="#" onclick="return false;" class="button-secondary remove_this_tab">';
|
302 |
+
$return_html .= '<span class="dashicons dashicons-no-alt"></span>';
|
303 |
+
$return_html .= __( 'Remove Tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' );
|
304 |
+
$return_html .= '</a>';
|
305 |
+
|
306 |
+
return $return_html;
|
307 |
+
}
|
308 |
+
|
309 |
+
/**
|
310 |
+
* Call input field generation function and echo HTML to page
|
311 |
+
*
|
312 |
+
* @since 1.5
|
313 |
+
*
|
314 |
+
* @param array $tab Array of tab data
|
315 |
+
*/
|
316 |
+
protected function display_woocommerce_wp_wysiwyg_input_duplicate() {
|
317 |
+
|
318 |
+
$this->woocommerce_wp_textarea_input( array( 'id' => 'hidden_duplicator_row_content' , 'label' => __( 'Content', 'yikes-inc-easy-custom-woocommerce-product-tabs' ), 'placeholder' => __( 'HTML and text to display.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ), 'style' => 'width:70%;height:10.5em;' , 'class' => 'yikes_woo_tabs_content_field' ) );
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* Add duplicate button holder container HTML to page
|
323 |
+
*
|
324 |
+
* @since 1.5
|
325 |
+
*
|
326 |
+
* @return string HTML
|
327 |
+
*/
|
328 |
+
protected function display_yikes_button_holder_container_duplicate() {
|
329 |
+
$return_html = '';
|
330 |
+
|
331 |
+
$return_html .= '<section class="button-holder" alt="">';
|
332 |
+
$return_html .= '<div class="yikes_wc_move_tab_container">';
|
333 |
+
$return_html .= '<p class="yikes_wc_move_tab">Move tab order</p>';
|
334 |
+
$return_html .= '<span class="dashicons dashicons-arrow-up move-tab-data-up"></span>';
|
335 |
+
$return_html .= '<span class="dashicons dashicons-arrow-down move-tab-data-down"></span>';
|
336 |
+
$return_html .= '</div>';
|
337 |
+
$return_html .= '<a href="#" onclick="return false;" class="button-secondary remove_this_tab">';
|
338 |
+
$return_html .= '<span class="dashicons dashicons-no-alt"></span>';
|
339 |
+
$return_html .= __( 'Remove Tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' );
|
340 |
+
$return_html .= '</a>';
|
341 |
+
$return_html .= '</section>';
|
342 |
+
|
343 |
+
return $return_html;
|
344 |
+
}
|
345 |
+
|
346 |
+
/**
|
347 |
+
* Add hidden input field for number of tabs to page
|
348 |
+
*
|
349 |
+
* @since 1.5
|
350 |
+
*
|
351 |
+
* @return string HTML
|
352 |
+
*/
|
353 |
+
protected function display_yikes_number_of_tabs( $tab_count ) {
|
354 |
+
$return_html = '';
|
355 |
+
|
356 |
+
$return_html .= '<input type="hidden" value="' . $tab_count . '" id="number_of_tabs" name="number_of_tabs" >';
|
357 |
+
|
358 |
+
return $return_html;
|
359 |
+
}
|
360 |
+
|
361 |
+
/**
|
362 |
+
* Add 'Add Another Tab' and 'Add a Saved Tab' buttons to page
|
363 |
+
*
|
364 |
+
* @since 1.5
|
365 |
+
*
|
366 |
+
* @param bool | $product_has_tabs | flag indicating whether the product has any defined tabs
|
367 |
+
* @return string HTML
|
368 |
+
*/
|
369 |
+
protected function display_yikes_add_tabs_container( $product_has_tabs ) {
|
370 |
+
$return_html = '';
|
371 |
+
|
372 |
+
// If we don't have any tabs, then add some classes
|
373 |
+
$classes_to_add = ( $product_has_tabs === false ) ? '_yikes_wc_add_tab_center_new _yikes_wc_add_tab_center' : '';
|
374 |
+
|
375 |
+
$return_html .= '<div class="add_tabs_container ' . $classes_to_add . '">';
|
376 |
+
$return_html .= '<span id="yikes_woo_ajax_save_feedback"></span>';
|
377 |
+
$return_html .= '<a href="#" class="button-secondary _yikes_wc_add_tabs" id="add_another_tab">';
|
378 |
+
$return_html .= '<i class="dashicons dashicons-plus-alt inline-button-dashicons"></i>';
|
379 |
+
$return_html .= __( 'Add a Tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' );
|
380 |
+
$return_html .= '</a>';
|
381 |
+
$return_html .= '<span class="yikes_wc_apply_reusable_tab_container">';
|
382 |
+
$return_html .= '<span class="button-secondary _yikes_wc_apply_a_saved_tab _yikes_wc_add_tabs" id="_yikes_wc_apply_a_saved_tab">';
|
383 |
+
$return_html .= '<i class="dashicons dashicons-plus-alt inline-button-dashicons"></i>';
|
384 |
+
$return_html .= __( 'Add a Saved Tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' );
|
385 |
+
$return_html .= '</span>';
|
386 |
+
$return_html .= '</span>';
|
387 |
+
$return_html .= '<input name="save" class="button button-primary" id="yikes_woo_save_custom_tabs" value="Save Tabs" type="button">';
|
388 |
+
$return_html .= '</div>';
|
389 |
+
|
390 |
+
return $return_html;
|
391 |
+
}
|
392 |
+
|
393 |
+
/**
|
394 |
+
* Generates a textarea field for hidden duplicate HTML block
|
395 |
+
*
|
396 |
+
* @param array $field Array of HTML field related values
|
397 |
+
*/
|
398 |
+
private function woocommerce_wp_textarea_input( $field ) {
|
399 |
+
global $thepostid, $post;
|
400 |
+
|
401 |
+
if ( ! $thepostid ) $thepostid = $post->ID;
|
402 |
+
if ( ! isset( $field['placeholder'] ) ) $field['placeholder'] = '';
|
403 |
+
if ( ! isset( $field['class'] ) ) $field['class'] = 'short';
|
404 |
+
if ( ! isset( $field['value'] ) ) $field['value'] = get_post_meta( $thepostid, $field['id'], true );
|
405 |
+
|
406 |
+
echo '<p class="form-field-tinymce ' . $field['id'] . '_field"> <textarea class="' . $field['class'] . '" name="' . $field['id'] . '" id="' . $field['id'] . '" placeholder="' . $field['placeholder'] . '" rows="2" cols="20"' . (isset( $field['style'] ) ? ' style="' . $field['style'] . '"' : '') . '>' . $field['value'] . '</textarea> ';
|
407 |
+
|
408 |
+
if ( isset( $field['description'] ) && $field['description'] ) {
|
409 |
+
echo '<span class="description">' . $field['description'] . '</span>';
|
410 |
+
}
|
411 |
+
|
412 |
+
echo '</p>';
|
413 |
+
}
|
414 |
+
|
415 |
+
/**
|
416 |
+
* Wrapper function for wp_editor
|
417 |
+
*
|
418 |
+
* @param array $field Array of HTML field related values
|
419 |
+
*/
|
420 |
+
private function woocommerce_wp_wysiwyg_input( $field ) {
|
421 |
+
global $thepostid, $post;
|
422 |
+
|
423 |
+
if ( ! $thepostid ) $thepostid = $post->ID;
|
424 |
+
if ( ! isset( $field['placeholder'] ) ) $field['placeholder'] = '';
|
425 |
+
if ( ! isset( $field['class'] ) ) $field['class'] = 'short';
|
426 |
+
if ( ! isset( $field['value'] ) ) $field['value'] = get_post_meta( $thepostid, $field['id'], true );
|
427 |
+
|
428 |
+
$editor_settings = array(
|
429 |
+
'textarea_name' => $field['id']
|
430 |
+
);
|
431 |
+
|
432 |
+
wp_editor( $field['value'], $field['id'], $editor_settings );
|
433 |
+
|
434 |
+
if ( isset( $field['description'] ) && $field['description'] ) {
|
435 |
+
echo '<span class="description">' . $field['description'] . '</span>';
|
436 |
+
}
|
437 |
+
}
|
438 |
+
|
439 |
+
/* END HTML Functions */
|
440 |
+
}
|
441 |
+
}
|
442 |
+
|
443 |
+
?>
|
admin/page.yikes-woo-saved-tabs-single.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// For safety purposes...
|
4 |
+
// Make sure we have a tab
|
5 |
+
if ( ! $new_tab && ( ! isset( $tab ) || empty( $tab ) ) ) {
|
6 |
+
if ( isset( $redirect ) ) {
|
7 |
+
echo '<p> Oops. It looks like something went wrong. Please <a href="' . $redirect . '" title="go back">go back</a> and try again</p>';
|
8 |
+
}
|
9 |
+
exit;
|
10 |
+
}
|
11 |
+
|
12 |
+
// Set variables before using them
|
13 |
+
$tab_title = ( isset( $tab['tab_title'] ) && ! empty( $tab['tab_title'] ) ) ? $tab['tab_title'] : '';
|
14 |
+
$tab_content = ( isset( $tab['tab_content'] ) && ! empty( $tab['tab_content'] ) ) ? $tab['tab_content'] : '';
|
15 |
+
$tab_id = ( isset( $tab['tab_id'] ) && ! empty( $tab['tab_id'] ) ) ? (int) $tab['tab_id'] : 'new';
|
16 |
+
|
17 |
+
// Tab stats
|
18 |
+
$number_of_products_using_this_tab = count( $products );
|
19 |
+
|
20 |
+
?>
|
21 |
+
<div class="wrap">
|
22 |
+
<h1 class="screen-media">
|
23 |
+
Custom Product Tabs for WooCommerce | <span id="yikes_woo_tab_title_header"><?php echo $tab_title; ?></span>
|
24 |
+
<span class="yikes_woo_tab_id page-title-action">ID: <?php echo $tab_id; ?></span>
|
25 |
+
</h1>
|
26 |
+
|
27 |
+
<?php if ( $new_tab !== true ) { ?>
|
28 |
+
<!-- Only show this if we're updating an existing tab -->
|
29 |
+
<div class="yikes_woo_settings_info">
|
30 |
+
<p>
|
31 |
+
<?php _e( "Any updates made here will apply to all products using this tab.", 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
32 |
+
</p>
|
33 |
+
</div>
|
34 |
+
<?php } ?>
|
35 |
+
|
36 |
+
<div id="poststuff">
|
37 |
+
|
38 |
+
<div class="yikes_woo_go_back_url">
|
39 |
+
<a href="<?php echo $redirect; ?>"><?php _e( 'Go Back to Saved Tabs list', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></a>
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<div class="row yikes_woo_reusable_tabs_container" id="yikes_woo_reusable_tabs_container_<?php echo $tab_id ?>" data-tab-id="<?php echo $tab_id; ?>">
|
43 |
+
|
44 |
+
<!-- Title -->
|
45 |
+
<div class="yikes_woo_reusable_tab_title">
|
46 |
+
<label class="yikes_woo_reusable_tab_title_label" for="yikes_woo_reusable_tab_title_<?php echo $tab_id; ?>">
|
47 |
+
<h3><?php _e( 'Tab Title', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></h3>
|
48 |
+
</label>
|
49 |
+
<input type="text" id="yikes_woo_reusable_tab_title_<?php echo $tab_id; ?>" value="<?php echo $tab_title; ?>" />
|
50 |
+
</div>
|
51 |
+
|
52 |
+
<!-- Content -->
|
53 |
+
<div class="yikes_woo_reusable_tab_content">
|
54 |
+
<label class="yikes_woo_reusable_tab_content_label" for="yikes_woo_reusable_tab_content_<?php echo $tab_id; ?>">
|
55 |
+
<h3><?php _e( 'Tab Content', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></h3>
|
56 |
+
</label>
|
57 |
+
<?php
|
58 |
+
wp_editor( stripslashes( $tab_content ), 'yikes_woo_reusable_tab_content_' . $tab_id, array( 'textarea_name' => 'yikes_woo_reusable_tab_content_' . $tab_id, 'textarea_rows' => 8 ) );
|
59 |
+
?>
|
60 |
+
</div>
|
61 |
+
|
62 |
+
<!-- Buttons -->
|
63 |
+
<div class="yikes_woo_save_and_delete_tab_buttons">
|
64 |
+
<span class="button button-primary yikes_woo_save_this_tab" id="yikes_woo_save_this_tab_<?php echo $tab_id; ?>" data-tab-id="<?php echo $tab_id; ?>">
|
65 |
+
<?php _e( 'Save Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
66 |
+
</span>
|
67 |
+
<span class="button button-secondary yikes_woo_delete_this_tab yikes_woo_delete_this_tab_single" id="yikes_woo_delete_this_tab_<?php echo $tab_id; ?>" data-tab-id="<?php echo $tab_id; ?>">
|
68 |
+
<i class="dashicons dashicons-dismiss inline-button-dashicons"></i>
|
69 |
+
<?php _e( 'Delete Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
70 |
+
</span>
|
71 |
+
</div>
|
72 |
+
</div>
|
73 |
+
|
74 |
+
<div class="yikes_woo_saved_tab_products">
|
75 |
+
<h3 class="yikes_woo_saved_tab_header">Products</h3>
|
76 |
+
<div class="inside entry-details-overview">
|
77 |
+
<?php if ( $number_of_products_using_this_tab === 0 ) { ?>
|
78 |
+
<p>
|
79 |
+
This tab is currently not used for any products.
|
80 |
+
</p>
|
81 |
+
<?php } else {
|
82 |
+
$plural_product_name = ( $number_of_products_using_this_tab > 1 ) ? 'products' : 'product';
|
83 |
+
?>
|
84 |
+
<p>
|
85 |
+
This tab is currently used on <span class="yikes_woo_number_of_products"><?php echo $number_of_products_using_this_tab; ?></span> <?php echo $plural_product_name ?>
|
86 |
+
</p>
|
87 |
+
<?php foreach( $products as $product_id ) { ?>
|
88 |
+
<p>
|
89 |
+
<?php $edit_product_url = add_query_arg( array( 'post' => $product_id, 'action' => 'edit' ), esc_url_raw( 'post.php' ) ); ?>
|
90 |
+
<span> <a href="<?php echo $edit_product_url ?>"> <?php echo get_the_title( $product_id ); ?> </a> </span>
|
91 |
+
</p>
|
92 |
+
<?php } ?>
|
93 |
+
<?php } ?>
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
</div>
|
97 |
+
</div>
|
admin/page.yikes-woo-saved-tabs.php
ADDED
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="wrap">
|
2 |
+
|
3 |
+
<h1>
|
4 |
+
Custom Product Tabs for WooCommerce | Saved Tabs
|
5 |
+
<span class="yikes_woo_add_another_tab page-title-action" id="yikes_woo_add_another_tab">
|
6 |
+
<a href="<?php echo $new_tab_url; ?>"> <?php _e( 'Add Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?> </a>
|
7 |
+
</span>
|
8 |
+
</h1>
|
9 |
+
|
10 |
+
<!-- Delete-success Message -->
|
11 |
+
<div id="yikes_woo_delete_success_message" class="deleted notice notice-success is-dismissible" style="<?php echo $delete_message_display ?>">
|
12 |
+
<p>
|
13 |
+
<?php _e( 'Tab deleted!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
14 |
+
</p>
|
15 |
+
<button type="button" class="notice-dismiss">
|
16 |
+
<span class="screen-reader-text">Dismiss this notice.</span>
|
17 |
+
</button>
|
18 |
+
</div>
|
19 |
+
|
20 |
+
<div class="yikes_woo_settings_info">
|
21 |
+
<p>
|
22 |
+
<?php _e( "Create and save tabs you can add to multiple products.", 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
23 |
+
</p>
|
24 |
+
</div>
|
25 |
+
|
26 |
+
<div id="poststuff">
|
27 |
+
|
28 |
+
<!-- Bulk Actions -->
|
29 |
+
<div class="tablenav top">
|
30 |
+
<div class="alignleft actions bulkactions">
|
31 |
+
<label for="bulk-action-selector-top" class="screen-reader-text"><?php _e( 'Select bulk action', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></label>
|
32 |
+
<select name="action" id="bulk-action-selector-top">
|
33 |
+
<option value="-1"><?php _e( 'Bulk Actions', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></option>
|
34 |
+
<option value="delete" class="hide-if-no-js"><?php _e( 'Delete', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></option>
|
35 |
+
</select>
|
36 |
+
<input type="button" id="bulk-action-button" class="button action yikes_woo_handle_bulk_action" value="<?php _e( 'Apply', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) ?>">
|
37 |
+
</div>
|
38 |
+
<br class="clear">
|
39 |
+
</div>
|
40 |
+
<table class="widefat fixed" cellspacing="0">
|
41 |
+
<thead>
|
42 |
+
<tr>
|
43 |
+
<td id="cb" class="manage-column column-cb check-column" scope="col">
|
44 |
+
<label class="screen-reader-text" for="cb-select-all-1"><?php _e( 'Select All', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></label>
|
45 |
+
<input id="cb-select-all-1" type="checkbox">
|
46 |
+
</td>
|
47 |
+
<th id="columnname" class="manage-column column-columnname" scope="col">
|
48 |
+
<?php _e( 'Tab Title', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
49 |
+
</th>
|
50 |
+
<th id="columnname" class="manage-column column-columnname" scope="col">
|
51 |
+
<?php _e( 'Tab Content Preview', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
52 |
+
</th>
|
53 |
+
<th id="columnname" class="manage-column column-columnname" scope="col"> </th>
|
54 |
+
</tr>
|
55 |
+
</thead>
|
56 |
+
|
57 |
+
<tfoot>
|
58 |
+
<tr>
|
59 |
+
<td id="cb" class="manage-column column-cb check-column" scope="col">
|
60 |
+
<label class="screen-reader-text" for="cb-select-all-1"><?php _e( 'Select All', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></label>
|
61 |
+
<input id="cb-select-all-1" type="checkbox">
|
62 |
+
</td>
|
63 |
+
<th id="columnname" class="manage-column column-columnname" scope="col">
|
64 |
+
<?php _e( 'Tab Title', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
65 |
+
</th>
|
66 |
+
<th id="columnname" class="manage-column column-columnname" scope="col">
|
67 |
+
<?php _e( 'Tab Content Preview', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
68 |
+
</th>
|
69 |
+
<th id="columnname" class="manage-column column-columnname" scope="col"> </th>
|
70 |
+
</tr>
|
71 |
+
</tfoot>
|
72 |
+
|
73 |
+
<tbody>
|
74 |
+
<?php
|
75 |
+
if( ! empty( $yikes_custom_tab_data ) ) {
|
76 |
+
|
77 |
+
foreach ( $yikes_custom_tab_data as $key => $tab_data ) {
|
78 |
+
|
79 |
+
// Set variables before using them
|
80 |
+
$tab_title = ( isset( $tab_data['tab_title'] ) && ! empty( $tab_data['tab_title'] ) ) ? $tab_data['tab_title'] : '';
|
81 |
+
$tab_content_excerpt = ( isset( $tab_data['tab_content'] ) && ! empty( $tab_data['tab_content'] ) ) ? stripslashes( substr( wp_strip_all_tags( $tab_data['tab_content'] ), 0, 150 ) ) : '';
|
82 |
+
$tab_id = ( isset( $tab_data['tab_id'] ) && ! empty( $tab_data['tab_id'] ) ) ? (int) $tab_data['tab_id'] : 0;
|
83 |
+
$edit_tab_url = ( isset( $settings_page_slug ) ) ? add_query_arg( array( 'saved-tab-id' => $tab_id ), esc_url_raw( 'options-general.php?page=' . $settings_page_slug ) ) : '';
|
84 |
+
?>
|
85 |
+
<tr class="yikes_woo_saved_tabs_row" id="yikes_woo_saved_tabs_row_<?php echo $tab_id; ?>" data-tab-id="<?php echo $tab_id; ?>">
|
86 |
+
<th class="check-column" scope="row">
|
87 |
+
<input class="entry-bulk-action-checkbox" type="checkbox" value="<?php echo $tab_id; ?>" />
|
88 |
+
</th>
|
89 |
+
<td class="column-columnname">
|
90 |
+
<?php echo $tab_title; ?>
|
91 |
+
<div class="row-actions">
|
92 |
+
<span class="">
|
93 |
+
<a href="<?php echo $edit_tab_url ?>"><?php _e( 'Edit Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></a>
|
94 |
+
</span> |
|
95 |
+
<span data-tab-id="<?php echo $tab_id; ?>" class="yikes_woo_delete_this_tab trash">
|
96 |
+
<?php _e( 'Delete Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
97 |
+
</span>
|
98 |
+
</div>
|
99 |
+
</td>
|
100 |
+
<td class="column-columnname"><?php echo $tab_content_excerpt; ?></td>
|
101 |
+
<td class="column-columnname" align="center">
|
102 |
+
<a href="<?php echo $edit_tab_url ?>" class="button-secondary view-saved-tab-button" data-entry-id="<?php echo (int) $tab_id; ?>">
|
103 |
+
<?php _e( 'Edit Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
104 |
+
</a>
|
105 |
+
</td>
|
106 |
+
</tr>
|
107 |
+
<?php
|
108 |
+
}
|
109 |
+
} else {
|
110 |
+
?>
|
111 |
+
<tr>
|
112 |
+
<td class="column-columnname" colspan="5">
|
113 |
+
<strong><?php _e( 'There are no saved tabs. Add one!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?> </strong>
|
114 |
+
</td>
|
115 |
+
</tr>
|
116 |
+
<?php
|
117 |
+
}
|
118 |
+
?>
|
119 |
+
</tbody>
|
120 |
+
</table>
|
121 |
+
</div>
|
122 |
+
</div>
|
css/dist/lity.min.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*! Lity - v3.0.0-dev - 2016-11-04
|
2 |
+
* http://sorgalla.com/lity/
|
3 |
+
* Copyright (c) 2015-2016 Jan Sorgalla; Licensed MIT */.lity{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;white-space:nowrap;background:#0b0b0b;background:rgba(0,0,0,.9);outline:none!important;opacity:0;-webkit-transition:opacity .3s ease;transition:opacity .3s ease}.lity.lity-opened{opacity:1}.lity.lity-closed{opacity:0}.lity *{box-sizing:border-box}.lity-wrap{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;text-align:center;outline:none!important}.lity-wrap:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.lity-loader{z-index:9991;color:#fff;position:absolute;top:50%;margin-top:-.8em;width:100%;text-align:center;font-size:14px;font-family:Arial,Helvetica,sans-serif;opacity:0;-webkit-transition:opacity .3s ease;transition:opacity .3s ease}.lity-loading .lity-loader{opacity:1}.lity-container{z-index:9992;position:relative;text-align:left;vertical-align:middle;display:inline-block;white-space:normal;max-width:100%;max-height:100%;outline:none!important}.lity-content{z-index:9993;width:100%;-webkit-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform .3s ease;transition:-webkit-transform .3s ease;transition:transform .3s ease;transition:transform .3s ease,-webkit-transform .3s ease}.lity-closed .lity-content,.lity-loading .lity-content{-webkit-transform:scale(.8);transform:scale(.8)}.lity-content:after{content:'';position:absolute;left:0;top:0;bottom:0;display:block;right:0;width:auto;height:auto;z-index:-1;box-shadow:0 0 8px rgba(0,0,0,.6)}.lity-close{z-index:9994;width:35px;height:35px;position:fixed;right:0;top:0;-webkit-appearance:none;cursor:pointer;text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,.6);border:0;background:none;outline:none;box-shadow:none}.lity-close::-moz-focus-inner{border:0;padding:0}.lity-close:active,.lity-close:focus,.lity-close:hover,.lity-close:visited{text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,.6);border:0;background:none;outline:none;box-shadow:none}.lity-close:active{top:1px}.lity-image img{max-width:100%;display:block;line-height:0;border:0}.lity-iframe .lity-container{width:100%;max-width:964px}.lity-iframe-container{width:100%;height:0;padding-top:56.25%;overflow:auto;pointer-events:auto;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-overflow-scrolling:touch}.lity-iframe-container iframe{position:absolute;display:block;top:0;left:0;width:100%;height:100%;box-shadow:0 0 8px rgba(0,0,0,.6);background:#000}.lity-hide{display:none}
|
css/font/yikes-woo-font.svg
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
<?xml version="1.0" standalone="no"?>
|
2 |
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
-
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
-
<metadata>Generated by IcoMoon</metadata>
|
5 |
-
<defs>
|
6 |
-
<font id="yikes-woo-font" horiz-adv-x="1024">
|
7 |
-
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
8 |
-
<missing-glyph horiz-adv-x="1024" />
|
9 |
-
<glyph unicode=" " d="" horiz-adv-x="512" />
|
10 |
-
<glyph unicode="" d="M0 531.478v-428.522h272.696l0.558-65.112c0.558-36.174 0.558-71.236 0.558-77.914-0.558-7.236 0.558-12.8 1.67-12.8s39.512 35.062 84.592 77.914l81.81 77.914h415.164v857.044h-857.044v-428.522zM516.452 719.582c3.896-3.896 6.678-10.016 6.678-13.914 0-7.236-133.564-330.574-148.034-358.956-12.8-24.486-46.748-18.366-46.748 8.348 0 9.462 72.348 188.104 129.112 320 20.036 46.192 23.93 51.2 37.286 51.2 8.348 0 17.81-2.784 21.704-6.678zM289.392 662.818c0-36.73-1.112-41.74-11.13-45.078-6.122-1.67-33.948-15.584-61.774-30.052l-50.644-27.27 61.774-32.278 61.774-32.834v-40.626c0-22.816-2.226-40.070-4.452-38.958-2.226 1.114-51.2 26.712-108.522 56.764l-104.070 55.652v64.558l26.712 14.47c114.088 62.33 177.53 95.722 183.652 96.278 4.452 0.558 6.678-11.13 6.678-40.626zM672.836 648.348l100.73-52.87v-69.010l-70.678-37.288c-39.514-20.592-86.818-45.634-105.74-56.21l-35.062-18.922v83.478l44.522 23.374c25.6 13.356 42.852 25.6 40.626 28.938-1.67 3.34-0.558 3.896 2.784 1.67 3.34-2.226 12.8-0.558 20.034 3.34 13.356 7.236 11.688 8.348-47.304 37.842l-60.662 30.61v40.626c0 22.818 2.226 40.070 5.010 38.956 2.784-0.558 50.086-25.6 105.74-54.538z" horiz-adv-x="858" />
|
11 |
</font></defs></svg>
|
1 |
+
<?xml version="1.0" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
+
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
+
<metadata>Generated by IcoMoon</metadata>
|
5 |
+
<defs>
|
6 |
+
<font id="yikes-woo-font" horiz-adv-x="1024">
|
7 |
+
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
8 |
+
<missing-glyph horiz-adv-x="1024" />
|
9 |
+
<glyph unicode=" " d="" horiz-adv-x="512" />
|
10 |
+
<glyph unicode="" d="M0 531.478v-428.522h272.696l0.558-65.112c0.558-36.174 0.558-71.236 0.558-77.914-0.558-7.236 0.558-12.8 1.67-12.8s39.512 35.062 84.592 77.914l81.81 77.914h415.164v857.044h-857.044v-428.522zM516.452 719.582c3.896-3.896 6.678-10.016 6.678-13.914 0-7.236-133.564-330.574-148.034-358.956-12.8-24.486-46.748-18.366-46.748 8.348 0 9.462 72.348 188.104 129.112 320 20.036 46.192 23.93 51.2 37.286 51.2 8.348 0 17.81-2.784 21.704-6.678zM289.392 662.818c0-36.73-1.112-41.74-11.13-45.078-6.122-1.67-33.948-15.584-61.774-30.052l-50.644-27.27 61.774-32.278 61.774-32.834v-40.626c0-22.816-2.226-40.070-4.452-38.958-2.226 1.114-51.2 26.712-108.522 56.764l-104.070 55.652v64.558l26.712 14.47c114.088 62.33 177.53 95.722 183.652 96.278 4.452 0.558 6.678-11.13 6.678-40.626zM672.836 648.348l100.73-52.87v-69.010l-70.678-37.288c-39.514-20.592-86.818-45.634-105.74-56.21l-35.062-18.922v83.478l44.522 23.374c25.6 13.356 42.852 25.6 40.626 28.938-1.67 3.34-0.558 3.896 2.784 1.67 3.34-2.226 12.8-0.558 20.034 3.34 13.356 7.236 11.688 8.348-47.304 37.842l-60.662 30.61v40.626c0 22.818 2.226 40.070 5.010 38.956 2.784-0.558 50.086-25.6 105.74-54.538z" horiz-adv-x="858" />
|
11 |
</font></defs></svg>
|
css/repeatable-custom-tabs.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.yikes_woo_tabs_title_field {
|
2 |
position: absolute;
|
3 |
right: 1em;
|
4 |
top: 12px;
|
5 |
border-top: 1px solid #a0a5aa;
|
6 |
width: 100%;
|
7 |
white-space: nowrap;
|
8 |
max-width: 79%;
|
9 |
max-width: 100%;
|
1 |
+
.yikes_woo_tabs_title_field {
|
2 |
position: absolute;
|
3 |
right: 1em;
|
4 |
top: 12px;
|
5 |
border-top: 1px solid #a0a5aa;
|
6 |
width: 100%;
|
7 |
white-space: nowrap;
|
8 |
max-width: 79%;
|
9 |
max-width: 100%;
|
css/repeatable-custom-tabs.min.css
CHANGED
@@ -1,8 +1 @@
|
|
1 |
-
|
2 |
-
* Minified Styles for YIKES Inc. Easy WooCommerce Repeatable Product Tabs
|
3 |
-
*
|
4 |
-
* @ Compiled By: Yikes Inc.
|
5 |
-
* @ http://www.YIKESinc.com
|
6 |
-
*
|
7 |
-
*/
|
8 |
-
.yikes_woo_tabs_title_field{width:70%!important}#duplicate_this_row{display:none}a[href="#yikes_woocommerce_custom_product_tabs"]:before{font-family:yikes-woo-font!important;content:"\e600"!important;font-size:15px!important;display:block;float:left;margin-top:2px}#add_another_tab{float:right;margin-right:2em;background:#cc99c2;border-color:#b366a4;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);color:#fff;text-deconartion:none!important}#yikes_woocommerce_custom_product_tabs hr{margin:1.5em 2em 1.5em 1em}.yikes-woo-custom-tab-divider{display:block;width:92%;height:2px;margin:1.5em 0 1.5em 1em;border-bottom:1px solid rgba(182,182,182,.35)}#yikes_woocommerce_custom_product_tabs div.yikes-woo-custom-tab-divider:last-child{display:none!important}#yikes_woocommerce_custom_product_tabs .wp-editor-wrap{padding:5px 60px 5px 162px!important}.yikes-custom-wysiwyg-label{margin-left:1em!important;line-height:3;}.yikes-logo{position:absolute;top:0;right:0;margin-top:.75em;margin-right:.75em;opacity:.85}#yikes-woo-tabs-review-us{float:right}.yikes-woo-tabs-hidden-how-to-info{display:none;margin-top:.75em;padding-top:.5em;font-family:"Open Sans",sans-serif!important}.yikes-tabs-how-to-toggle{font-size:20px;padding:0 .5em;margin-top:.5em}.yikes-tabs-how-to-toggle:hover{cursor:pointer}.move-tab-data-down,.move-tab-data-up{font-size:25px;transition:color .2s}.move-tab-data-down:hover,.move-tab-data-up:hover{cursor:pointer;color:#4c9cce}.button-holder{float:right;margin-right:4.25em;width:117px;margin-top:.5em}@font-face{font-family:yikes-woo-font;src:url(./font/yikes-woo-font.eot?-394dt5);src:url(./font/yikes-woo-font.eot?#iefix-394dt5) format('embedded-opentype'),url(./font/yikes-woo-font.woff?-394dt5) format('woff'),url(./font/yikes-woo-font.ttf?-394dt5) format('truetype'),url(./font/yikes-woo-font.svg?-394dt5#yikes-woo-font) format('svg');font-weight:400;font-style:normal}[class*=" yikes-woo-"],[class^=yikes-woo-]{font-family:yikes-woo-font;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.yikes-woo-uniE600:before{content:"\e600"}
|
1 |
+
.yikes_woo_tabs_title_field{width:70%!important}#duplicate_this_row{display:none}a[href="#yikes_woocommerce_custom_product_tabs"]:before{font-family:yikes-woo-font!important;content:"\e600"!important;font-size:15px!important;display:block;float:left;margin-top:2px}#yikes_woocommerce_custom_product_tabs hr{margin:1.5em 0}#yikes_woocommerce_custom_product_tabs .options_group{padding:0 1em}#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel div.form-field-tinymce,#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field,#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field-tinymce{max-width:85%;padding-left:0}#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field{padding:5px 0!important}#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel .form-field label{font-size:1.1em;font-weight:700;margin:2px 8px 0 0;width:auto}.yikes-woo-custom-tab-divider{display:block;height:2px;margin:2em 0 1.5em;border-bottom:1px solid #0073aa}.yikes-custom-wysiwyg-label{margin-left:1em;line-height:3}.yikes-logo{position:absolute;top:0;right:0;margin-top:.75em;margin-right:.75em;opacity:.85}#yikes-woo-tabs-review-us{float:right}.yikes-woo-tabs-hidden-how-to-info{display:none;font-family:"Open Sans",sans-serif!important;margin-right:30px}.woocommerce_options_panel p.yikes_woo_how_to_info{margin:9px 0 0;padding:0;text-align:right}.yikes-tabs-how-to-toggle{font-size:20px;position:absolute;right:1em;top:12px}.yikes-tabs-how-to-toggle:hover{cursor:pointer}.move-tab-data-down,.move-tab-data-up{font-size:25px;transition:color .2s}.move-tab-data-down:hover,.move-tab-data-up:hover{cursor:pointer;color:#4c9cce}.button-holder{margin-top:-190px;position:absolute;right:1em;width:110px}.yikes_wc_move_tab_container{margin-top:.5em;text-align:center}.woocommerce_options_panel p.yikes_wc_move_tab{line-height:1;margin:0;padding:0}.button-holder .button-secondary.remove_this_tab{background:#e35b5b;border-color:#dc3232;box-shadow:0 1px 0 #dc3232;color:#fff;cursor:pointer;margin-top:20px}.button-holder .button-secondary.remove_this_tab .dashicons{margin-top:-2px;vertical-align:middle}@font-face{font-family:yikes-woo-font;src:url(font/yikes-woo-font.eot?-394dt5);src:url(font/yikes-woo-font.eot?#iefix-394dt5) format('embedded-opentype'),url(font/yikes-woo-font.woff?-394dt5) format('woff'),url(font/yikes-woo-font.ttf?-394dt5) format('truetype'),url(font/yikes-woo-font.svg?-394dt5#yikes-woo-font) format('svg');font-weight:400;font-style:normal}[class*=" yikes-woo-"],[class^=yikes-woo-]{font-family:yikes-woo-font;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.yikes-woo-uniE600:before{content:"\e600"}.loading-wp-editor-gif{padding-left:350px}.loading-wp-editor-gif-settings{padding-left:50px}.dashicons.inline-button-dashicons{font-size:15px;vertical-align:bottom}.yikes_woo_save_success{color:#31843f;float:left;padding-top:1em}._yikes_wc_add_tab_center,.add_tabs_container{border-top:1px solid #a0a5aa;margin:2em 2px 0 0;text-align:right;width:100%}.add_tabs_container .button.button-primary{margin-top:10px}._yikes_wc_add_tab_center{border-top:none;text-align:center}#_yikes_wc_apply_a_saved_tab,#add_another_tab{background:#cc99c2;border-color:#b366a4;color:#fff;text-decoration:none!important}.add_tabs_container._yikes_wc_add_tab_center_new .button.button-primary{display:none}#add_another_tab{-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);margin-bottom:10px;margin-top:10px}#_yikes_wc_apply_a_saved_tab{-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);margin:10px 0 0 8px}._yikes_wc_feedback_message{display:none;padding-left:3px}#yikes_woo_tab_error_message{color:red}#yikes_woo_tab_success_message{color:#31843f;margin-top:4px}.yikes_woo_how_to_h3{padding-left:10px;margin-top:0;font-weight:700}.yikes_woo_how_to_info,.yikes_woo_how_to_note{padding-left:23px!important}.yikes_woo_how_to_note{font-style:italic}.yikes-tabs-how-to-toggle-cursor{cursor:pointer}.yikes_woo_settings_info{font-family:"Open Sans",sans-serif}.yikes_woo_using_reusable_tab{opacity:.6;pointer-events:none}.lity-container{background:#fff;border-radius:6px;padding:.6em 1em 1em}.lity-container .lity-content::after{box-shadow:none}[class*=yikes_wc_lity_col]{float:left}.yikes_wc_lity_col_title{width:93%;padding:4px 20px 4px 2px;white-space:nowrap}.yikes_wc_lity_col_select{width:7%;padding-right:8px;padding-top:4px;cursor:pointer}.yikes_wc_lity_header{border-bottom:1px solid #555d66;margin-bottom:.4em;line-height:1;font-size:1.2em;font-weight:700;padding:0 0 8px;text-align:center;width:100%}.yikes_wc_lity_header>span{width:100px;text-align:center;white-space:nowrap}.display_saved_tabs_lity{min-width:300px}.yikes_woo_delete_this_tab{color:#0073aa;cursor:pointer}.yikes_woo_delete_this_tab:hover{color:#00a0d2}.yikes_woo_reusable_tab_title>input{width:100%}.yikes_woo_reusable_tab_content>label h3,.yikes_woo_reusable_tab_title>label h3{margin-bottom:6px}.yikes_woo_reusable_tab_content,.yikes_woo_reusable_tab_title{margin-bottom:20px}.wp-core-ui .button-secondary.yikes_woo_delete_this_tab{background:#e35b5b;border-color:#dc3232;box-shadow:0 1px 0 #dc3232;color:#fff;cursor:pointer}.yikes_woo_add_another_tab:hover>a{color:#fff}.yikes_woo_number_of_products{font-weight:700}.yikes_woo_save_and_delete_tab_buttons{margin-top:10px}._yikes_wc_title_red_overlay{background-color:#e68989!important}.woocommerce_options_panel p.yikes_wc_override_reusable_tab_container{line-height:1.1;margin-top:0;position:absolute;right:1em}.woocommerce_options_panel label._yikes_wc_override_reusable_tab_label{margin:2px 0 0 4px;float:none}@media screen and (max-width:1500px){#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel div.form-field-tinymce,#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field,#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field-tinymce{max-width:79%}.woocommerce_options_panel p.yikes_wc_override_reusable_tab_container{max-width:100px}}@media screen and (max-width:1300px){.button-holder{margin-top:8px;position:relative;right:auto;text-align:center;width:100%}.woocommerce_options_panel p.yikes_wc_move_tab,.yikes_wc_move_tab_container{display:inline-block}.move-tab-data-down,.move-tab-data-up{margin-top:-5px}.button-holder .button-secondary.remove_this_tab{margin-left:26px;margin-top:0}#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel div.form-field-tinymce,#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field,#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field-tinymce{max-width:100%}.woocommerce_options_panel p.yikes_wc_override_reusable_tab_container{margin-bottom:0;max-width:100%;position:relative}#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.yikes_woo_using_reusable_tab{margin-top:0}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/yikes-woo-tabs-font.css
CHANGED
@@ -1,28 +1,28 @@
|
|
1 |
-
@font-face {
|
2 |
-
font-family: 'yikes-woo-font';
|
3 |
-
src:url('./font/yikes-woo-font.eot?-394dt5');
|
4 |
-
src:url('./font/yikes-woo-font.eot?#iefix-394dt5') format('embedded-opentype'),
|
5 |
-
url('./font/yikes-woo-font.woff?-394dt5') format('woff'),
|
6 |
-
url('./font/yikes-woo-font.ttf?-394dt5') format('truetype'),
|
7 |
-
url('./font/yikes-woo-font.svg?-394dt5#yikes-woo-font') format('svg');
|
8 |
-
font-weight: normal;
|
9 |
-
font-style: normal;
|
10 |
-
}
|
11 |
-
|
12 |
-
[class^="yikes-woo-"], [class*=" yikes-woo-"] {
|
13 |
-
font-family: 'yikes-woo-font';
|
14 |
-
speak: none;
|
15 |
-
font-style: normal;
|
16 |
-
font-weight: normal;
|
17 |
-
font-variant: normal;
|
18 |
-
text-transform: none;
|
19 |
-
line-height: 1;
|
20 |
-
|
21 |
-
|
22 |
-
-webkit-font-smoothing: antialiased;
|
23 |
-
-moz-osx-font-smoothing: grayscale;
|
24 |
-
}
|
25 |
-
|
26 |
-
.yikes-woo-uniE600:before {
|
27 |
-
content: "\e600";
|
28 |
}
|
1 |
+
@font-face {
|
2 |
+
font-family: 'yikes-woo-font';
|
3 |
+
src:url('./font/yikes-woo-font.eot?-394dt5');
|
4 |
+
src:url('./font/yikes-woo-font.eot?#iefix-394dt5') format('embedded-opentype'),
|
5 |
+
url('./font/yikes-woo-font.woff?-394dt5') format('woff'),
|
6 |
+
url('./font/yikes-woo-font.ttf?-394dt5') format('truetype'),
|
7 |
+
url('./font/yikes-woo-font.svg?-394dt5#yikes-woo-font') format('svg');
|
8 |
+
font-weight: normal;
|
9 |
+
font-style: normal;
|
10 |
+
}
|
11 |
+
|
12 |
+
[class^="yikes-woo-"], [class*=" yikes-woo-"] {
|
13 |
+
font-family: 'yikes-woo-font';
|
14 |
+
speak: none;
|
15 |
+
font-style: normal;
|
16 |
+
font-weight: normal;
|
17 |
+
font-variant: normal;
|
18 |
+
text-transform: none;
|
19 |
+
line-height: 1;
|
20 |
+
|
21 |
+
/* Better Font Rendering =========== */
|
22 |
+
-webkit-font-smoothing: antialiased;
|
23 |
+
-moz-osx-font-smoothing: grayscale;
|
24 |
+
}
|
25 |
+
|
26 |
+
.yikes-woo-uniE600:before {
|
27 |
+
content: "\e600";
|
28 |
}
|
js/lity.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/*! Lity - v3.0.0-dev - 2016-11-04
|
2 |
+
* http://sorgalla.com/lity/
|
3 |
+
* Copyright (c) 2015-2016 Jan Sorgalla; Licensed MIT */
|
4 |
+
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return b(a,c)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=b(a,require("jquery")):a.lity=b(a,a.jQuery||a.Zepto)}("undefined"!=typeof window?window:this,function(a,b){"use strict";function c(a){var b=C();return O&&a.length?(a.one(O,b.resolve),setTimeout(b.resolve,500)):b.resolve(),b.promise()}function d(a,c,d){if(1===arguments.length)return b.extend({},a);if("string"==typeof c){if("undefined"==typeof d)return"undefined"==typeof a[c]?null:a[c];a[c]=d}else b.extend(a,c);return this}function e(a){var b=a.indexOf("?");b>-1&&(a=a.substr(b+1));for(var c,d=decodeURI(a.split("#")[0]).split("&"),e={},f=0,g=d.length;f<g;f++)d[f]&&(c=d[f].split("="),e[c[0]]=c[1]);return e}function f(a,c){if(!c)return a;if("string"===b.type(c)&&(c=e(c)),a.indexOf("?")>-1){var d=a.split("?");a=d.shift(),c=b.extend({},e(d[0]),c)}return a+"?"+b.param(c)}function g(a,b){var c=a.indexOf("#");return-1===c?b:(c>0&&(a=a.substr(c)),b+a)}function h(a,b,c,d){return b&&b.element().addClass("lity-iframe"),c&&(a=f(a,c)),d&&(a=g(d,a)),'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+a+'"/></div>'}function i(a){return b('<span class="lity-error"/>').append(a)}function j(a,c){var d=c.opener()&&c.opener().data("lity-desc")||"Image with no description",e=b('<img src="'+a+'" alt="'+d+'"/>'),f=C(),g=function(){f.reject(i("Failed loading image"))};return e.on("load",function(){return 0===this.naturalWidth?g():void f.resolve(e)}).on("error",g),f.promise()}function k(a,c){var d,e,f;try{d=b(a)}catch(a){return!1}return!!d.length&&(e=b('<i style="display:none !important"/>'),f=d.hasClass("lity-hide"),c.element().one("lity:remove",function(){e.before(d).remove(),f&&!d.closest(".lity-content").length&&d.addClass("lity-hide")}),d.removeClass("lity-hide").after(e))}function l(a,b){var c=K.exec(a);return!!c&&h("https://www.youtube"+(c[2]||"")+".com/embed/"+c[4]+"?autoplay=1",b,c[5],a)}function m(a,b){var c=L.exec(a);return!!c&&h("https://player.vimeo.com/video/"+c[3]+"?autoplay=1",b,c[4],a)}function n(a,b){var c=N.exec(a);return!!c&&(0!==a.indexOf("http")&&(a="https:"+a),h("https://www.facebook.com/plugins/video.php?href="+a+"&autoplay=1",b,c[4],a))}function o(a,b){var c=M.exec(a);return!!c&&h("https://www.google."+c[3]+"/maps?"+c[6],b,{output:c[6].indexOf("layer=c")>0?"svembed":"embed"},a)}function p(a,b){return h(a,b)}function q(){return A.documentElement.clientHeight?A.documentElement.clientHeight:Math.round(B.height())}function r(a){var b=w();b&&(27===a.keyCode&&b.close(),9===a.keyCode&&s(a,b))}function s(a,b){var c=b.element().find(H),d=c.index(A.activeElement);a.shiftKey&&d<=0?(c.get(c.length-1).focus(),a.preventDefault()):a.shiftKey||d!==c.length-1||(c.get(0).focus(),a.preventDefault())}function t(){b.each(E,function(a,b){b.resize()})}function u(a){1===E.unshift(a)&&(D.addClass("lity-active"),B.on({resize:t,keydown:r})),b("body > *").not(a.element()).addClass("lity-hidden").each(function(){var a=b(this);void 0===a.data(G)&&a.data(G,a.attr(F)||null)}).attr(F,"true")}function v(a){var c;a.element().attr(F,"true"),1===E.length&&(D.removeClass("lity-active"),B.off({resize:t,keydown:r})),E=b.grep(E,function(b){return a!==b}),c=E.length?E[0].element():b(".lity-hidden"),c.removeClass("lity-hidden").each(function(){var a=b(this),c=a.data(G);c?a.attr(F,c):a.removeAttr(F),a.removeData(G)})}function w(){return 0===E.length?null:E[0]}function x(a,c,d,e){var f,g="inline",h=b.extend({},d);return e&&h[e]?(f=h[e](a,c),g=e):(b.each(["inline","iframe"],function(a,b){delete h[b],h[b]=d[b]}),b.each(h,function(b,d){return!d||(!(!d.test||d.test(a,c))||(f=d(a,c),!1!==f?(g=b,!1):void 0))})),{handler:g,content:f||""}}function y(a,e,f,g){function h(a){k=b(a).css("max-height",q()+"px"),j.find(".lity-loader").each(function(){var a=b(this);c(a).always(function(){a.remove()})}),j.removeClass("lity-loading").find(".lity-content").empty().append(k),m=!0,k.trigger("lity:ready",[l])}var i,j,k,l=this,m=!1,n=!1;e=b.extend({},I,e),j=b(e.template),l.element=function(){return j},l.opener=function(){return f},l.content=function(){return k},l.options=b.proxy(d,l,e),l.handlers=b.proxy(d,l,e.handlers),l.resize=function(){m&&!n&&k.css("max-height",q()+"px").trigger("lity:resize",[l])},l.close=function(){if(m&&!n){n=!0,v(l);var a=C();return g&&b.contains(j[0],A.activeElement)&&g.focus(),k.trigger("lity:close",[l]),j.removeClass("lity-opened").addClass("lity-closed"),c(k.add(j)).always(function(){k.trigger("lity:remove",[l]),j.remove(),j=void 0,a.resolve()}),a.promise()}},i=x(a,l,e.handlers,e.handler),j.attr(F,"false").addClass("lity-loading lity-opened lity-"+i.handler).appendTo("body").focus().on("click","[data-lity-close]",function(a){b(a.target).is("[data-lity-close]")&&l.close()}).trigger("lity:open",[l]),u(l),b.when(i.content).always(h)}function z(a,c,d){a.preventDefault?(a.preventDefault(),d=b(this),a=d.data("lity-target")||d.attr("href")||d.attr("src")):d=b(d);var e=new y(a,b.extend({},d.data("lity-options")||d.data("lity"),c),d,A.activeElement);if(!a.preventDefault)return e}var A=a.document,B=b(a),C=b.Deferred,D=b("html"),E=[],F="aria-hidden",G="lity-"+F,H='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',I={handler:null,handlers:{image:j,inline:k,youtube:l,vimeo:m,googlemaps:o,facebookvideo:n,iframe:p},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>×</button></div></div></div>'},J=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,K=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,L=/(vimeo(pro)?\.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,M=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,N=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,O=function(){var a=A.createElement("div"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return b[c];return!1}();return j.test=function(a){return J.test(a)},z.version="3.0.0-dev",z.options=b.proxy(d,z,I),z.handlers=b.proxy(d,z,I.handlers),z.current=w,z.iframe=h,b(A).on("click.lity","[data-lity]",z),z});
|
js/repeatable-custom-tabs-settings.js
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery for repeatable woo commerce tabs (on settings page)
|
3 |
+
* somewhat cool / very cool
|
4 |
+
* YIKES Inc. / Kevin Utz
|
5 |
+
*/
|
6 |
+
jQuery(document).ready(function() {
|
7 |
+
|
8 |
+
// Save a tab
|
9 |
+
jQuery( '.yikes_woo_save_this_tab' ).click( function() {
|
10 |
+
var tab_id = jQuery( this ).data( 'tab-id' );
|
11 |
+
|
12 |
+
yikes_woo_handle_saving_reusable_tab( tab_id );
|
13 |
+
});
|
14 |
+
|
15 |
+
// Delete a saved tab
|
16 |
+
jQuery( '.yikes_woo_delete_this_tab' ).click( function() {
|
17 |
+
|
18 |
+
// Confirm: Are you sure?
|
19 |
+
var continue_delete = confirm( 'Are you sure you want to delete this tab?' );
|
20 |
+
|
21 |
+
if ( continue_delete === false ) {
|
22 |
+
return;
|
23 |
+
}
|
24 |
+
|
25 |
+
// Store the tab_id
|
26 |
+
var tab_id = jQuery( this ).data( 'tab-id' );
|
27 |
+
|
28 |
+
if ( jQuery( this ).hasClass( 'yikes_woo_delete_this_tab_single' ) ) {
|
29 |
+
|
30 |
+
// If we're on the single page and trying to delete a new tab, then just redirect!
|
31 |
+
if ( tab_id === 'new' ) {
|
32 |
+
location.href = repeatable_custom_tabs_settings.tab_list_page_url;
|
33 |
+
}
|
34 |
+
yikes_woo_handle_deleting_reusable_tab( tab_id, 'single' );
|
35 |
+
} else {
|
36 |
+
yikes_woo_handle_deleting_reusable_tab( tab_id, false );
|
37 |
+
}
|
38 |
+
});
|
39 |
+
|
40 |
+
// Handle bulk actions
|
41 |
+
jQuery( '.yikes_woo_handle_bulk_action' ).click( function() {
|
42 |
+
|
43 |
+
// Currently only supporting 'delete' bulk action, so make sure that is the value of the dropdown
|
44 |
+
if ( jQuery( '#bulk-action-selector-top' ).val() !== 'delete' ) {
|
45 |
+
return;
|
46 |
+
}
|
47 |
+
|
48 |
+
// Set up an array of IDs to delete
|
49 |
+
var tab_ids_to_delete = [];
|
50 |
+
|
51 |
+
// Loop through all of the rows and check if checkbox is checked
|
52 |
+
jQuery( '.entry-bulk-action-checkbox' ).each( function() {
|
53 |
+
if ( jQuery( this ).is( ':checked' ) === true ) {
|
54 |
+
|
55 |
+
// Add tab_id to array
|
56 |
+
tab_ids_to_delete.push( jQuery( this ).val() );
|
57 |
+
|
58 |
+
// Add class to the row (we will target this class later to remove all rows)
|
59 |
+
jQuery( this ).parents( 'th' ).parents( '.yikes_woo_saved_tabs_row' ).addClass( 'yikes_woo_bulk_delete_this_row' );
|
60 |
+
}
|
61 |
+
});
|
62 |
+
|
63 |
+
// delete the tabs!
|
64 |
+
yikes_woo_handle_deleting_reusable_tab( tab_ids_to_delete, 'bulk' );
|
65 |
+
|
66 |
+
});
|
67 |
+
|
68 |
+
}); // End document.ready
|
69 |
+
|
70 |
+
/**
|
71 |
+
* @summary Save a tab for re-use
|
72 |
+
*
|
73 |
+
* @since 1.5
|
74 |
+
*
|
75 |
+
* @param mixed | tab_id | the uniquely identifying suffix of the current tab ('new' for new tabs)
|
76 |
+
*
|
77 |
+
*/
|
78 |
+
function yikes_woo_handle_saving_reusable_tab( tab_id ) {
|
79 |
+
|
80 |
+
var tab_title = jQuery( '#yikes_woo_reusable_tab_title_' + tab_id ).val();
|
81 |
+
var tab_content = '';
|
82 |
+
|
83 |
+
if ( typeof( tinymce ) != 'undefined' && jQuery( '#wp-yikes_woo_reusable_tab_content_' + tab_id + '-wrap' ).hasClass( 'tmce-active' ) ) {
|
84 |
+
tab_content = tinymce.get( 'yikes_woo_reusable_tab_content_' + tab_id ).getContent();
|
85 |
+
} else {
|
86 |
+
tab_content = jQuery( '#yikes_woo_reusable_tab_content_' + tab_id ).val();
|
87 |
+
}
|
88 |
+
|
89 |
+
//If no tab_title || tab_content, show error message
|
90 |
+
if ( tab_title.length === 0 ) {
|
91 |
+
yikes_woo_display_feedback_messages( '#yikes_woo_delete_this_tab_' + tab_id, 'yikes_woo_tab_error_message', 'Please fill out the tab title before saving.', {} );
|
92 |
+
return;
|
93 |
+
}
|
94 |
+
if ( tab_content.length === 0 ) {
|
95 |
+
yikes_woo_display_feedback_messages( '#yikes_woo_delete_this_tab_' + tab_id, 'yikes_woo_tab_error_message', 'Please fill out the tab content before saving.', {} );
|
96 |
+
return;
|
97 |
+
}
|
98 |
+
|
99 |
+
// Create data object
|
100 |
+
var data = {
|
101 |
+
'action': 'yikes_woo_save_tab_as_reusable',
|
102 |
+
'tab_title': tab_title,
|
103 |
+
'tab_content': tab_content,
|
104 |
+
'tab_id': tab_id,
|
105 |
+
'security_nonce': repeatable_custom_tabs_settings.save_tab_as_reusable_nonce
|
106 |
+
};
|
107 |
+
|
108 |
+
// AJAX
|
109 |
+
jQuery.post( repeatable_custom_tabs_settings.ajaxurl, data, function( response ) {
|
110 |
+
if ( typeof( response.success ) !== 'undefined' && response.success === true ) {
|
111 |
+
|
112 |
+
// If redirect var is set, redirect!
|
113 |
+
if ( typeof( response.data ) !== 'undefined' && typeof( response.data.redirect ) !== 'undefined'
|
114 |
+
&& response.data.redirect === true && typeof( response.data.redirect_url !== 'undefined' ) ) {
|
115 |
+
location.href = response.data.redirect_url;
|
116 |
+
} else {
|
117 |
+
yikes_woo_display_feedback_messages( '#yikes_woo_delete_this_tab_' + tab_id, 'yikes_woo_tab_success_message', 'Tab saved successfully.', {} );
|
118 |
+
}
|
119 |
+
|
120 |
+
jQuery( '#yikes_woo_tab_title_header' ).text( tab_title );
|
121 |
+
} else {
|
122 |
+
if ( typeof( response.data ) !== 'undefined' && typeof( response.data.message ) !== 'undefined' ) {
|
123 |
+
yikes_woo_display_feedback_messages( '#yikes_woo_delete_this_tab_' + tab_id, 'yikes_woo_tab_error_message', response.data.message, {} );
|
124 |
+
} else {
|
125 |
+
|
126 |
+
// Ok, not sure what went wrong. Let's log it.
|
127 |
+
console.log( response );
|
128 |
+
}
|
129 |
+
}
|
130 |
+
});
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* @summary Delete a saved tab
|
135 |
+
*
|
136 |
+
* @since 1.5
|
137 |
+
*
|
138 |
+
* @param int | tab_id | the tab's unique ID in the database
|
139 |
+
* @param string | delete_method | a string signifying what to do after deleting tabs
|
140 |
+
*
|
141 |
+
*/
|
142 |
+
function yikes_woo_handle_deleting_reusable_tab( tab_id, delete_method ) {
|
143 |
+
|
144 |
+
// Create data object
|
145 |
+
var data = {
|
146 |
+
action: 'yikes_woo_delete_reusable_tab_handler',
|
147 |
+
tab_id: tab_id,
|
148 |
+
security_nonce: repeatable_custom_tabs_settings.delete_reusable_tab_nonce
|
149 |
+
}
|
150 |
+
|
151 |
+
// AJAX
|
152 |
+
jQuery.post( repeatable_custom_tabs_settings.ajaxurl, data, function( response ) {
|
153 |
+
if ( response.success ) {
|
154 |
+
|
155 |
+
if ( delete_method === 'bulk' ) {
|
156 |
+
|
157 |
+
// fadeOut and remove all of the rows at once
|
158 |
+
jQuery( '.yikes_woo_bulk_delete_this_row' ).fadeOut( '600', function() {
|
159 |
+
jQuery( '.yikes_woo_bulk_delete_this_row' ).remove();
|
160 |
+
});
|
161 |
+
} else if ( delete_method === 'single' ) {
|
162 |
+
|
163 |
+
// If we have a redirect URL, redirect back to tab list
|
164 |
+
if ( typeof( response.data ) !== 'undefined' && typeof( response.data.redirect_url ) !== 'undefined' ) {
|
165 |
+
location.href = response.data.redirect_url;
|
166 |
+
}
|
167 |
+
} else {
|
168 |
+
|
169 |
+
// Remove the tab container
|
170 |
+
jQuery( '#yikes_woo_saved_tabs_row_' + tab_id ).fadeOut( '600', function() {
|
171 |
+
jQuery( '#yikes_woo_saved_tabs_row_' + tab_id ).remove();
|
172 |
+
|
173 |
+
// Display our delete-success message
|
174 |
+
jQuery( '#yikes_woo_delete_success_message' ).show();
|
175 |
+
});
|
176 |
+
}
|
177 |
+
} else {
|
178 |
+
|
179 |
+
// Ok, not sure what went wrong. Let's log it.
|
180 |
+
console.log( response );
|
181 |
+
}
|
182 |
+
});
|
183 |
+
}
|
js/repeatable-custom-tabs-settings.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
function yikes_woo_handle_saving_reusable_tab(a){var b=jQuery("#yikes_woo_reusable_tab_title_"+a).val(),c="";if(c="undefined"!=typeof tinymce&&jQuery("#wp-yikes_woo_reusable_tab_content_"+a+"-wrap").hasClass("tmce-active")?tinymce.get("yikes_woo_reusable_tab_content_"+a).getContent():jQuery("#yikes_woo_reusable_tab_content_"+a).val(),0===b.length)return void yikes_woo_display_feedback_messages("#yikes_woo_delete_this_tab_"+a,"yikes_woo_tab_error_message","Please fill out the tab title before saving.",{});if(0===c.length)return void yikes_woo_display_feedback_messages("#yikes_woo_delete_this_tab_"+a,"yikes_woo_tab_error_message","Please fill out the tab content before saving.",{});var d={action:"yikes_woo_save_tab_as_reusable",tab_title:b,tab_content:c,tab_id:a,security_nonce:repeatable_custom_tabs_settings.save_tab_as_reusable_nonce};jQuery.post(repeatable_custom_tabs_settings.ajaxurl,d,function(c){"undefined"!=typeof c.success&&c.success===!0?("undefined"==typeof c.data||"undefined"==typeof c.data.redirect||c.data.redirect!==!0||("undefined"!==c.data.redirect_url,0)?yikes_woo_display_feedback_messages("#yikes_woo_delete_this_tab_"+a,"yikes_woo_tab_success_message","Tab saved successfully.",{}):location.href=c.data.redirect_url,jQuery("#yikes_woo_tab_title_header").text(b)):"undefined"!=typeof c.data&&"undefined"!=typeof c.data.message?yikes_woo_display_feedback_messages("#yikes_woo_delete_this_tab_"+a,"yikes_woo_tab_error_message",c.data.message,{}):console.log(c)})}function yikes_woo_handle_deleting_reusable_tab(a,b){var c={action:"yikes_woo_delete_reusable_tab_handler",tab_id:a,security_nonce:repeatable_custom_tabs_settings.delete_reusable_tab_nonce};jQuery.post(repeatable_custom_tabs_settings.ajaxurl,c,function(c){c.success?"bulk"===b?jQuery(".yikes_woo_bulk_delete_this_row").fadeOut("600",function(){jQuery(".yikes_woo_bulk_delete_this_row").remove()}):"single"===b?"undefined"!=typeof c.data&&"undefined"!=typeof c.data.redirect_url&&(location.href=c.data.redirect_url):jQuery("#yikes_woo_saved_tabs_row_"+a).fadeOut("600",function(){jQuery("#yikes_woo_saved_tabs_row_"+a).remove(),jQuery("#yikes_woo_delete_success_message").show()}):console.log(c)})}jQuery(document).ready(function(){jQuery(".yikes_woo_save_this_tab").click(function(){var a=jQuery(this).data("tab-id");yikes_woo_handle_saving_reusable_tab(a)}),jQuery(".yikes_woo_delete_this_tab").click(function(){var a=confirm("Are you sure you want to delete this tab?");if(a!==!1){var b=jQuery(this).data("tab-id");jQuery(this).hasClass("yikes_woo_delete_this_tab_single")?("new"===b&&(location.href=repeatable_custom_tabs_settings.tab_list_page_url),yikes_woo_handle_deleting_reusable_tab(b,"single")):yikes_woo_handle_deleting_reusable_tab(b,!1)}}),jQuery(".yikes_woo_handle_bulk_action").click(function(){if("delete"===jQuery("#bulk-action-selector-top").val()){var a=[];jQuery(".entry-bulk-action-checkbox").each(function(){jQuery(this).is(":checked")===!0&&(a.push(jQuery(this).val()),jQuery(this).parents("th").parents(".yikes_woo_saved_tabs_row").addClass("yikes_woo_bulk_delete_this_row"))}),yikes_woo_handle_deleting_reusable_tab(a,"bulk")}})});
|
js/repeatable-custom-tabs-shared.js
ADDED
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|