Custom Product Tabs for WooCommerce - Version 1.3

Version Description

  • July 21st, 2015 =
  • Enhancement: Enabled WYSIWYG editor on tab content containers (enables shortcode and content to pass through the_content() filter)
  • Updated repo screenshots and descriptions
Download this release

Release Info

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

Code changes from version 1.1 to 1.3

css/repeatable-custom-tabs.css CHANGED
@@ -1 +1 @@
1
- .yikes_woo_tabs_title_field {
1
+ .yikes_woo_tabs_title_field {
css/repeatable-custom-tabs.min.css CHANGED
@@ -5,4 +5,4 @@
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"}
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"}
css/yikes-woo-tabs-font.css DELETED
@@ -1,28 +0,0 @@
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.mo ADDED
Binary file
i18n/languages/yikes-inc-woocommerce-repeatable-custom-product-tabs.pot CHANGED
@@ -6,62 +6,82 @@ msgstr ""
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 ""
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
+ "POT-Creation-Date: 2015-07-21 01:19-0500\n"
10
+ "PO-Revision-Date: 2015-07-21 01:19-0500\n"
11
+ "Last-Translator: Evan Herman <evan.m.herman@gmail.com>\n"
12
+ "Language-Team: YIKES Inc. <tech@yikesinc.com>\n"
13
+ "Language: en\n"
14
  "MIME-Version: 1.0\n"
15
  "Content-Type: text/plain; charset=UTF-8\n"
16
  "Content-Transfer-Encoding: 8bit\n"
 
 
 
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "X-Generator: Poedit 1.6.10\n"
19
+ "X-Poedit-Basepath: .\n"
20
+ "X-Poedit-KeywordsList: __;_e\n"
21
+ "X-Poedit-SearchPath-0: D:\\xampp\\htdocs\\wp-svg-2\\wp-content\\plugins"
22
+ "\\yikes-inc-easy-custom-woocommerce-product-tabs\n"
23
 
24
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:52
25
+ msgid ""
26
+ "Easy Custom WooCommerce Product Tabs could not be activated because "
27
+ "WooCommerce is not installed and active."
28
  msgstr ""
29
 
30
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:53
31
+ msgid "Please install and activate "
 
32
  msgstr ""
33
 
34
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:53
35
+ msgid " before activating the plugin."
 
36
  msgstr ""
37
 
38
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:201
39
+ msgid "Custom Tabs"
 
40
  msgstr ""
41
 
42
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:233
43
+ msgid "How To"
 
44
  msgstr ""
45
 
46
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:233
47
+ msgid ""
48
+ "To generate tabs, click 'Add Another Tab' at the bottom of this container."
49
  msgstr ""
50
 
51
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:233
52
+ msgid "To delete tabs, click 'Remove Tab' to the right of the title field."
53
  msgstr ""
54
 
55
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:233
56
  msgid ""
57
+ "Note : Re-save the product to initialize the WordPress content editor on "
58
+ "newly created tab content."
59
+ msgstr ""
60
+
61
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:234
62
+ msgid "Help Me!"
63
+ msgstr ""
64
+
65
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:241
66
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:273
67
+ msgid "Remove Tab"
68
+ msgstr ""
69
+
70
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:255
71
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:276
72
+ msgid "Tab Title"
73
  msgstr ""
74
 
75
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:258
76
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:277
77
+ msgid "Content"
78
+ msgstr ""
79
+
80
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:259
81
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:277
82
+ msgid "HTML and text to display."
83
  msgstr ""
84
 
85
+ #: D:\xampp\htdocs\wp-svg-2\wp-content\plugins\yikes-inc-easy-custom-woocommerce-product-tabs/yikes-inc-easy-custom-woocommerce-product-tabs.php:289
86
+ msgid "Add Another Tab"
87
  msgstr ""
js/repeatable-custom-tabs.js CHANGED
@@ -1 +1 @@
1
- /*
1
+ /*
js/repeatable-custom-tabs.min.js CHANGED
@@ -5,4 +5,4 @@
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)}})})
5
  * @ http://www.YIKESinc.com
6
  *
7
  */
8
+ jQuery(document).ready(function(){jQuery(".yikes-custom-wysiwyg-label").each(function(){jQuery(this).insertBefore(jQuery(this).prev())}),jQuery("#add_another_tab").on("click",function(t){var e=jQuery("#duplicate_this_row"),_=(jQuery("#number_of_tabs").val(),parseInt(jQuery("#number_of_tabs").val())+parseInt(1)),a=jQuery("#duplicate_this_row .remove_this_tab"),r=jQuery("#duplicate_this_row .button-holder");e.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(){jQuery(this).is('input[name="hidden_duplicator_row_title"]')&&jQuery(this).attr("name","_yikes_wc_custom_repeatable_product_tabs_tab_title_"+_).attr("id","_yikes_wc_custom_repeatable_product_tabs_tab_title_"+_).parents("p").addClass("_yikes_wc_custom_repeatable_product_tabs_tab_title_"+_+"_field").removeClass("hidden_duplicator_row_title_field").find("label").removeAttr("for").attr("for","_yikes_wc_custom_repeatable_product_tabs_tab_title_"+_+"_field")}),jQuery(".new_duplicate_row").find("textarea").each(function(){jQuery(this).is('textarea[name="hidden_duplicator_row_content"]')&&jQuery(this).attr("name","_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_).attr("id","_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_).parents("p").addClass("_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"_field").removeClass("hidden_duplicator_row_content_field").find("label").removeAttr("for").attr("for","_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"_field")}),jQuery("#number_of_tabs").val(_),jQuery(".new_duplicate_row").first().before('<div class="yikes-woo-custom-tab-divider"></div>')}),r.clone().insertAfter(jQuery(".yikes-woo-custom-tab-divider").last()).addClass("last-button-holder"),a.clone().prependTo(".last-button-holder").removeAttr("style"),jQuery(".last-button-holder").removeAttr("alt").attr("alt",_),setTimeout(function(){jQuery(".last-button-holder").removeClass("last-button-holder"),jQuery(".new_duplicate_row").removeClass("new_duplicate_row")},100),t.preventDefault()}),jQuery("body").on("click",".remove_this_tab",function(t){var e=jQuery(this),_=jQuery(this).parents(".button-holder").next();jQuery(".yikes-custom-wysiwyg-label").remove();var a=jQuery(this).parents(".button-holder").next().next(),r=jQuery(this).parents(".button-holder").prev(),o=(jQuery("#number_of_tabs").val(),parseInt(jQuery("#number_of_tabs").val())-parseInt(1));_.remove(),a.remove(),r.remove(),e.parents(".button-holder").remove(),setTimeout(function(){jQuery(".last-button-holder").removeClass("last-button-holder"),jQuery(".new_duplicate_row").removeClass("new_duplicate_row")},100);var s=1;jQuery(".yikes_woo_tabs_title_field").each(function(){jQuery(this).removeAttr("name").attr("name","_yikes_wc_custom_repeatable_product_tabs_tab_title_"+s).removeAttr("id").attr("id","_yikes_wc_custom_repeatable_product_tabs_tab_title_"+s),jQuery(this).prev().removeAttr("for").attr("for","_yikes_wc_custom_repeatable_product_tabs_tab_title_"+s),jQuery(this).parent("p").removeAttr("for").attr("for","form-field _yikes_wc_custom_repeatable_product_tabs_tab_title_"+s+"_field"),jQuery(this).parent("p").removeAttr("class").attr("class","form-field _yikes_wc_custom_repeatable_product_tabs_tab_title_"+s+"_field"),s++});var u=1;jQuery("#yikes_woocommerce_custom_product_tabs").find("textarea.wp-editor-area").each(function(){jQuery(this).attr("name","_yikes_wc_custom_repeatable_product_tabs_tab_content_"+u),jQuery(this).attr("id","_yikes_wc_custom_repeatable_product_tabs_tab_content_"+u),u++});var n=1;jQuery(".button-holder").each(function(){jQuery(this).removeAttr("alt").attr("alt",n),n++}),jQuery("#number_of_tabs").val(o),t.preventDefault()}),jQuery(".yikes-tabs-how-to-toggle").on("click",function(){jQuery(".yikes-woo-tabs-hidden-how-to-info").slideToggle("fast")}),jQuery("body").on("click",".move-tab-data-up",function(){var t=jQuery(this),e=t.parents(".button-holder").attr("alt"),_=jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+e+'"]').val(),a=tinymce.get("_yikes_wc_custom_repeatable_product_tabs_tab_content_"+e).getContent();if(1==e)return!1;var r=parseInt(e)-parseInt(1),o=jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+r+'"]').val(),s=tinymce.get("_yikes_wc_custom_repeatable_product_tabs_tab_content_"+r).getContent();jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+e+'"]').val(o),jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+r+'"]').val(_),tinymce.get("_yikes_wc_custom_repeatable_product_tabs_tab_content_"+e).setContent(s),tinymce.get("_yikes_wc_custom_repeatable_product_tabs_tab_content_"+r).setContent(a)}),jQuery("body").on("click",".move-tab-data-down",function(){var t=jQuery("#number_of_tabs").val(),e=jQuery(this),_=e.parents(".button-holder").attr("alt"),a=jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+_+'"]').val(),r=tinymce.get("_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_).getContent();if(_==t)return!1;var o=parseInt(_)+parseInt(1),s=jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+o+'"]').val(),u=jQuery('textarea[name="_yikes_wc_custom_repeatable_product_tabs_tab_content_'+o+'"]').val();jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+_+'"]').val(s),jQuery('input[name="_yikes_wc_custom_repeatable_product_tabs_tab_title_'+o+'"]').val(a),tinymce.get("_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_).setContent(u),tinymce.get("_yikes_wc_custom_repeatable_product_tabs_tab_content_"+o).setContent(r)})});
readme.txt CHANGED
@@ -3,10 +3,10 @@ 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.1
10
  License: GPLv2 or later
