Version Description
- March 18th, 2015 =
- Enhancement: fixed issue where non utf8 characters in tab titles caused front end not to generate the tabs
- Enhancement: When user doesn't have WooCommerce installed, they are now redirected to the plugin install search page, with WooCommerce at the top.
Download this release
Release Info
Developer | eherman24 |
Plugin | Custom Product Tabs for WooCommerce |
Version | 1.2 |
Comparing to | |
See all releases |
Code changes from version 1.4 to 1.2
- css/repeatable-custom-tabs.css +1 -1
- css/repeatable-custom-tabs.min.css +1 -1
- i18n/languages/yikes-inc-woocommerce-repeatable-custom-product-tabs.mo +0 -0
- i18n/languages/yikes-inc-woocommerce-repeatable-custom-product-tabs.pot +34 -54
- js/repeatable-custom-tabs.js +1 -1
- js/repeatable-custom-tabs.min.js +1 -1
- readme.txt +6 -20
- yikes-inc-easy-custom-woocommerce-product-tabs.php +23 -92
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}
|
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"}
|
i18n/languages/yikes-inc-woocommerce-repeatable-custom-product-tabs.mo
DELETED
Binary file
|
i18n/languages/yikes-inc-woocommerce-repeatable-custom-product-tabs.pot
CHANGED
@@ -6,82 +6,62 @@ 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 |
-
"
|
19 |
-
"X-
|
20 |
-
"X-Poedit-
|
21 |
-
"
|
22 |
-
"
|
23 |
|
24 |
-
#:
|
25 |
-
|
26 |
-
"
|
27 |
-
"WooCommerce is not installed and active."
|
28 |
msgstr ""
|
29 |
|
30 |
-
#:
|
31 |
-
|
|
|
32 |
msgstr ""
|
33 |
|
34 |
-
#:
|
35 |
-
|
|
|
36 |
msgstr ""
|
37 |
|
38 |
-
#:
|
39 |
-
|
|
|
40 |
msgstr ""
|
41 |
|
42 |
-
#:
|
43 |
-
|
|
|
44 |
msgstr ""
|
45 |
|
46 |
-
|
47 |
-
msgid ""
|
48 |
-
"To generate tabs, click 'Add Another Tab' at the bottom of this container."
|
49 |
msgstr ""
|
50 |
|
51 |
-
|
52 |
-
msgid "
|
53 |
msgstr ""
|
54 |
|
55 |
-
|
56 |
msgid ""
|
57 |
-
"
|
58 |
-
"
|
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 |
-
|
76 |
-
|
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 |
-
|
86 |
-
msgid "
|
87 |
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 ""
|
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("
|
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
CHANGED
@@ -5,8 +5,8 @@ Tags: woocommerce, product tabs, repeatable, duplicate, customize, custom, tabs,
|
|
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.
|
9 |
-
Stable tag: 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
|
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,9 +29,8 @@ 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
|
33 |
-
2.
|
34 |
-
3. Contact Form 7 shortcode rendered in custom product tab
|
35 |
|
36 |
== Frequently Asked Questions ==
|
37 |
|
@@ -47,21 +46,11 @@ Make sure you hit the Product's main Update button to save all the edits you mad
|
|
47 |
= How do I change the order of the tabs? =
|
48 |
To change the order of the custom tabs use the up and down arrows to the right of the Tab Title.
|
49 |
|
50 |
-
= Does the custom tab data get exported with the standard WooCommerce product data? =
|
51 |
-
Yes! Since v1.4 we've added the necessary hooks and filters to ensure the custom tab data is exported with all of the other standard WooCommerce data. This ensures a smooth transition of products between sites.
|
52 |
-
|
53 |
|
54 |
== Changelog ==
|
55 |
|
56 |
-
= 1.4 - July 29th, 2015 =
|
57 |
-
* Enhancement: Added the 'Easy Custom WooCommerce Product Tabs' data to the standard WooCommerce export file, so custom tab data can be transferred between sites smoothly.
|
58 |
-
|
59 |
-
= 1.3 - July 21st, 2015 =
|
60 |
-
* Enhancement: Enabled WYSIWYG editor on tab content containers (enables shortcode and content to pass through the_content() filter)
|
61 |
-
* Updated repo screenshots and descriptions
|
62 |
-
|
63 |
= 1.2 - March 18th, 2015 =
|
64 |
-
* Enhancement:
|
65 |
* Enhancement: When user doesn't have WooCommerce installed, they are now redirected to the plugin install search page, with WooCommerce at the top.
|
66 |
|
67 |
= 1.1 =
|
@@ -69,6 +58,3 @@ Yes! Since v1.4 we've added the necessary hooks and filters to ensure the custom
|
|
69 |
|
70 |
= 1.0.0 =
|
71 |
* Initial Release
|
72 |
-
|
73 |
-
== Upgrade Notice ==
|
74 |
-
* Enhancement: Enabled WYSIWYG editor on tab content containers (enables shortcode and content to pass through the_content() filter)
|
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.2.10
|
9 |
+
Stable tag: 1.2
|
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 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. The custom tabs displayed on the frontend
|
|
|
34 |
|
35 |
== Frequently Asked Questions ==
|
36 |
|
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.2 - March 18th, 2015 =
|
53 |
+
* Enhancement: fixed issue where non utf8 characters in tab titles caused front end not to generate the tabs
|
54 |
* Enhancement: When user doesn't have WooCommerce installed, they are now redirected to the plugin install search page, with WooCommerce at the top.
|
55 |
|
56 |
= 1.1 =
|
58 |
|
59 |
= 1.0.0 =
|
60 |
* Initial Release
|
|
|
|
|
|
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.
|
9 |
-
* Tested up to: 4.
|
10 |
-
* Text Domain:
|
11 |
* Domain Path: /i18n/languages/
|
12 |
*
|
13 |
* Copyright: (c) 2014-2015 YIKES Inc.
|
@@ -63,7 +63,7 @@
|
|
63 |
private $tab_data = false;
|
64 |
|
65 |
/** plugin version number */
|
66 |
-
const VERSION = "1.
|
67 |
|
68 |
/** plugin text domain */
|
69 |
const TEXT_DOMAIN = 'yikes-inc-woocommerce-custom-product-tabs';
|
@@ -81,44 +81,8 @@
|
|
81 |
|
82 |
add_action( 'init', array( $this, 'load_translation' ) );
|
83 |
add_action( 'woocommerce_init', array( $this, 'init' ) );
|
84 |
-
// add our data to the woocommerce export
|
85 |
-
add_filter( 'wc_customer_order_csv_export_order_headers', array( $this, 'wc_csv_export_modify_column_headers' ) );
|
86 |
-
add_filter( 'wc_customer_order_csv_export_order_row', array( $this, 'yikes_wootabs_wc_csv_export_modify_row_data' ), 10, 3 );
|
87 |
}
|
88 |
|
89 |
-
/**
|
90 |
-
* Add our data to the standard WooCommerce Export Functionality
|
91 |
-
* @since 1.4
|
92 |
-
**/
|
93 |
-
function yikes_wootabs_wc_csv_export_modify_column_headers( $column_headers ) {
|
94 |
-
|
95 |
-
$new_headers = array(
|
96 |
-
'yikes_woo_products_tabs' => 'Yikes Inc. Custom WooCommerce Tabs',
|
97 |
-
);
|
98 |
-
|
99 |
-
return array_merge( $column_headers, $new_headers );
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Append our yikes woo product tab data
|
104 |
-
* @since 1.4
|
105 |
-
**/
|
106 |
-
function yikes_wootabs_wc_csv_export_modify_row_data( $order_data, $order, $csv_generator ) {
|
107 |
-
|
108 |
-
$custom_data = array(
|
109 |
-
'yikes_woo_products_tabs' => get_post_meta( $order->id, 'yikes_woo_products_tabs', true ),
|
110 |
-
);
|
111 |
-
|
112 |
-
$new_order_data = array();
|
113 |
-
if ( isset( $csv_generator->order_format ) && ( 'default_one_row_per_item' == $csv_generator->order_format || 'legacy_one_row_per_item' == $csv_generator->order_format ) ) {
|
114 |
-
foreach ( $order_data as $data ) {
|
115 |
-
$new_order_data[] = array_merge( (array) $data, $custom_data );
|
116 |
-
}
|
117 |
-
} else {
|
118 |
-
$new_order_data = array_merge( $order_data, $custom_data );
|
119 |
-
}
|
120 |
-
return $new_order_data;
|
121 |
-
}
|
122 |
|
123 |
/**
|
124 |
* Init WooCommerce PDF Product Vouchers when WordPress initializes
|
@@ -147,9 +111,11 @@
|
|
147 |
add_filter( 'yikes_woocommerce_custom_repeatable_product_tabs_content', 'do_shortcode' );
|
148 |
|
149 |
// enqueue our custom js file, for repeatable tabs
|
150 |
-
add_action( 'admin_enqueue_scripts' , array(
|
|
|
151 |
}
|
152 |
-
|
|
|
153 |
/** Frontend methods ******************************************************/
|
154 |
public function enqueue_repeatable_tab_script( $hook ) {
|
155 |
global $post;
|
@@ -161,6 +127,9 @@
|
|
161 |
// styles + font
|
162 |
wp_register_style( 'repeatable-custom-tabs-styles' , plugin_dir_url(__FILE__) . 'css/repeatable-custom-tabs.min.css' , '' , 'all' );
|
163 |
wp_enqueue_style( 'repeatable-custom-tabs-styles' );
|
|
|
|
|
|
|
164 |
}
|
165 |
}
|
166 |
}
|
@@ -188,7 +157,7 @@
|
|
188 |
$i = 25; // setup priorty to loop over, andrender tabs in proper order
|
189 |
foreach ( $this->tab_data as $tab ) {
|
190 |
$tabs[ $tab['id'] ] = array(
|
191 |
-
'title' => __( $tab['title'],
|
192 |
'priority' => $i++,
|
193 |
'callback' => array( $this, 'custom_product_tabs_panel_content' ),
|
194 |
'content' => $tab['content'], // custom field
|
@@ -234,7 +203,7 @@
|
|
234 |
* Adds a new tab to the Product Data postbox in the admin product interface
|
235 |
*/
|
236 |
public function render_custom_product_tabs() {
|
237 |
-
echo "<li class=\"yikes_wc_product_tabs_tab\"><a href=\"#yikes_woocommerce_custom_product_tabs\">" . __( 'Custom Tabs',
|
238 |
}
|
239 |
|
240 |
|
@@ -266,15 +235,15 @@
|
|
266 |
|
267 |
echo $this->review_us_container();
|
268 |
|
269 |
-
echo '<div class="yikes-woo-tabs-hidden-how-to-info"><h3 style="padding-top:0;padding-bottom:0;">' . __( "How To" ,
|
270 |
-
echo '<div class="dashicons dashicons-editor-help yikes-tabs-how-to-toggle" title="' . __( "Help Me!" ,
|
271 |
|
272 |
// set up the initial display, by looping
|
273 |
foreach ( $tab_data as $tab ) {
|
274 |
if ( $i != 1 ) { ?>
|
275 |
<section class="button-holder" alt="<?php echo $i; ?>">
|
276 |
<!-- Remove tab button, should not generate for the first tab! -->
|
277 |
-
<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' ,
|
278 |
<div style="text-align:center;margin-top:.5em;">
|
279 |
<span class="dashicons dashicons-arrow-up move-tab-data-up"></span>
|
280 |
<span class="dashicons dashicons-arrow-down move-tab-data-down"></span>
|
@@ -288,16 +257,8 @@
|
|
288 |
</div>
|
289 |
</section>
|
290 |
<?php }
|
291 |
-
woocommerce_wp_text_input( array( 'id' => '_yikes_wc_custom_repeatable_product_tabs_tab_title_' . $i , 'label' => __( 'Tab Title',
|
292 |
-
$this->
|
293 |
-
'id' => '_yikes_wc_custom_repeatable_product_tabs_tab_content_' . $i ,
|
294 |
-
'label' => __( 'Content', 'yikes-inc-woocommerce-custom-product-tabs' ),
|
295 |
-
'placeholder' => __( 'HTML and text to display.', 'yikes-inc-woocommerce-custom-product-tabs' ),
|
296 |
-
'value' => $tab['content'],
|
297 |
-
'style' => 'width:70%;height:10.5em;',
|
298 |
-
'class' => 'yikes_woo_tabs_content_field',
|
299 |
-
'number' => $i
|
300 |
-
) );
|
301 |
if ( $i != count( $tab_data ) ) {
|
302 |
echo '<div class="yikes-woo-custom-tab-divider"></div>';
|
303 |
}
|
@@ -306,11 +267,11 @@
|
|
306 |
|
307 |
?>
|
308 |
<div id="duplicate_this_row">
|
309 |
-
<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' ,
|
310 |
<?php
|
311 |
// lets add an empty row, to use for duplicating purposes
|
312 |
-
woocommerce_wp_text_input( array( 'id' => 'hidden_duplicator_row_title' , 'label' => __( 'Tab Title',
|
313 |
-
$this->woocommerce_wp_textarea_input( array( 'id' => 'hidden_duplicator_row_content' , 'label' => __( 'Content',
|
314 |
?>
|
315 |
<section class="button-holder" alt="<?php echo $i; ?>">
|
316 |
<div style="text-align:center;">
|
@@ -322,7 +283,7 @@
|
|
322 |
|
323 |
<p>
|
324 |
<label style="display:block;" for="_yikes_wc_custom_repeatable_product_tabs_tab_content_<?php echo $i; ?>"></label>
|
325 |
-
<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' ,
|
326 |
</p>
|
327 |
|
328 |
<?php
|
@@ -409,7 +370,7 @@
|
|
409 |
if ( ! isset( $field['class'] ) ) $field['class'] = 'short';
|
410 |
if ( ! isset( $field['value'] ) ) $field['value'] = get_post_meta( $thepostid, $field['id'], true );
|
411 |
|
412 |
-
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> ';
|
413 |
|
414 |
if ( isset( $field['description'] ) && $field['description'] ) {
|
415 |
echo '<span class="description">' . $field['description'] . '</span>';
|
@@ -417,36 +378,6 @@
|
|
417 |
|
418 |
echo '</p>';
|
419 |
}
|
420 |
-
|
421 |
-
/**
|
422 |
-
* Generates our woo commerce
|
423 |
-
* custom product tab textarea fields
|
424 |
-
*
|
425 |
-
* @param field
|
426 |
-
*/
|
427 |
-
private function woocommerce_wp_wysiwyg_input( $field ) {
|
428 |
-
global $thepostid, $post;
|
429 |
-
|
430 |
-
if ( ! $thepostid ) $thepostid = $post->ID;
|
431 |
-
if ( ! isset( $field['placeholder'] ) ) $field['placeholder'] = '';
|
432 |
-
if ( ! isset( $field['class'] ) ) $field['class'] = 'short';
|
433 |
-
if ( ! isset( $field['value'] ) ) $field['value'] = get_post_meta( $thepostid, $field['id'], true );
|
434 |
-
|
435 |
-
// esc_textarea( $field['value'] )
|
436 |
-
// $editor_id = $field['id']
|
437 |
-
$editor_settings = array(
|
438 |
-
'textarea_name' => $field['id']
|
439 |
-
);
|
440 |
-
|
441 |
-
echo '<label class="yikes-custom-wysiwyg-label" style="display:block;" for="' . $field['id'] . '">' . $field['label'] . '</label>'.
|
442 |
-
|
443 |
-
wp_editor( $field['value'], $field['id'], $editor_settings );
|
444 |
-
|
445 |
-
if ( isset( $field['description'] ) && $field['description'] ) {
|
446 |
-
echo '<span class="description">' . $field['description'] . '</span>';
|
447 |
-
}
|
448 |
-
|
449 |
-
}
|
450 |
|
451 |
|
452 |
/** 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.2
|
9 |
+
* Tested up to: 4.1.1
|
10 |
+
* Text Domain: yikes-inc-woocommerce-custom-product-tabs
|
11 |
* Domain Path: /i18n/languages/
|
12 |
*
|
13 |
* Copyright: (c) 2014-2015 YIKES Inc.
|
63 |
private $tab_data = false;
|
64 |
|
65 |
/** plugin version number */
|
66 |
+
const VERSION = "1.2";
|
67 |
|
68 |
/** plugin text domain */
|
69 |
const TEXT_DOMAIN = 'yikes-inc-woocommerce-custom-product-tabs';
|
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
|
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 |
// 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 |
$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
|
203 |
* Adds a new tab to the Product Data postbox in the admin product interface
|
204 |
*/
|
205 |
public function render_custom_product_tabs() {
|
206 |
+
echo "<li class=\"yikes_wc_product_tabs_tab\"><a href=\"#yikes_woocommerce_custom_product_tabs\">" . __( 'Custom Tabs', self::TEXT_DOMAIN ) . "</a></li>";
|
207 |
}
|
208 |
|
209 |
|
235 |
|
236 |
echo $this->review_us_container();
|
237 |
|
238 |
+
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>';
|
239 |
+
echo '<div class="dashicons dashicons-editor-help yikes-tabs-how-to-toggle" title="' . __( "Help Me!" , self::TEXT_DOMAIN ) . '"></div>';
|
240 |
|
241 |
// set up the initial display, by looping
|
242 |
foreach ( $tab_data as $tab ) {
|
243 |
if ( $i != 1 ) { ?>
|
244 |
<section class="button-holder" alt="<?php echo $i; ?>">
|
245 |
<!-- Remove tab button, should not generate for the first tab! -->
|
246 |
+
<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>
|
247 |
<div style="text-align:center;margin-top:.5em;">
|
248 |
<span class="dashicons dashicons-arrow-up move-tab-data-up"></span>
|
249 |
<span class="dashicons dashicons-arrow-down move-tab-data-down"></span>
|
257 |
</div>
|
258 |
</section>
|
259 |
<?php }
|
260 |
+
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') );
|
261 |
+
$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' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
if ( $i != count( $tab_data ) ) {
|
263 |
echo '<div class="yikes-woo-custom-tab-divider"></div>';
|
264 |
}
|
267 |
|
268 |
?>
|
269 |
<div id="duplicate_this_row">
|
270 |
+
<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>
|
271 |
<?php
|
272 |
// lets add an empty row, to use for duplicating purposes
|
273 |
+
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' ) );
|
274 |
+
$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' ) );
|
275 |
?>
|
276 |
<section class="button-holder" alt="<?php echo $i; ?>">
|
277 |
<div style="text-align:center;">
|
283 |
|
284 |
<p>
|
285 |
<label style="display:block;" for="_yikes_wc_custom_repeatable_product_tabs_tab_content_<?php echo $i; ?>"></label>
|
286 |
+
<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>
|
287 |
</p>
|
288 |
|
289 |
<?php
|
370 |
if ( ! isset( $field['class'] ) ) $field['class'] = 'short';
|
371 |
if ( ! isset( $field['value'] ) ) $field['value'] = get_post_meta( $thepostid, $field['id'], true );
|
372 |
|
373 |
+
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> ';
|
374 |
|
375 |
if ( isset( $field['description'] ) && $field['description'] ) {
|
376 |
echo '<span class="description">' . $field['description'] . '</span>';
|
378 |
|
379 |
echo '</p>';
|
380 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
381 |
|
382 |
|
383 |
/** Helper methods ******************************************************/
|