Custom Product Tabs for WooCommerce - Version 1.0

Version Description

Download this release

Release Info

Developer liljimmi
Plugin Icon 128x128 Custom Product Tabs for WooCommerce
Version 1.0
Comparing to
See all releases

Version 1.0

LICENSE ADDED
@@ -0,0 +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
+
css/font/yikes-woo-font.eot ADDED
Binary file
css/font/yikes-woo-font.svg ADDED
@@ -0,0 +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="&#x20;" d="" horiz-adv-x="512" />
10
+ <glyph unicode="&#xe600;" 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/font/yikes-woo-font.ttf ADDED
Binary file
css/font/yikes-woo-font.woff ADDED
Binary file
css/repeatable-custom-tabs.css ADDED
@@ -0,0 +1 @@
 
1
+ .yikes_woo_tabs_title_field {
css/repeatable-custom-tabs.min.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
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-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"}
css/yikes-woo-tabs-font.css ADDED
@@ -0,0 +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
+ /* 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
+ }
i18n/languages/yikes-inc-woocommerce-repeatable-custom-product-tabs.pot ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2014 YIKES Inc.
2
+ # This file is distributed under the GNU General Public License v3.0.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Yikes Inc. WooCommerce Custom Repeatable Product Tabs "
6
+ "Lite 1.0\n"
7
+ "Report-Msgid-Bugs-To: https://www.yikesinc.comPOT-Creation-Date: 2014-09-05 "
8
+ "04:31:12+00:00\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2014-10-17 13:55-0500\n"
13
+ "Last-Translator: Evan <Evan@yikesinc.com>\n"
14
+ "Language-Team: YIKES Inc. <tech@yikesinc.com>\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+ "Language: en\n"
17
+ "X-Generator: Poedit 1.6.6\n"
18
+ "X-Poedit-Basepath: ./\n"
19
+ "POT-Creation-Date: \n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+
22
+ #: build/yikes-inc-woocommerce-custom-product-tabs.php:168
23
+ #: yikes-inc-woocommerce-custom-product-tabs.php:168
24
+ msgid "Custom Tab"
25
+ msgstr ""
26
+
27
+ #: build/yikes-inc-woocommerce-custom-product-tabs.php:197
28
+ #: yikes-inc-woocommerce-custom-product-tabs.php:197
29
+ msgid "Tab Title"
30
+ msgstr ""
31
+
32
+ #: build/yikes-inc-woocommerce-custom-product-tabs.php:197
33
+ #: yikes-inc-woocommerce-custom-product-tabs.php:197
34
+ msgid "Required for tab to be visible"
35
+ msgstr ""
36
+
37
+ #: build/yikes-inc-woocommerce-custom-product-tabs.php:198
38
+ #: yikes-inc-woocommerce-custom-product-tabs.php:198
39
+ msgid "Content"
40
+ msgstr ""
41
+
42
+ #: build/yikes-inc-woocommerce-custom-product-tabs.php:198
43
+ #: yikes-inc-woocommerce-custom-product-tabs.php:198
44
+ msgid "HTML and text to display."
45
+ msgstr ""
46
+
47
+ #. Plugin Name of the plugin/theme
48
+ msgid "YIKES Inc Woocommerce Repeatable Custom Product Tabs"
49
+ msgstr ""
50
+
51
+ #. Plugin URI of the plugin/theme
52
+ msgid "http://www.yikesinc.comtabs/"
53
+ msgstr ""
54
+
55
+ #. Description of the plugin/theme
56
+ msgid ""
57
+ "Extends WooCommerce to add unlimited repeatable custom product tabs to the "
58
+ "product page"
59
+ msgstr ""
60
+
61
+ #. Author of the plugin/theme
62
+ msgid "YIKES Inc. , Evan Herman"
63
+ msgstr ""
64
+
65
+ #. Author URI of the plugin/theme
66
+ msgid "http://www.yikesinc.co"
67
+ msgstr ""
images/yikes_logo.png ADDED
Binary file
js/repeatable-custom-tabs.js ADDED
@@ -0,0 +1 @@
 
1
+ /*
js/repeatable-custom-tabs.min.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Minified Script for YIKES Inc. Easy WooCommerce Repeatable Product Tabs
3
+ *
4
+ * @ Compiled By: Yikes Inc.
5
+ * @ http://www.YIKESinc.com
6
+ *
7
+ */
8
+ jQuery(document).ready(function(){jQuery("#add_another_tab").on("click",function(e){var t=jQuery("#duplicate_this_row");var n=jQuery("#number_of_tabs").val();var r=parseInt(jQuery("#number_of_tabs").val())+parseInt(1);var i=jQuery("#duplicate_this_row .remove_this_tab");var s=jQuery("#duplicate_this_row .button-holder");t.children("p").each(function(){jQuery(this).clone().insertBefore("#duplicate_this_row").removeClass("hidden_duplicator_row_title_field").removeClass("hidden_duplicator_row_content_field").addClass("new_duplicate_row")}).promise().done(function(){jQuery(".new_duplicate_row").find("input").each(function(){if(jQuery(this).is('input[name="hidden_duplicator_row_title"]')){jQuery(this).attr("name","_yikes_wc_custom_repeatable_product_tabs_tab_title_"+r).attr("id","_yikes_wc_custom_repeatable_product_tabs_tab_title_"+r).parents("p").addClass("_yikes_wc_custom_repeatable_product_tabs_tab_title_"+r+"_field").removeClass("hidden_duplicator_row_title_field").find("label").removeAttr("for").attr("for","_yikes_wc_custom_repeatable_product_tabs_tab_title_"+r+"_field")}});jQuery(".new_duplicate_row").find("textarea").each(function(){if(jQuery(this).is('textarea[name="hidden_duplicator_row_content"]')){jQuery(this).attr("name","_yikes_wc_custom_repeatable_product_tabs_tab_content_"+r).attr("id","_yikes_wc_custom_repeatable_product_tabs_tab_content_"+r).parents("p").addClass("_yikes_wc_custom_repeatable_product_tabs_tab_content_"+r+"_field").removeClass("hidden_duplicator_row_content_field").find("label").removeAttr("for").attr("for","_yikes_wc_custom_repeatable_product_tabs_tab_content_"+r+"_field")}});jQuery("#number_of_tabs").val(r);jQuery(".new_duplicate_row").first().before('<div class="yikes-woo-custom-tab-divider"></div>')});s.clone().insertAfter(jQuery(".yikes-woo-custom-tab-divider").last()).addClass("last-button-holder");i.clone().prependTo(".last-button-holder").removeAttr("style");jQuery(".last-button-holder").removeAttr("alt").attr("alt",r);setTimeout(function(){jQuery(".last-button-holder").removeClass("last-button-holder");jQuery(".new_duplicate_row").removeClass("new_duplicate_row")},100);e.preventDefault()});jQuery("body").on("click",".remove_this_tab",function(e){var t=jQuery(this);var n=jQuery(this).parents(".button-holder").next();var r=jQuery(this).parents(".button-holder").next().next();var i=jQuery(this).parents(".button-holder").prev();var s=jQuery("#number_of_tabs").val();var o=parseInt(jQuery("#number_of_tabs").val())-parseInt(1);n.remove();r.remove();i.remove();t.parents(".button-holder").remove();setTimeout(function(){jQuery(".last-button-holder").removeClass("last-button-holder");jQuery(".new_duplicate_row").removeClass("new_duplicate_row")},100);var u=1;jQuery(".yikes_woo_tabs_title_field").each(function(){jQuery(this).removeAttr("name").attr("name","_yikes_wc_custom_repeatable_product_tabs_tab_title_"+u).removeAttr("id").attr("id","_yikes_wc_custom_repeatable_product_tabs_tab_title_"+u);jQuery(this).prev().removeAttr("for").attr("for","_yikes_wc_custom_repeatable_product_tabs_tab_title_"+u);jQuery(this).parent("p").removeAttr("for").attr("for","form-field _yikes_wc_custom_repeatable_product_tabs_tab_title_"+u+"_field");jQuery(this).parent("p").removeAttr("class").attr("class","form-field _yikes_wc_custom_repeatable_product_tabs_tab_title_"+u+"_field");u++});var a=1;jQuery(".yikes_woo_tabs_content_field").each(function(){jQuery(this).removeAttr("name").attr("name","_yikes_wc_custom_repeatable_product_tabs_tab_content_"+a).removeAttr("id").attr("id","_yikes_wc_custom_repeatable_product_tabs_tab_content_"+a);jQuery(this).prev().removeAttr("for").attr("for","_yikes_wc_custom_repeatable_product_tabs_tab_content_"+a);jQuery(this).parent("p").removeAttr("class").attr("class","form-field _yikes_wc_custom_repeatable_product_tabs_tab_content_"+a);a++});var f=1;jQuery(".button-holder").each(function(){jQuery(this).removeAttr("alt").attr("alt",f);f++});jQuery("#number_of_tabs").val(o);e.preventDefault()});jQuery(".yikes-tabs-how-to-toggle").on("click",function(e){jQuery(".yikes-woo-tabs-hidden-how-to-info").slideToggle("fast")});jQuery("body").on("click",".move-tab-data-up",function(e){var t=jQuery(this);var n=t.parents(".button-holder").attr("alt");var r=jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+n+'"]').val();var i=jQuery('textarea[name="_yikes_wc_custom_repeatable_product_tabs_tab_content_'+n+'"]').val();if(n==1){return false}else{var s=parseInt(n)-parseInt(1);var o=jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+s+'"]').val();var u=jQuery('textarea[name="_yikes_wc_custom_repeatable_product_tabs_tab_content_'+s+'"]').val();jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+n+'"]').val(o);jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+s+'"]').val(r);jQuery('textarea[name="_yikes_wc_custom_repeatable_product_tabs_tab_content_'+n+'"]').val(u);jQuery('textarea[name="_yikes_wc_custom_repeatable_product_tabs_tab_content_'+s+'"]').val(i)}});jQuery("body").on("click",".move-tab-data-down",function(e){var t=jQuery("#number_of_tabs").val();var n=jQuery(this);var r=n.parents(".button-holder").attr("alt");var i=jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+r+'"]').val();var s=jQuery('textarea[name="_yikes_wc_custom_repeatable_product_tabs_tab_content_'+r+'"]').val();if(r==t){return false}else{var o=parseInt(r)+parseInt(1);var u=jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+o+'"]').val();var a=jQuery('textarea[name="_yikes_wc_custom_repeatable_product_tabs_tab_content_'+o+'"]').val();jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+r+'"]').val(u);jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+o+'"]').val(i);jQuery('textarea[name="_yikes_wc_custom_repeatable_product_tabs_tab_content_'+r+'"]').val(a);jQuery('textarea[name="_yikes_wc_custom_repeatable_product_tabs_tab_content_'+o+'"]').val(s)}})})
readme.txt ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Easy Custom WooCommerce Product Tabs ===
2
+ Contributors: yikesinc, eherman24, liljimmi
3
+ Donate link: http://yikesinc.com
4
+ Tags: woocommerce, product tabs, repeatable, duplicate, customize, custom, tabs, product, woo, commerce
5
+ Requires at least: 3.8
6
+ Tested up to: 4.1
7
+ Requires WooCommerce at least: 2.0
8
+ Tested WooCommerce up to: 2.2.10
9
+ Stable tag: 1.0
10
+ License: GPLv2 or later
11
+
12
+ This plugin extends WooCommerce to allow site admins to add custom tabs to products.
13
+
14
+ == Description ==
15
+
16
+ This plugin extends the [WooCommerce](www.woothemes.com/woocommerce/) eCommerce plugin to allow site admins to add custom tabs to products.
17
+
18
+ Tabs are managed on the Edit Product screen and can be added on a per product basis. Tabs can be easily added, deleted and rearranged.
19
+
20
+ Tab content areas may contain text, html or shortcodes.
21
+
22
+ If you experience any problems, please submit a New Issue on our [Github Issue Tracker](https://github.com/yikesinc/yikes-inc-easy-custom-woocommerce-product-tabs/issues) and we'll look in to it as soon as possible.
23
+
24
+ == Installation ==
25
+
26
+ 1. Upload the entire 'yikes-inc-custom-repeatable-woo-product-tabs' folder to the '/wp-content/plugins/' directory
27
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
28
+ 3. Edit a product, then click on 'Custom Tab' within the 'Product Data' panel
29
+
30
+ == Screenshots ==
31
+
32
+ 1. Custom Tabs manager on the Edit Product screen
33
+ 2. The custom tabs displayed on the frontend
34
+
35
+ == Frequently Asked Questions ==
36
+
37
+ = Where do I go to add tabs to a product? =
38
+ When editing a product in WoCommerce, you will find "Custom Tabs" in the bottom left corner of the Product Data box. Click on "Custom Tabs" to reveal the custom tab manager.
39
+
40
+ = Where will these tabs appear? =
41
+ When the product is viewed on your website you will see the tabs you created to the right of the default "Description" tab.
42
+
43
+ = I added tabs, but they didn't appear on the front-end of the site. What's up? =
44
+ Make sure you hit the Product's main Update button to save all the edits you made to custom tabs or they will not be saved.
45
+
46
+ = How do I change the order of the tabs? =
47
+ To change the order of the custom tabs use the up and down arrows to the right of the Tab Title.
48
+
49
+
50
+ == Changelog ==
51
+
52
+ = 1.0.0 =
53
+ * Initial Release
yikes-inc-easy-custom-woocommerce-product-tabs.php ADDED
@@ -0,0 +1,448 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: Easy Custom WooCommerce Product Tabs
4
+ * Plugin URI: http://www.yikesinc.com
5
+ * Description: Extend WooCommerce to add and manage custom product tabs. Create as many product tabs as needed per product.
6
+ * Author: YIKES Inc
7
+ * Author URI: http://www.yikesinc.com
8
+ * Version: 1.0
9
+ * Tested up to: 4.1
10
+ * Text Domain: yikes-inc-woocommerce-custom-product-tabs
11
+ * Domain Path: /i18n/languages/
12
+ *
13
+ * Copyright: (c) 2014-2015 YIKES Inc.
14
+ *
15
+ * License: GNU General Public License v3.0
16
+ * License URI: http://www.gnu.org/licenses/gpl-3.0.html
17
+ *
18
+ */
19
+
20
+ // Exit if accessed directly
21
+ if ( ! defined( 'ABSPATH' ) ) exit;
22
+
23
+ // must include plugin.php to use is_plugin_active()
24
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
25
+ if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
26
+ /**
27
+ * The YikesWooCommerceCustomProductTabs global object
28
+ * @name $yikes_woocommerce_custom_product_tabs
29
+ * @global YikesWooCommerceCustomProductTabs $GLOBALS['yikes_woocommerce_custom_product_tabs']
30
+ */
31
+ $GLOBALS['yikes_woocommerce_custom_product_tabs'] = new YikesWooCommerceCustomProductTabs();
32
+ } else {
33
+ /* Deactivate the plugin, and display our error notification */
34
+ deactivate_plugins( '/yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php' );
35
+ add_action( 'admin_notices' , 'display_admin_notice_error' );
36
+ }
37
+
38
+ /**
39
+ * display_admin_notice_error()
40
+ * Display our error admin notice if WooCommerce is not installed+active
41
+ */
42
+ function display_admin_notice_error() {
43
+ ?>
44
+ <!-- hide the 'Plugin Activated' default message -->
45
+ <style>
46
+ #message.updated {
47
+ display: none;
48
+ }
49
+ </style>
50
+ <!-- display our error message -->
51
+ <div class="error">
52
+ <p><?php _e( 'Easy Custom WooCommerce Product Tabs could not be activated because WooCommerce is not installed and active.', 'yikes-inc-woocommerce-custom-product-tabs' ); ?></p>
53
+ <p><?php _e( 'Please install and activate ', 'yikes-inc-woocommerce-custom-product-tabs' ); ?><a href="https://wordpress.org/plugins/woocommerce/" title="WooCommerce">WooCommerce</a><?php _e( ' before activating the plugin.', 'yikes-inc-woocommerce-custom-product-tabs' ); ?></p>
54
+ </div>
55
+ <?php
56
+ }
57
+
58
+ /**
59
+ * Initialize the Custom Product Tab Class
60
+ */
61
+ class YikesWooCommerceCustomProductTabs {
62
+
63
+ private $tab_data = false;
64
+
65
+ /** plugin version number */
66
+ const VERSION = "1.0";
67
+
68
+ /** plugin text domain */
69
+ const TEXT_DOMAIN = 'yikes-inc-woocommerce-custom-product-tabs';
70
+
71
+ /** plugin version name */
72
+ const VERSION_OPTION_NAME = 'yikes_woocommerce_custom_product_tabs_db_version';
73
+
74
+ /**
75
+ * Gets things started by adding an action to initialize this plugin once
76
+ * WooCommerce is known to be active and initialized
77
+ */
78
+ public function __construct() {
79
+ // Installation
80
+ if ( is_admin() && ! defined( 'DOING_AJAX' ) ) $this->install();
81
+
82
+ add_action( 'init', array( $this, 'load_translation' ) );
83
+ add_action( 'woocommerce_init', array( $this, 'init' ) );
84
+ }
85
+
86
+
87
+ /**
88
+ * Init WooCommerce PDF Product Vouchers when WordPress initializes
89
+ *
90
+ * @since 1.2.5
91
+ */
92
+ public function load_translation() {
93
+ // localization
94
+ load_plugin_textdomain( 'yikes-inc-woocommerce-custom-product-tabs', false, dirname( plugin_basename( __FILE__ ) ) . '/i18n/languages' );
95
+ }
96
+
97
+
98
+ /**
99
+ * Init WooCommerce Product Tabs Lite extension once we know WooCommerce is active
100
+ */
101
+ public function init() {
102
+ // backend stuff
103
+ add_action( 'woocommerce_product_write_panel_tabs', array( $this, 'render_custom_product_tabs' ) );
104
+ add_action( 'woocommerce_product_write_panels', array( $this, 'product_page_yikes_custom_tabs_panel' ) );
105
+ add_action( 'woocommerce_process_product_meta', array( $this, 'product_save_data' ), 10, 2 );
106
+
107
+ // frontend stuff
108
+ add_filter( 'woocommerce_product_tabs', array( $this, 'add_custom_product_tabs' ) );
109
+
110
+ // allow the use of shortcodes within the tab content
111
+ add_filter( 'yikes_woocommerce_custom_repeatable_product_tabs_content', 'do_shortcode' );
112
+
113
+ // enqueue our custom js file, for repeatable tabs
114
+ add_action( 'admin_enqueue_scripts' , array( &$this , 'enqueue_repeatable_tab_script' ) );
115
+
116
+ }
117
+
118
+
119
+ /** Frontend methods ******************************************************/
120
+ public function enqueue_repeatable_tab_script( $hook ) {
121
+ global $post;
122
+ if ( $hook == 'post-new.php' || $hook == 'post.php' ) {
123
+ if ( $post->post_type == 'product' ) {
124
+ // script
125
+ wp_register_script( 'repeatable-custom-tabs' , plugin_dir_url(__FILE__) . 'js/repeatable-custom-tabs.min.js' , array('jquery') , 'all' );
126
+ wp_enqueue_script( 'repeatable-custom-tabs' );
127
+ // styles + font
128
+ wp_register_style( 'repeatable-custom-tabs-styles' , plugin_dir_url(__FILE__) . 'css/repeatable-custom-tabs.min.css' , '' , 'all' );
129
+ wp_enqueue_style( 'repeatable-custom-tabs-styles' );
130
+ // font
131
+ // wp_register_style( 'yikes-woo-tabs-font' , plugin_dir_url(__FILE__) . 'css/yikes-woo-tabs-font.css' , '' , 'all' );
132
+ // wp_enqueue_style( 'yikes-woo-tabs-font' );
133
+ }
134
+ }
135
+ }
136
+
137
+ /**
138
+ * Add the custom product tab
139
+ *
140
+ * $tabs structure:
141
+ * Array(
142
+ * id => Array(
143
+ * 'title' => (string) Tab title,
144
+ * 'priority' => (string) Tab priority,
145
+ * 'callback' => (mixed) callback function,
146
+ * )
147
+ * )
148
+ *
149
+ * @since 1.2.0
150
+ * @param array $tabs array representing the product tabs
151
+ * @return array representing the product tabs
152
+ */
153
+ public function add_custom_product_tabs( $tabs ) {
154
+ global $product;
155
+ if ( get_post_meta( $product->id , 'yikes_woo_products_tabs' , true ) ) {
156
+ $this->tab_data = get_post_meta( $product->id , 'yikes_woo_products_tabs' , true );
157
+ $i = 25; // setup priorty to loop over, andrender tabs in proper order
158
+ foreach ( $this->tab_data as $tab ) {
159
+ $tabs[ $tab['id'] ] = array(
160
+ 'title' => __( $tab['title'], self::TEXT_DOMAIN ),
161
+ 'priority' => $i++,
162
+ 'callback' => array( $this, 'custom_product_tabs_panel_content' ),
163
+ 'content' => $tab['content'], // custom field
164
+ );
165
+ }
166
+ if ( isset( $tabs['reviews'] ) ) {
167
+ $tabs['reviews']['priority'] = $i; // make sure the reviews tab remains on the end (if it is set)
168
+ }
169
+ }
170
+ return $tabs;
171
+ }
172
+
173
+
174
+ /**
175
+ * Render the custom product tab panel content for the given $tab
176
+ *
177
+ * $tab structure:
178
+ * Array(
179
+ * 'title' => (string) Tab title,
180
+ * 'priority' => (string) Tab priority,
181
+ * 'callback' => (mixed) callback function,
182
+ * 'id' => (int) tab post identifier,
183
+ * 'content' => (sring) tab content,
184
+ * )
185
+ *
186
+ **/
187
+ public function custom_product_tabs_panel_content( $key, $tab ) {
188
+
189
+ // allow shortcodes to function
190
+ $content = apply_filters( 'the_content', $tab['content'] );
191
+ $content = str_replace( ']]>', ']]&gt;', $content );
192
+
193
+ echo apply_filters( 'yikes_woocommerce_custom_repeatable_product_tabs_heading', '<h2>' . $tab['title'] . '</h2>', $tab );
194
+ echo apply_filters( 'yikes_woocommerce_custom_repeatable_product_tabs_content', $content, $tab );
195
+ }
196
+
197
+
198
+ /** Admin methods ******************************************************/
199
+
200
+ /**
201
+ * Adds a new tab to the Product Data postbox in the admin product interface
202
+ */
203
+ public function render_custom_product_tabs() {
204
+ echo "<li class=\"yikes_wc_product_tabs_tab\"><a href=\"#yikes_woocommerce_custom_product_tabs\">" . __( 'Custom Tabs', self::TEXT_DOMAIN ) . "</a></li>";
205
+ }
206
+
207
+
208
+ /**
209
+ * Adds the panel to the Product Data postbox in the product interface
210
+ */
211
+ public function product_page_yikes_custom_tabs_panel() {
212
+ global $post;
213
+ // the product
214
+
215
+ if ( defined( 'WOOCOMMERCE_VERSION' ) && version_compare( WOOCOMMERCE_VERSION, '2.1', '<' ) ) {
216
+ ?>
217
+ <style type="text/css">
218
+ #woocommerce-product-data ul.product_data_tabs li.yikes_wc_product_tabs_tab a { padding:5px 5px 5px 28px;background-repeat:no-repeat;background-position:5px 7px; }
219
+ </style>
220
+ <?php
221
+ }
222
+
223
+ // pull the custom tab data out of the database
224
+ $tab_data = maybe_unserialize( get_post_meta( $post->ID, 'yikes_woo_products_tabs', true ) );
225
+
226
+ if ( empty( $tab_data ) ) {
227
+ $tab_data['1'] = array( 'title' => '', 'content' => '' , 'duplicate' => '' );
228
+ }
229
+
230
+ $i = 1;
231
+ // display the custom tab panel
232
+ echo '<div id="yikes_woocommerce_custom_product_tabs" class="panel wc-metaboxes-wrapper woocommerce_options_panel">';
233
+
234
+ echo $this->review_us_container();
235
+
236
+ echo '<div class="yikes-woo-tabs-hidden-how-to-info"><h3 style="padding-top:0;padding-bottom:0;">' . __( "How To" , self::TEXT_DOMAIN ) . ':</h3><p style="margin:0;padding-left:13px;">' . __( "To generate tabs, click 'Add Another Tab' at the bottom of this container." , self::TEXT_DOMAIN ) . ' ' . __( "To delete tabs, click 'Remove Tab' to the right of the title field." , self::TEXT_DOMAIN ) . '</p> <p style="padding:0 0 0 13px;margin-top:0;margin-bottom:0;"><em>' . __( "Note : Empty title+content tabs will be removed upon saving." , self::TEXT_DOMAIN ) . '</em></p></div>';
237
+ echo '<div class="dashicons dashicons-editor-help yikes-tabs-how-to-toggle" title="' . __( "Help Me!" , self::TEXT_DOMAIN ) . '"></div>';
238
+
239
+ // set up the initial display, by looping
240
+ foreach ( $tab_data as $tab ) {
241
+ if ( $i != 1 ) { ?>
242
+ <section class="button-holder" alt="<?php echo $i; ?>">
243
+ <!-- Remove tab button, should not generate for the first tab! -->
244
+ <a href="#" onclick="return false;" class="button-secondary remove_this_tab"><span class="dashicons dashicons-no-alt" style="line-height:1.3;"></span><?php echo __( 'Remove Tab' , self::TEXT_DOMAIN ); ?></a>
245
+ <div style="text-align:center;margin-top:.5em;">
246
+ <span class="dashicons dashicons-arrow-up move-tab-data-up"></span>
247
+ <span class="dashicons dashicons-arrow-down move-tab-data-down"></span>
248
+ </div>
249
+ </section>
250
+ <?php } else { ?>
251
+ <section style="margin-top:3.5em;" class="button-holder" alt="<?php echo $i; ?>">
252
+ <div style="text-align:center;">
253
+ <span class="dashicons dashicons-arrow-up move-tab-data-up"></span>
254
+ <span class="dashicons dashicons-arrow-down move-tab-data-down"></span>
255
+ </div>
256
+ </section>
257
+ <?php }
258
+ woocommerce_wp_text_input( array( 'id' => '_yikes_wc_custom_repeatable_product_tabs_tab_title_' . $i , 'label' => __( 'Tab Title', self::TEXT_DOMAIN ), 'description' => '', 'value' => $tab['title'] , 'placeholder' => 'Custom Tab Title' , 'class' => 'yikes_woo_tabs_title_field') );
259
+ $this->woocommerce_wp_textarea_input( array( 'id' => '_yikes_wc_custom_repeatable_product_tabs_tab_content_' . $i , 'label' => __( 'Content', self::TEXT_DOMAIN ), 'placeholder' => __( 'HTML and text to display.', self::TEXT_DOMAIN ), 'value' => $tab['content'], 'style' => 'width:70%;height:10.5em;' , 'class' => 'yikes_woo_tabs_content_field' ) );
260
+ if ( $i != count( $tab_data ) ) {
261
+ echo '<div class="yikes-woo-custom-tab-divider"></div>';
262
+ }
263
+ $i++;
264
+ }
265
+
266
+ ?>
267
+ <div id="duplicate_this_row">
268
+ <a href="#" onclick="return false;" class="button-secondary remove_this_tab" style="float:right;margin-right:4.25em;"><span class="dashicons dashicons-no-alt" style="line-height:1.3;"></span><?php echo __( 'Remove Tab' , self::TEXT_DOMAIN ); ?></a>
269
+ <?php
270
+ // lets add an empty row, to use for duplicating purposes
271
+ woocommerce_wp_text_input( array( 'id' => 'hidden_duplicator_row_title' , 'label' => __( 'Tab Title', self::TEXT_DOMAIN ), 'description' => '', 'placeholder' => 'Custom Tab Title' , 'class' => 'yikes_woo_tabs_title_field' ) );
272
+ $this->woocommerce_wp_textarea_input( array( 'id' => 'hidden_duplicator_row_content' , 'label' => __( 'Content', self::TEXT_DOMAIN ), 'placeholder' => __( 'HTML and text to display.', self::TEXT_DOMAIN ), 'style' => 'width:70%;height:10.5em;' , 'class' => 'yikes_woo_tabs_content_field' ) );
273
+ ?>
274
+ <section class="button-holder" alt="<?php echo $i; ?>">
275
+ <div style="text-align:center;">
276
+ <span class="dashicons dashicons-arrow-up move-tab-data-up"></span>
277
+ <span class="dashicons dashicons-arrow-down move-tab-data-down"></span>
278
+ </div>
279
+ </section>
280
+ </div>
281
+
282
+ <p>
283
+ <label style="display:block;" for="_yikes_wc_custom_repeatable_product_tabs_tab_content_<?php echo $i; ?>"></label>
284
+ <a href="#" class="button-secondary" id="add_another_tab"><em class="dashicons dashicons-plus-alt" style="line-height:1.8;font-size:14px;"></em><?php echo __( 'Add Another Tab' , self::TEXT_DOMAIN ); ?></a>
285
+ </p>
286
+
287
+ <?php
288
+ // store number of tabs, for count!
289
+ echo '<input type="hidden" value="' . count( $tab_data ) . '" id="number_of_tabs" name="number_of_tabs" >';
290
+
291
+ echo '</div>';
292
+
293
+ }
294
+
295
+
296
+ /**
297
+ * Saves the data inputed into the product boxes, as post meta data
298
+ * identified by the name 'yikes_woo_products_tabs'
299
+ *
300
+ * @param int $post_id the post (product) identifier
301
+ * @param stdClass $post the post (product)
302
+ */
303
+ public function product_save_data( $post_id, $post ) {
304
+
305
+ $tab_data = array();
306
+
307
+ $number_of_tabs = $_POST['number_of_tabs'];
308
+
309
+ $i = 1;
310
+ while( $i <= $number_of_tabs ) {
311
+
312
+ $tab_title = stripslashes( $_POST['_yikes_wc_custom_repeatable_product_tabs_tab_title_'.$i] );
313
+ $tab_content = stripslashes( $_POST['_yikes_wc_custom_repeatable_product_tabs_tab_content_'.$i] );
314
+
315
+ if ( empty( $tab_title ) && empty( $tab_content ) ) {
316
+
317
+ // clean up if the custom tabs are removed
318
+ unset( $tab_data[$i] );
319
+
320
+ } elseif ( !empty( $tab_title ) || !empty( $tab_content ) ) {
321
+
322
+ $tab_id = '';
323
+
324
+ if ( $tab_title ) {
325
+ if ( strlen( $tab_title ) != strlen( utf8_encode( $tab_title ) ) ) {
326
+ // can't have titles with utf8 characters as it breaks the tab-switching javascript
327
+ $tab_id = "tab-custom";
328
+ } else {
329
+ // convert the tab title into an id string
330
+ $tab_id = strtolower( $tab_title );
331
+ $tab_id = preg_replace( "/[^\w\s]/", '', $tab_id );
332
+ // remove non-alphas, numbers, underscores or whitespace
333
+ $tab_id = preg_replace( "/_+/", ' ', $tab_id );
334
+ // replace all underscores with single spaces
335
+ $tab_id = preg_replace( "/\s+/", '-', $tab_id );
336
+ // replace all multiple spaces with single dashes
337
+ $tab_id = 'tab-' . $tab_id;
338
+ // prepend with 'tab-' string
339
+ }
340
+ }
341
+ // push the data to the array
342
+ $tab_data[$i] = array( 'title' => $tab_title, 'id' => $tab_id, 'content' => $tab_content );
343
+ }
344
+
345
+ $i++;
346
+
347
+ }
348
+
349
+ // reset the array count, when items are removed
350
+ $tab_data = array_values( $tab_data );
351
+ // update the post data
352
+ update_post_meta( $post_id, 'yikes_woo_products_tabs', $tab_data );
353
+
354
+ }
355
+
356
+ /**
357
+ * Generates our woo commerce
358
+ * custom product tab textarea fields
359
+ *
360
+ * @param field
361
+ */
362
+ private function woocommerce_wp_textarea_input( $field ) {
363
+ global $thepostid, $post;
364
+
365
+ if ( ! $thepostid ) $thepostid = $post->ID;
366
+ if ( ! isset( $field['placeholder'] ) ) $field['placeholder'] = '';
367
+ if ( ! isset( $field['class'] ) ) $field['class'] = 'short';
368
+ if ( ! isset( $field['value'] ) ) $field['value'] = get_post_meta( $thepostid, $field['id'], true );
369
+
370
+ echo '<p class="form-field ' . $field['id'] . '_field"><label style="display:block;" for="' . $field['id'] . '">' . $field['label'] . '</label><textarea class="' . $field['class'] . '" name="' . $field['id'] . '" id="' . $field['id'] . '" placeholder="' . $field['placeholder'] . '" rows="2" cols="20"' . (isset( $field['style'] ) ? ' style="' . $field['style'] . '"' : '') . '>' . esc_textarea( $field['value'] ) . '</textarea> ';
371
+
372
+ if ( isset( $field['description'] ) && $field['description'] ) {
373
+ echo '<span class="description">' . $field['description'] . '</span>';
374
+ }
375
+
376
+ echo '</p>';
377
+ }
378
+
379
+
380
+ /** Helper methods ******************************************************/
381
+
382
+ /**
383
+ * Lazy-load the product_tabs meta data, and return true if it exists,
384
+ * false otherwise
385
+ *
386
+ * @return true if there is custom tab data, false otherwise
387
+ */
388
+ private function product_has_custom_tabs( $product ) {
389
+ if ( false === $this->tab_data ) {
390
+ $this->tab_data = maybe_unserialize( get_post_meta( $product->id, 'yikes_woo_products_tabs', true ) );
391
+ }
392
+ // tab must at least have a title to exist
393
+ return ! empty( $this->tab_data ) && ! empty( $this->tab_data[0] ) && ! empty( $this->tab_data[0]['title'] );
394
+ }
395
+
396
+
397
+ /**
398
+ * Checks if WooCommerce is active
399
+ *
400
+ * @since 1.0
401
+ * @return bool true if WooCommerce is active, false otherwise
402
+ */
403
+ public static function is_woocommerce_active() {
404
+
405
+ $active_plugins = (array) get_option( 'active_plugins', array() );
406
+
407
+ if ( is_multisite() ) {
408
+ $active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
409
+ }
410
+
411
+ return in_array( 'woocommerce/woocommerce.php', $active_plugins ) || array_key_exists( 'woocommerce/woocommerce.php', $active_plugins );
412
+ }
413
+
414
+
415
+ /** Lifecycle methods ******************************************************/
416
+
417
+ /**
418
+ * Run every time.
419
+ * Used since the activation hook is not executed when updating a plugin
420
+ */
421
+ private function install() {
422
+
423
+ global $wpdb;
424
+
425
+ $installed_version = get_option( self::VERSION_OPTION_NAME );
426
+
427
+ // installed version lower than plugin version?
428
+ if ( -1 === version_compare( $installed_version, self::VERSION ) ) {
429
+ // new version number
430
+ update_option( self::VERSION_OPTION_NAME, self::VERSION );
431
+ }
432
+ }
433
+
434
+ /**
435
+ Review Us Container
436
+ - displays the yikes logo, inside of the 'Custom Tabs' container
437
+ */
438
+ public function review_us_container() {
439
+ ?>
440
+ <div id="yikes-woo-tabs-review-us">
441
+ <a href="http://www.yikesinc.com" target="_blank">
442
+ <img src="<?php echo plugin_dir_url(__FILE__) . 'images/yikes_logo.png';?>" title="Plugin created by YIKES Inc." height=40 width=50 class="yikes-logo" >
443
+ </a>
444
+ </div>
445
+ <?php
446
+ }
447
+
448
+ }