11
 
12
  This plugin extends WooCommerce to allow site admins to add custom tabs to products.
@@ -17,7 +17,7 @@ This plugin extends the [WooCommerce](www.woothemes.com/woocommerce/) eCommerce
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
 
@@ -29,8 +29,9 @@ If you experience any problems, please submit a New Issue on our [Github Issue T
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
 
@@ -49,8 +50,19 @@ To change the order of the custom tabs use the up and down arrows to the right o
49
 
50
  == Changelog ==
51
 
 
 
 
 
 
 
 
 
52
  = 1.1 =
53
  * Added class to the Woo tabs content title, for targeting via CSS ( `.yikes-custom-woo-tab-title` )
54
 
55
  = 1.0.0 =
56
  * Initial Release
 
 
 
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.3
7
  Requires WooCommerce at least: 2.0
8
+ Tested WooCommerce up to: 2.3.13
9
+ Stable tag: 1.3
10
  License: GPLv2 or later
11
 
12
  This plugin extends WooCommerce 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 use the standard WYSIWYG WordPress editor, and 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
 
29
 
30
  == Screenshots ==
31
 
32
+ 1. Custom Tabs manager on the 'Edit Product' screen
33
+ 2. Custom product tab content displayed on the front end
34
+ 3. Contact Form 7 shortcode rendered in custom product tab
35
 
36
  == Frequently Asked Questions ==
37
 
50
 
51
  == Changelog ==
52
 
53
+ = 1.3 - July 21st, 2015 =
54
+ * Enhancement: Enabled WYSIWYG editor on tab content containers (enables shortcode and content to pass through the_content() filter)
55
+ * Updated repo screenshots and descriptions
56
+
57
+ = 1.2 - March 18th, 2015 =
58
+ * Enhancement: Fixed issue where non utf8 characters in tab titles caused front end not to generate the tabs
59
+ * Enhancement: When user doesn't have WooCommerce installed, they are now redirected to the plugin install search page, with WooCommerce at the top.
60
+
61
  = 1.1 =
62
  * Added class to the Woo tabs content title, for targeting via CSS ( `.yikes-custom-woo-tab-title` )
63
 
64
  = 1.0.0 =
65
  * Initial Release
66
+
67
+ == Upgrade Notice ==
68
+ * Enhancement: Enabled WYSIWYG editor on tab content containers (enables shortcode and content to pass through the_content() filter)
yikes-inc-easy-custom-woocommerce-product-tabs.php CHANGED
@@ -5,9 +5,9 @@
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.1
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.
@@ -50,7 +50,7 @@
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
  }
@@ -63,7 +63,7 @@
63
  private $tab_data = false;
64
 
65
  /** plugin version number */
66
- const VERSION = "1.1";
67
 
68
  /** plugin text domain */
69
  const TEXT_DOMAIN = 'yikes-inc-woocommerce-custom-product-tabs';
@@ -111,11 +111,9 @@
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;
@@ -127,9 +125,6 @@
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
  }
@@ -157,7 +152,7 @@
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
@@ -167,7 +162,9 @@
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
 
@@ -201,7 +198,7 @@
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
 
@@ -233,15 +230,15 @@
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>
@@ -255,8 +252,16 @@
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
  }
@@ -265,11 +270,11 @@
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;">
@@ -281,7 +286,7 @@
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
@@ -324,7 +329,8 @@
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 );
@@ -367,7 +373,7 @@
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>';
@@ -375,6 +381,36 @@
375
 
376
  echo '</p>';
377
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
 
379
 
380
  /** Helper methods ******************************************************/
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.3
9
+ * Tested up to: 4.3
10
+ * Text Domain: 'yikes-inc-woocommerce-custom-product-tabs'
11
  * Domain Path: /i18n/languages/
12
  *
13
  * Copyright: (c) 2014-2015 YIKES Inc.
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="<?php echo admin_url( 'plugin-install.php?tab=search&type=term&s=WooCommerce+-+excelling+eCommerce' ); ?>" title="WooCommerce">WooCommerce</a><?php _e( ' before activating the plugin.', 'yikes-inc-woocommerce-custom-product-tabs' ); ?></p>
54
  </div>
55
  <?php
56
  }
63
  private $tab_data = false;
64
 
65
  /** plugin version number */
66
+ const VERSION = "1.3";
67
 
68
  /** plugin text domain */
69
  const TEXT_DOMAIN = 'yikes-inc-woocommerce-custom-product-tabs';
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
  /** Frontend methods ******************************************************/
118
  public function enqueue_repeatable_tab_script( $hook ) {
119
  global $post;
125
  // styles + font
126
  wp_register_style( 'repeatable-custom-tabs-styles' , plugin_dir_url(__FILE__) . 'css/repeatable-custom-tabs.min.css' , '' , 'all' );
127
  wp_enqueue_style( 'repeatable-custom-tabs-styles' );
 
 
 
128
  }
129
  }
130
  }
152
  $i = 25; // setup priorty to loop over, andrender tabs in proper order
153
  foreach ( $this->tab_data as $tab ) {
154
  $tabs[ $tab['id'] ] = array(
155
+ 'title' => __( $tab['title'], 'yikes-inc-woocommerce-custom-product-tabs' ),
156
  'priority' => $i++,
157
  'callback' => array( $this, 'custom_product_tabs_panel_content' ),
158
  'content' => $tab['content'], // custom field
162
  $tabs['reviews']['priority'] = $i; // make sure the reviews tab remains on the end (if it is set)
163
  }
164
  }
165
+
166
  return $tabs;
167
+
168
  }
169
 
170
 
198
  * Adds a new tab to the Product Data postbox in the admin product interface
199
  */
200
  public function render_custom_product_tabs() {
201
+ echo "<li class=\"yikes_wc_product_tabs_tab\"><a href=\"#yikes_woocommerce_custom_product_tabs\">" . __( 'Custom Tabs', 'yikes-inc-woocommerce-custom-product-tabs' ) . "</a></li>";
202
  }
203
 
204
 
230
 
231
  echo $this->review_us_container();
232
 
233
+ echo '<div class="yikes-woo-tabs-hidden-how-to-info"><h3 style="padding-top:0;padding-bottom:0;">' . __( "How To" , 'yikes-inc-woocommerce-custom-product-tabs' ) . ':</h3><p style="margin:0;padding-left:13px;">' . __( "To generate tabs, click 'Add Another Tab' at the bottom of this container." , 'yikes-inc-woocommerce-custom-product-tabs' ) . ' ' . __( "To delete tabs, click 'Remove Tab' to the right of the title field." , 'yikes-inc-woocommerce-custom-product-tabs' ) . '</p> <p style="padding:0 0 0 13px;margin-top:0;margin-bottom:0;"><em>' . __( "Note : Re-save the product to initialize the WordPress content editor on newly created tab content." , 'yikes-inc-woocommerce-custom-product-tabs' ) . '</em></p></div>';
234
+ echo '<div class="dashicons dashicons-editor-help yikes-tabs-how-to-toggle" title="' . __( "Help Me!" , 'yikes-inc-woocommerce-custom-product-tabs' ) . '"></div>';
235
 
236
  // set up the initial display, by looping
237
  foreach ( $tab_data as $tab ) {
238
  if ( $i != 1 ) { ?>
239
  <section class="button-holder" alt="<?php echo $i; ?>">
240
  <!-- Remove tab button, should not generate for the first tab! -->
241
+ <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' , 'yikes-inc-woocommerce-custom-product-tabs' ); ?></a>
242
  <div style="text-align:center;margin-top:.5em;">
243
  <span class="dashicons dashicons-arrow-up move-tab-data-up"></span>
244
  <span class="dashicons dashicons-arrow-down move-tab-data-down"></span>
252
  </div>
253
  </section>
254
  <?php }
255
+ woocommerce_wp_text_input( array( 'id' => '_yikes_wc_custom_repeatable_product_tabs_tab_title_' . $i , 'label' => __( 'Tab Title', 'yikes-inc-woocommerce-custom-product-tabs' ), 'description' => '', 'value' => $tab['title'] , 'placeholder' => 'Custom Tab Title' , 'class' => 'yikes_woo_tabs_title_field') );
256
+ $this->woocommerce_wp_wysiwyg_input( array(
257
+ 'id' => '_yikes_wc_custom_repeatable_product_tabs_tab_content_' . $i ,
258
+ 'label' => __( 'Content', 'yikes-inc-woocommerce-custom-product-tabs' ),
259
+ 'placeholder' => __( 'HTML and text to display.', 'yikes-inc-woocommerce-custom-product-tabs' ),
260
+ 'value' => $tab['content'],
261
+ 'style' => 'width:70%;height:10.5em;',
262
+ 'class' => 'yikes_woo_tabs_content_field',
263
+ 'number' => $i
264
+ ) );
265
  if ( $i != count( $tab_data ) ) {
266
  echo '<div class="yikes-woo-custom-tab-divider"></div>';
267
  }
270
 
271
  ?>
272
  <div id="duplicate_this_row">
273
+ <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' , 'yikes-inc-woocommerce-custom-product-tabs' ); ?></a>
274
  <?php
275
  // lets add an empty row, to use for duplicating purposes
276
+ woocommerce_wp_text_input( array( 'id' => 'hidden_duplicator_row_title' , 'label' => __( 'Tab Title', 'yikes-inc-woocommerce-custom-product-tabs' ), 'description' => '', 'placeholder' => 'Custom Tab Title' , 'class' => 'yikes_woo_tabs_title_field' ) );
277
+ $this->woocommerce_wp_textarea_input( array( 'id' => 'hidden_duplicator_row_content' , 'label' => __( 'Content', 'yikes-inc-woocommerce-custom-product-tabs' ), 'placeholder' => __( 'HTML and text to display.', 'yikes-inc-woocommerce-custom-product-tabs' ), 'style' => 'width:70%;height:10.5em;' , 'class' => 'yikes_woo_tabs_content_field' ) );
278
  ?>
279
  <section class="button-holder" alt="<?php echo $i; ?>">
280
  <div style="text-align:center;">
286
 
287
  <p>
288
  <label style="display:block;" for="_yikes_wc_custom_repeatable_product_tabs_tab_content_<?php echo $i; ?>"></label>
289
+ <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' , 'yikes-inc-woocommerce-custom-product-tabs' ); ?></a>
290
  </p>
291
 
292
  <?php
329
  if ( $tab_title ) {
330
  if ( strlen( $tab_title ) != strlen( utf8_encode( $tab_title ) ) ) {
331
  // can't have titles with utf8 characters as it breaks the tab-switching javascript
332
+ // so we'll just append an integer
333
+ $tab_id = "tab-custom-" . $i;
334
  } else {
335
  // convert the tab title into an id string
336
  $tab_id = strtolower( $tab_title );
373
  if ( ! isset( $field['class'] ) ) $field['class'] = 'short';
374
  if ( ! isset( $field['value'] ) ) $field['value'] = get_post_meta( $thepostid, $field['id'], true );
375
 
376
+ 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'] . '"' : '') . '>' . $field['value'] . '</textarea> ';
377
 
378
  if ( isset( $field['description'] ) && $field['description'] ) {
379
  echo '<span class="description">' . $field['description'] . '</span>';
381
 
382
  echo '</p>';
383
  }
384
+
385
+ /**
386
+ * Generates our woo commerce
387
+ * custom product tab textarea fields
388
+ *
389
+ * @param field
390
+ */
391
+ private function woocommerce_wp_wysiwyg_input( $field ) {
392
+ global $thepostid, $post;
393
+
394
+ if ( ! $thepostid ) $thepostid = $post->ID;
395
+ if ( ! isset( $field['placeholder'] ) ) $field['placeholder'] = '';
396
+ if ( ! isset( $field['class'] ) ) $field['class'] = 'short';
397
+ if ( ! isset( $field['value'] ) ) $field['value'] = get_post_meta( $thepostid, $field['id'], true );
398
+
399
+ // esc_textarea( $field['value'] )
400
+ // $editor_id = $field['id']
401
+ $editor_settings = array(
402
+ 'textarea_name' => $field['id']
403
+ );
404
+
405
+ echo '<label class="yikes-custom-wysiwyg-label" style="display:block;" for="' . $field['id'] . '">' . $field['label'] . '</label>'.
406
+
407
+ wp_editor( $field['value'], $field['id'], $editor_settings );
408
+
409
+ if ( isset( $field['description'] ) && $field['description'] ) {
410
+ echo '<span class="description">' . $field['description'] . '</span>';
411
+ }
412
+
413
+ }
414
 
415
 
416
  /** Helper methods ******************************************************/