Version Description
Release Date - 25 March 2021
- Security update
Download this release
Release Info
Developer | templateinvaders |
Plugin | WooCommerce Wishlist Plugin |
Version | 1.24.4 |
Comparing to | |
See all releases |
Code changes from version 1.24.3 to 1.24.4
- assets/css/admin-form-rtl.min.css +1 -1
- assets/css/admin-form.min.css +1 -1
- assets/css/admin-rtl.min.css +1 -1
- assets/css/admin-setup-rtl.min.css +1 -1
- assets/css/admin-setup.min.css +1 -1
- assets/css/admin.min.css +1 -1
- assets/css/public-rtl.min.css +1 -1
- assets/css/public.min.css +1 -1
- assets/css/theme-rtl.min.css +1 -1
- assets/css/theme.min.css +1 -1
- assets/css/webfont-rtl.min.css +1 -1
- assets/css/webfont.min.css +1 -1
- assets/js/admin.min.js +1 -1
- assets/js/public.min.js +1 -1
- includes/form.helper.php +485 -445
- integrations/advanced-product-fields-for-woocommerce-pro.php +1 -1
- integrations/advanced-product-fields-for-woocommerce.php +1 -0
- integrations/automatewoo.php +1 -1
- integrations/automatewoo/trigger-wishlist-item-added-to-cart.php +28 -21
- integrations/automatewoo/trigger-wishlist-item-added.php +28 -21
- integrations/automatewoo/trigger-wishlist-item-purchased.php +28 -21
- integrations/automatewoo/trigger-wishlist-item-removed.php +28 -21
- integrations/check-pincodezipcode-for-shipping-woocommerce.php +9 -8
- integrations/clever-swatches.php +1 -1
- integrations/mycred.php +1 -1
- integrations/product-extras-for-woocommerce.php +13 -1
- integrations/woocommerce-bookings.php +0 -3
- integrations/woocommerce-gravityforms-product-addons.php +6 -6
- integrations/woocommerce-multilingual.php +0 -2
- integrations/woocommerce-product-table.php +1 -1
- integrations/wp-fastest-cache.php +0 -2
- languages/ti-woocommerce-wishlist.pot +10 -10
- readme.txt +6 -1
- ti-woocommerce-wishlist.php +2 -2
assets/css/admin-form-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
assets/css/admin-form.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
assets/css/admin-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
*{-webkit-box-sizing:border-box;box-sizing:border-box}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
*{-webkit-box-sizing:border-box;box-sizing:border-box}
|
assets/css/admin-setup-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
html{background:#f6f3ed}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
html{background:#f6f3ed}
|
assets/css/admin-setup.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
html{background:#f6f3ed}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
html{background:#f6f3ed}
|
assets/css/admin.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
*{-webkit-box-sizing:border-box;box-sizing:border-box}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
*{-webkit-box-sizing:border-box;box-sizing:border-box}
|
assets/css/public-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
|
assets/css/public.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
|
assets/css/theme-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type="button"],.tinv-wishlist input[type="reset"],.tinv-wishlist input[type="submit"]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type="button"],.tinv-wishlist input[type="reset"],.tinv-wishlist input[type="submit"]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
assets/css/theme.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type="button"],.tinv-wishlist input[type="reset"],.tinv-wishlist input[type="submit"]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type="button"],.tinv-wishlist input[type="reset"],.tinv-wishlist input[type="submit"]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
assets/css/webfont-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi");src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.woff2?ver=xu2uyi") format("woff2"),url("../fonts/tinvwl-webfont.woff?ver=xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.ttf?ver=xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.svg?ver=xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi");src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.woff2?ver=xu2uyi") format("woff2"),url("../fonts/tinvwl-webfont.woff?ver=xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.ttf?ver=xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.svg?ver=xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
assets/css/webfont.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi");src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.woff2?ver=xu2uyi") format("woff2"),url("../fonts/tinvwl-webfont.woff?ver=xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.ttf?ver=xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.svg?ver=xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi");src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.woff2?ver=xu2uyi") format("woff2"),url("../fonts/tinvwl-webfont.woff?ver=xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.ttf?ver=xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.svg?ver=xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
assets/js/admin.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function TInvWL($,h){this.pf="tinvwl",this.g="_",this.ho=h||!1,this.n="TInvWL",this.aj_act=function(t){return[this.pf,t].join(this.g)},this._csel=function(t,n){return"{0}{1}{2}".format(n=n||".",this.pf,t)},this._tm=function(t){var n=$("script#{0}[type='text/template']".format(t));return n.length?n.html():""},this.formElm=function(){if($(this._csel("-form-onoff")).tiwl_onoff(),$("input[type=checkbox][tiwl-show], input[type=checkbox][tiwl-hide]").tiwl_onoffblock(),$("[tiwl-value][tiwl-show], [tiwl-value][tiwl-hide]").tiwl_byvalueblock(),void 0!==$.fn.wpColorPicker){var e=function(t){var n=t.substring(1),i=parseInt(n,16);return.2126*(i>>16&255)+.7152*(i>>8&255)+.0722*(i>>0&255)},n=this._csel("-form-color");$(n).each(function(){var n=$(this),t=$(this).closest(".tinvwl-color-picker"),i=t.find(".tinvwl-eyedropper");n.css("background-color",n.val()),175<e(n.val())&&n.css("color","#000000"),n.iris({mode:"hsv",target:$(this).parent().parent(),change:function(t,n){175<e(n.color.toCSS())?$(this).css("color","#000000"):$(this).css("color",""),$(this).css("background-color",n.color.toCSS())}}),t.on("click",".iris-square-value",function(t){t.preventDefault(),n.iris("toggle")}),i.on("click",function(t){t.preventDefault(),n.iris("show")}),n.on("focusin",function(){n.iris("show")})}),$(document).on("click",function(t){$(t.target).is(n+", .iris-picker, .iris-picker-inner, .iris-slider-offset, .tinvwl-eyedropper, .tinvwl-eyedropper .ftinvwl-eyedropper")?$(n).not($(t.target).closest(".tinvwl-color-picker").find(n)).iris("hide"):$(n).iris("hide")})}},this.wizard_page=function(t){$(t).find("select").change(this._wizard_page_ch),this.wizard_page_ch($(t).find("select"))},this.wizard_page_ch=function(t){var n=(t=$(t)).parent(this._csel("-page-select")),i=n.find("input[type=hidden]").val(),e=n.find(this._csel("-error-icon")),o=n.find(this._csel("-error-desc"));""!==t.val()?(n.removeClass("tinvwl-error"),e.hide(),o.hide()):0==i&&(n.addClass("tinvwl-error"),e.show(),o.show())},this.pageElm=function(){$(this._csel("-header","div.")).prependTo("#wpbody-content"),$(this._csel("-page-select")).each(this._wizard_page),$(".bulkactions [type=submit]").each(this._control_bulkactions),$(".action-search [type=submit]").each(this._control_search)},this.control_bulkactions=function(t){$(t).on("click",this._control_bulkactions_ck)},this.control_bulkactions_ck=function(t,n){var i=(t=$(t)).parents(".bulkactions").eq(0).find("[name=action]"),e=t.parents("form").eq(0);i&&("-1"!==i.val()&&e.find("input[type=checkbox]:checked").length||n.preventDefault())},this.control_search=function(t){$(t).on("click",this._control_search_ck)},this.control_search_ck=function(t,n){var i=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");i&&""===i.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t=this.n;if(this.ho){var n=new Date;t=t+n.getFullYear()+n.getMonth()+n.getDate()}window[t]=this},this.cg(),String.prototype.format||(String.prototype.format=function(){var i=arguments;return this.replace(/{(\d+)}/g,function(t,n){return void 0!==i[n]?i[n]:t})}),function(o){var n=o.n,ho=o.ho,c="";for(var i in ho&&(c="t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),"),o)"function"!=typeof o[i]||"_"===i[0]||o.hasOwnProperty("_"+i)||eval("o._"+i+"=function(a,b,c,d){var n='"+n+"',"+c+"o=window[n]||null;if (o) {return o."+i+"(this,a,b,c,d);};};")}(this)}!function(s){s.fn.tiwl_onoff=function(t){var o=s.extend(!0,{},{value:{on:"",off:""},class:"tiwlform-onoff",wrap:"container",button:"button"},t);return s(this).each(function(){var n=s(this),t=s("<div>").attr({class:o.class+"-"+o.button}),i=o.class+"-"+o.wrap,e=s("<div>").attr({id:n.attr("id")+"_"+o.wrap,class:i});return n.is("input")&&(e.attr("class",e.attr("class")+" "+n.attr("class")),n.is(":disabled")&&(e.toggleClass("disabled",n.is(":disabled")),n.prop("disabled",!1)),e.toggleClass("checked",n.is(":checked")),n.hide().removeAttr("class").wrap(e).before(t),e=n.parent(),n.on("change",function(t){if(e.hasClass("disabled"))return t.preventDefault();e.toggleClass("checked",s(this).is(":checked"))}),e.on("click",function(t){if(e.hasClass("disabled"))return t.preventDefault();n.is(":enabled")&&e.hasClass("checked")===n.is(":checked")&&n.click()})),n})},s.fn.tiwl_onoffblock=function(t){var n={onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},c=s.extend(!0,{},n,t);return s(this).each(function(){function t(){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),e=n.attr("tiwl-hide"),o=c.isChecked.call(n);return"string"==typeof i&&t(i,o),"string"==typeof e&&t(e,!o),n}var n=s(this);return n.is("input")&&"checkbox"==n.attr("type")?(s(this).on("change",t),t.call(n)):n})},s.fn.tiwl_byvalueblock=function(t){var n={onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},i=s.extend(!0,{},n,t);return s(this).each(function(){function t(e){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),o=n.attr("tiwl-hide"),c=e.onClick.call(n);return"string"==typeof i&&t(i,c),"string"==typeof o&&t(o,!c),n}var n=s(this);return n.is("input")||n.is("select")?(s(this).on("change",function(){t.call(this,i)}),t.call(n,i)):n})};var n=new TInvWL(s);s(document).ready(function(){if(n.Run(),jQuery('input[name="general-show_notice"]').change(function(){var t=!jQuery(this).is(":checked"),n=jQuery('input[name="general-redirect_require_login"]');t&&!n.is(":checked")&&n.click().trigger("change"),n.closest(".tiwlform-onoff-container").toggleClass("disabled",t)}).change(),s(".tablenav").each(function(){var t=s(this);s.trim(t.find(".alignleft").html()).length||t.find(".alignleft").remove(),s.trim(t.find(".alignright").html()).length&&!t.find(".tablenav-pages").hasClass("one-page")||(t.find(".alignright").remove(),t.find(".tinv-wishlist-clear").remove()),s.trim(t.html()).length||t.remove()}),s(".tablenav .bulkactions select").addClass("tinvwl-select grey").wrap('<span class="tinvwl-select-wrap">').parent().append('<span class="tinvwl-caret"><span></span></span>'),s(".tablenav .bulkactions .button.action, .tablenav #search-submit").removeClass("button").addClass("tinvwl-btn grey"),s(".tinvwl-modal-btn").on("click",function(){s(this).next(".tinvwl-modal").addClass("tinvwl-modal-open")}),s(".tinvwl-overlay, .tinvwl-close-modal, .tinvwl_button_close").on("click",function(t){t.preventDefault(),s(this).parents(".tinvwl-modal:first").removeClass("tinvwl-modal-open")}),void 0!==s.fn.popover){var t=s(".tinvwl-help");t.popover({content:function(){return s(this).closest(".tinvwl-info-wrap").find(".tinvwl-info-desc").html()}}),t.on("click",function(){s(this).popover("toggle")}),t.on("focusout",function(){s(this).popover("hide")}),s(window).on("resize",function(){t.popover("hide")})}s("body").on("click",".tinvwl-confirm-reset",function(t){t.preventDefault(),confirm(tinvwl_comfirm.text_comfirm_reset)&&s(this).removeClass("tinvwl-confirm-reset").trigger("click")})})}(jQuery);
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function TInvWL($,h){this.pf="tinvwl",this.g="_",this.ho=h||!1,this.n="TInvWL",this.aj_act=function(t){return[this.pf,t].join(this.g)},this._csel=function(t,n){return"{0}{1}{2}".format(n=n||".",this.pf,t)},this._tm=function(t){var n=$("script#{0}[type='text/template']".format(t));return n.length?n.html():""},this.formElm=function(){if($(this._csel("-form-onoff")).tiwl_onoff(),$("input[type=checkbox][tiwl-show], input[type=checkbox][tiwl-hide]").tiwl_onoffblock(),$("[tiwl-value][tiwl-show], [tiwl-value][tiwl-hide]").tiwl_byvalueblock(),void 0!==$.fn.wpColorPicker){var e=function(t){var n=t.substring(1),i=parseInt(n,16);return.2126*(i>>16&255)+.7152*(i>>8&255)+.0722*(i>>0&255)},n=this._csel("-form-color");$(n).each(function(){var n=$(this),t=$(this).closest(".tinvwl-color-picker"),i=t.find(".tinvwl-eyedropper");n.css("background-color",n.val()),175<e(n.val())&&n.css("color","#000000"),n.iris({mode:"hsv",target:$(this).parent().parent(),change:function(t,n){175<e(n.color.toCSS())?$(this).css("color","#000000"):$(this).css("color",""),$(this).css("background-color",n.color.toCSS())}}),t.on("click",".iris-square-value",function(t){t.preventDefault(),n.iris("toggle")}),i.on("click",function(t){t.preventDefault(),n.iris("show")}),n.on("focusin",function(){n.iris("show")})}),$(document).on("click",function(t){$(t.target).is(n+", .iris-picker, .iris-picker-inner, .iris-slider-offset, .tinvwl-eyedropper, .tinvwl-eyedropper .ftinvwl-eyedropper")?$(n).not($(t.target).closest(".tinvwl-color-picker").find(n)).iris("hide"):$(n).iris("hide")})}},this.wizard_page=function(t){$(t).find("select").change(this._wizard_page_ch),this.wizard_page_ch($(t).find("select"))},this.wizard_page_ch=function(t){var n=(t=$(t)).parent(this._csel("-page-select")),i=n.find("input[type=hidden]").val(),e=n.find(this._csel("-error-icon")),o=n.find(this._csel("-error-desc"));""!==t.val()?(n.removeClass("tinvwl-error"),e.hide(),o.hide()):0==i&&(n.addClass("tinvwl-error"),e.show(),o.show())},this.pageElm=function(){$(this._csel("-header","div.")).prependTo("#wpbody-content"),$(this._csel("-page-select")).each(this._wizard_page),$(".bulkactions [type=submit]").each(this._control_bulkactions),$(".action-search [type=submit]").each(this._control_search)},this.control_bulkactions=function(t){$(t).on("click",this._control_bulkactions_ck)},this.control_bulkactions_ck=function(t,n){var i=(t=$(t)).parents(".bulkactions").eq(0).find("[name=action]"),e=t.parents("form").eq(0);i&&("-1"!==i.val()&&e.find("input[type=checkbox]:checked").length||n.preventDefault())},this.control_search=function(t){$(t).on("click",this._control_search_ck)},this.control_search_ck=function(t,n){var i=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");i&&""===i.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t=this.n;if(this.ho){var n=new Date;t=t+n.getFullYear()+n.getMonth()+n.getDate()}window[t]=this},this.cg(),String.prototype.format||(String.prototype.format=function(){var i=arguments;return this.replace(/{(\d+)}/g,function(t,n){return void 0!==i[n]?i[n]:t})}),function(o){var n=o.n,ho=o.ho,c="";for(var i in ho&&(c="t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),"),o)"function"!=typeof o[i]||"_"===i[0]||o.hasOwnProperty("_"+i)||eval("o._"+i+"=function(a,b,c,d){var n='"+n+"',"+c+"o=window[n]||null;if (o) {return o."+i+"(this,a,b,c,d);};};")}(this)}!function(s){s.fn.tiwl_onoff=function(t){var o=s.extend(!0,{},{value:{on:"",off:""},class:"tiwlform-onoff",wrap:"container",button:"button"},t);return s(this).each(function(){var n=s(this),t=s("<div>").attr({class:o.class+"-"+o.button}),i=o.class+"-"+o.wrap,e=s("<div>").attr({id:n.attr("id")+"_"+o.wrap,class:i});return n.is("input")&&(e.attr("class",e.attr("class")+" "+n.attr("class")),n.is(":disabled")&&(e.toggleClass("disabled",n.is(":disabled")),n.prop("disabled",!1)),e.toggleClass("checked",n.is(":checked")),n.hide().removeAttr("class").wrap(e).before(t),e=n.parent(),n.on("change",function(t){if(e.hasClass("disabled"))return t.preventDefault();e.toggleClass("checked",s(this).is(":checked"))}),e.on("click",function(t){if(e.hasClass("disabled"))return t.preventDefault();n.is(":enabled")&&e.hasClass("checked")===n.is(":checked")&&n.click()})),n})},s.fn.tiwl_onoffblock=function(t){var n={onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},c=s.extend(!0,{},n,t);return s(this).each(function(){function t(){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),e=n.attr("tiwl-hide"),o=c.isChecked.call(n);return"string"==typeof i&&t(i,o),"string"==typeof e&&t(e,!o),n}var n=s(this);return n.is("input")&&"checkbox"==n.attr("type")?(s(this).on("change",t),t.call(n)):n})},s.fn.tiwl_byvalueblock=function(t){var n={onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},i=s.extend(!0,{},n,t);return s(this).each(function(){function t(e){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),o=n.attr("tiwl-hide"),c=e.onClick.call(n);return"string"==typeof i&&t(i,c),"string"==typeof o&&t(o,!c),n}var n=s(this);return n.is("input")||n.is("select")?(s(this).on("change",function(){t.call(this,i)}),t.call(n,i)):n})};var n=new TInvWL(s);s(document).ready(function(){if(n.Run(),jQuery('input[name="general-show_notice"]').change(function(){var t=!jQuery(this).is(":checked"),n=jQuery('input[name="general-redirect_require_login"]');t&&!n.is(":checked")&&n.click().trigger("change"),n.closest(".tiwlform-onoff-container").toggleClass("disabled",t)}).change(),s(".tablenav").each(function(){var t=s(this);s.trim(t.find(".alignleft").html()).length||t.find(".alignleft").remove(),s.trim(t.find(".alignright").html()).length&&!t.find(".tablenav-pages").hasClass("one-page")||(t.find(".alignright").remove(),t.find(".tinv-wishlist-clear").remove()),s.trim(t.html()).length||t.remove()}),s(".tablenav .bulkactions select").addClass("tinvwl-select grey").wrap('<span class="tinvwl-select-wrap">').parent().append('<span class="tinvwl-caret"><span></span></span>'),s(".tablenav .bulkactions .button.action, .tablenav #search-submit").removeClass("button").addClass("tinvwl-btn grey"),s(".tinvwl-modal-btn").on("click",function(){s(this).next(".tinvwl-modal").addClass("tinvwl-modal-open")}),s(".tinvwl-overlay, .tinvwl-close-modal, .tinvwl_button_close").on("click",function(t){t.preventDefault(),s(this).parents(".tinvwl-modal:first").removeClass("tinvwl-modal-open")}),void 0!==s.fn.popover){var t=s(".tinvwl-help");t.popover({content:function(){return s(this).closest(".tinvwl-info-wrap").find(".tinvwl-info-desc").html()}}),t.on("click",function(){s(this).popover("toggle")}),t.on("focusout",function(){s(this).popover("hide")}),s(window).on("resize",function(){t.popover("hide")})}s("body").on("click",".tinvwl-confirm-reset",function(t){t.preventDefault(),confirm(tinvwl_comfirm.text_comfirm_reset)&&s(this).removeClass("tinvwl-confirm-reset").trigger("click")})})}(jQuery);
|
assets/js/public.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function showTooltip(t,i){t.setAttribute("class","social social-clipboard tooltipped tooltipped-s"),t.setAttribute("aria-label",i)}function clearTooltip(t){t.currentTarget.setAttribute("class","social social-clipboard "),t.currentTarget.removeAttribute("aria-label")}!function(c){c.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href.split("?")[0],text_create:window.tinvwl_add_to_wishlist.text_create,text_already_in:window.tinvwl_add_to_wishlist.text_already_in,class:{dialogbox:".tinvwl_add_to_select_wishlist",select:".tinvwl_wishlist",newtitle:".tinvwl_new_input",dialogbutton:".tinvwl_button_add"},redirectTimer:null,onPrepareList:function(){},onGetDialogBox:function(){},onPrepareDialogBox:function(){c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){c(this).append(c("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){c(t).addClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){c(t).removeClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(c(this).is(".disabled-add-wishlist"))return!1;c(this).is(".ftinvwl-animated")&&c(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):e.onActionProduct.call(this)},onPrepareDataAction:function(t,i){c("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){t=t||[];var o={};return c("form.cart[method=post], .woocommerce-variation-add-to-cart, form.vtajaxform[method=post]").find("input, select").each(function(){var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val();("checkbox"!==i&&"radio"!==i||c(this).is(":checked"))&&(o["form"+t]=n)}),o=o.formvariation_id,t.filter(function(t){if("object"!==_typeof(t.in)||"string"!=typeof o)return t.in;var i=parseInt(o);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=e.onPrepareList.call(t)||t,t=e.filterProductAlreadyIn.call(this,t)||t,c(this).parent().parent().find(".already-in").remove();var n="";switch(t.length){case 0:break;default:n=c("<ul>");c.each(t,function(t,i){n.append(c("<li>").html(c("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}n.length&&c(this).closest(".tinv-modal-inner").find("img").after(c("<div>").addClass("already-in").html(e.text_already_in+" ").append(n))},onAction:{redirect:function(t){e.redirectTimer&&clearTimeout(e.redirectTimer),e.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(){},msg:function(t){if(!t)return!1;var i=c(t).eq(0);c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c("body > .tinv-wishlist").append(i),i.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),i.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer)})},status:function(t){c("body").trigger("tinvwl_wishlist_added_status",[this,t])},removed:function(){},make_remove:function(){},wishlists_data:function(t){d(JSON.stringify(t))}}};i.onActionProduct=function(t,i){var r={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:c(this).attr("data-tinv-wl-producttype"),product_id:c(this).attr("data-tinv-wl-product")||0,product_variation:c(this).attr("data-tinv-wl-productvariation")||0,product_action:c(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},n=this,o=[],d=new FormData;tinvwl_add_to_wishlist.wpml&&(r.lang=tinvwl_add_to_wishlist.wpml),c('form.cart[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"], form.vtajaxform[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),o.length||(c(n).closest("form.cart[method=post], form.vtajaxform[method=post]").each(function(){o.push(c(this))}),o.length||o.push(c("form.cart[method=post]"))),c('.tinv-wraper[data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),c.each(o,function(t,i){c(i).find("input:not(:disabled), select:not(:disabled), textarea:not(:disabled)").each(function(){function e(t,i){if("object"!==_typeof(i))return i;for(var n in void 0===t&&(t={}),i)if(""===n){var o=-1;for(o in t)o=o;t[o=parseInt(o)+1]=e(t[n],i[n])}else t[n]=e(t[n],i[n]);return t}var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val(),o=10;if("button"!==i&&void 0!==t){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<o;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=n,n=l}t=a[1],o--}if("file"===i){var s=c(this)[0].files;s&&d.append(t,s[0])}"checkbox"===i||"radio"===i?c(this).is(":checked")&&(n.length||"object"===_typeof(n)||(n=!0),r.form[t]=e(r.form[t],n)):r.form[t]=e(r.form[t],n)}})}),r=e.onPrepareDataAction.call(n,n,r)||r,c.each(r,function(n,t){"form"===n?c.each(t,function(t,i){"object"===_typeof(i)&&(i=JSON.stringify(i)),d.append(n+"["+t+"]",i)}):d.append(n,t)}),c.ajax({url:e.api_url,method:"POST",contentType:!1,processData:!1,data:d}).done(function(t){if(e.onDialogHide.call(n.tinvwl_dialog,n),"object"===_typeof(t))for(var i in t)"function"==typeof e.onAction[i]&&e.onAction[i].call(n,t[i]);else"function"==typeof e.onAction.msg&&e.onAction.msg.call(n,t)})};var e=c.extend(!0,{},i,t);return c(this).each(function(){if(!c(this).attr("data-tinv-wl-list"))return!1;if(e.dialogbox&&e.dialogbox.length&&(this.tinvwl_dialog=e.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=e.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=c(this).nextAll(e.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(this.tinvwl_dialog){e.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var n=c(this).find(e.class.select).eq(0);c(this).find(e.class.newtitle).hide().val(""),n.html(""),c.each(t,function(t,i){e.onCreateWishList.call(n,i)}),e.text_create&&e.onCreateWishList.call(n,{ID:"",title:e.text_create,in:!1}),e.onMultiProductAlreadyIn.call(n,t),e.onSelectWishList.call(n,t),c(this).find(e.class.newtitle).toggle(""===n.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=JSON.parse(c(this).attr("data-tinv-wl-list"))||[];t.length?(t=e.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),e.onDialogShow.call(this.tinvwl_dialog,this)):e.onActionProduct.call(this)});var o=this;c(this.tinvwl_dialog).find(e.class.dialogbutton).off("click").on("click",function(){var t,i=c(o.tinvwl_dialog).find(e.class.select),n=c(o.tinvwl_dialog).find(e.class.newtitle);i.val()||n.val()?e.onActionProduct.call(o,i.val(),n.val()):((t=n.is(":visible")?n:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})}c(this).off("click").on("click",e.onClick),e.onInited.call(this,e)})},c(document).ready(function(){c("body").on("click",".tinvwl_add_to_wishlist_button",function(t){if(c("body").trigger("tinvwl_add_to_wishlist_button_click",[this]),c(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);c(this).is(".inited-add-wishlist")||c(this).tinvwl_to_wishlist({onInited:function(t){c(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),c(document).on("hide_variation",".variations_form",function(t){var i=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(i.attr("data-tinv-wl-productvariation",0),i.length&&i.attr("data-tinv-wl-list")){var n=JSON.parse(i.attr("data-tinv-wl-list")),o=!1,e="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var a in n)n[a].hasOwnProperty("in")&&Array.isArray(n[a].in)&&-1<(n[a].in||[]).indexOf(0)&&(o=!0);i.toggleClass("tinvwl-product-in-list",o).toggleClass("tinvwl-product-make-remove",o&&e).attr("data-tinv-wl-action",o&&e?"remove":"addto")}i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),c(document).on("show_variation",".variations_form",function(t,i,n){var o=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(o.attr("data-tinv-wl-productvariation",i.variation_id),o.length&&o.attr("data-tinv-wl-list")){var e=JSON.parse(o.attr("data-tinv-wl-list")),a=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var s in e)e[s].hasOwnProperty("in")&&Array.isArray(e[s].in)&&-1<(e[s].in||[]).indexOf(i.variation_id)&&(a=!0);o.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&l).attr("data-tinv-wl-action",a&&l?"remove":"addto")}t.preventDefault(),o.removeClass("disabled-add-wishlist")}),c(window).on("storage onstorage",function(t){if(s===t.originalEvent.key&&localStorage.getItem(s)!==sessionStorage.getItem(s)&&localStorage.getItem(s)){var i=JSON.parse(localStorage.getItem(s));"object"===_typeof(i)&&null!==i&&(i.hasOwnProperty("products")||i.hasOwnProperty("counter"))&&d(localStorage.getItem(s))}});var n=[],i=!1;c("a.tinvwl_add_to_wishlist_button").each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))}),c(".wishlist_products_counter_number").each(function(){i=!0});function o(){if(n.length||i){var t={};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.plugin_url+"includes/api/ajax.php",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)}).fail(function(){!function(){if(n.length||i){var t={ids:n,counter:i,tinvwl_request:!0};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.rest_root+"wishlist/v1/products",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)})}}()})}}function e(){if(l&&(tinvwl_add_to_wishlist.update_wishlists_data&&localStorage.setItem(s,""),localStorage.getItem(s))){var t=JSON.parse(localStorage.getItem(s));if("object"===_typeof(t)&&null!==t&&(t.hasOwnProperty("products")||t.hasOwnProperty("counter"))&&(!t.hasOwnProperty("lang")&&!tinvwl_add_to_wishlist.wpml||tinvwl_add_to_wishlist.wpml&&t.lang===tinvwl_add_to_wishlist.wpml))return void r(t)}tinvwl_add_to_wishlist.block_ajax_wishlists_data||o()}e();var t=new MutationObserver(function(t){n=[],t.forEach(function(t){var i=t.addedNodes;null!==i&&c(i).each(function(){var t=c(this).find(".tinvwl_add_to_wishlist_button");t.length&&t.each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))})})}),n.length&&e()}),a=document.body;t.observe(a,{childList:!0,subtree:!0})});var l=!0,s=tinvwl_add_to_wishlist.hash_key;try{l="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("ti","test"),window.sessionStorage.removeItem("ti"),window.localStorage.setItem("ti","test"),window.localStorage.removeItem("ti")}catch(t){l=!1}function r(t){var l="1"==window.tinvwl_add_to_wishlist.simple_flow;l&&c("a.tinvwl_add_to_wishlist_button").each(function(){c(this).removeClass("tinvwl-product-make-remove").removeClass("tinvwl-product-already-on-wishlist").removeClass("tinvwl-product-in-list").attr("data-tinv-wl-action","addto").attr("data-tinv-wl-list","[]")}),c("body").trigger("tinvwl_wishlist_mark_products",[t]),c.each(t.products,function(t,e){var a=t;c('a.tinvwl_add_to_wishlist_button[data-tinv-wl-product="'+a+'"]').each(function(){var t=parseInt(c(this).attr("data-tinv-wl-productvariation")),i=c(this).data("tinv-wl-productvariations")||[],n=!1;for(var o in e)e[o].hasOwnProperty("in")&&Array.isArray(e[o].in)&&(-1<(e[o].in||[]).indexOf(a)||-1<(e[o].in||[]).indexOf(t)||i.some(function(t){return 0<=(e[o].in||[]).indexOf(t)}))&&(n=!0);c("body").trigger("tinvwl_wishlist_product_marked",[this,n]),c(this).attr("data-tinv-wl-list",JSON.stringify(e)).toggleClass("tinvwl-product-in-list",n).toggleClass("tinvwl-product-make-remove",n&&l).attr("data-tinv-wl-action",n&&l?"remove":"addto")})}),function(t){"1"==window.tinvwl_add_to_wishlist.hide_zero_counter&&0===t&&(t="false");jQuery("i.wishlist-icon").addClass("added"),"false"!==t?(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html(t),jQuery("i.wishlist-icon").attr("data-icon-label",t)):(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html("").closest("span.wishlist-counter-with-products").removeClass("wishlist-counter-with-products"),jQuery("i.wishlist-icon").removeAttr("data-icon-label"));var i=!("0"==t||"false"==t);jQuery(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",i),setTimeout(function(){jQuery("i.wishlist-icon").removeClass("added")},500)}(t.counter)}function d(t){l&&(localStorage.setItem(s,t),sessionStorage.setItem(s,t),r(JSON.parse(t)))}}(jQuery),function(o){o(document).ready(function(){if(o("#tinvwl_manage_actions, #tinvwl_product_actions").addClass("form-control").parent().wrapInner('<div class="tinvwl-input-group tinvwl-no-full">').find("button").wrap('<span class="tinvwl-input-group-btn">'),o(".tinv-lists-nav").each(function(){o(this).html().trim().length||o(this).remove()}),o("body").on("click",".social-buttons .social:not(.social-email,.social-whatsapp,.social-clipboard)",function(t){var i=window.open(o(this).attr("href"),o(this).attr("title"),"width=420,height=320,resizable=yes,scrollbars=yes,status=yes");i&&(i.focus(),t.preventDefault())}),"undefined"!=typeof ClipboardJS){new ClipboardJS(".social-buttons .social.social-clipboard",{text:function(t){return t.getAttribute("href")}}).on("success",function(t){showTooltip(t.trigger,tinvwl_add_to_wishlist.tinvwl_clipboard)});for(var t=document.querySelectorAll(".social-buttons .social.social-clipboard"),i=0;i<t.length;i++)t[i].addEventListener("mouseleave",clearTooltip),t[i].addEventListener("blur",clearTooltip)}o("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),o("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),o(this).parents(".tinv-modal:first").removeClass("tinv-modal-open"),o("body").trigger("tinvwl_modal_closed",[this])}),o("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){o(this).data("url")&&(t.preventDefault(),window.location=o(this).data("url"))});var n=o(".tinv-wishlist .navigation-button");n.length&&n.each(function(){var t=o(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),o(".tinv-login .showlogin").off("click").on("click",function(t){t.preventDefault(),o(this).closest(".tinv-login").find(".login").toggle()}),o(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){o(this).toggle(!!o(this).children().not(".look_in").length||!!o(this).children(".look_in").children().length)})})}(jQuery),function(o){o.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return o(this).val()},rule:function(){var t=o(this).parents("form").eq(0).find(n.selector),i=n.invert;return 0===t.length?n.ifempty:(t.each(function(){i&&!n.invert||!i&&n.invert||(i=Boolean(n.validate.call(o(this))))}),i)}},n=o.extend(!0,{},i,t);return o(this).each(function(){o(this).on("click",function(t){n.rule.call(o(this))||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault())})})},o(document).ready(function(){o(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),o(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return o(this).is(":checked")}}),o(".global-cb").on("click",function(){o(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",o(this).is(":checked"))})})}(jQuery);
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.24.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function showTooltip(t,i){t.setAttribute("class","social social-clipboard tooltipped tooltipped-s"),t.setAttribute("aria-label",i)}function clearTooltip(t){t.currentTarget.setAttribute("class","social social-clipboard "),t.currentTarget.removeAttribute("aria-label")}!function(c){c.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href.split("?")[0],text_create:window.tinvwl_add_to_wishlist.text_create,text_already_in:window.tinvwl_add_to_wishlist.text_already_in,class:{dialogbox:".tinvwl_add_to_select_wishlist",select:".tinvwl_wishlist",newtitle:".tinvwl_new_input",dialogbutton:".tinvwl_button_add"},redirectTimer:null,onPrepareList:function(){},onGetDialogBox:function(){},onPrepareDialogBox:function(){c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){c(this).append(c("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){c(t).addClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){c(t).removeClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(c(this).is(".disabled-add-wishlist"))return!1;c(this).is(".ftinvwl-animated")&&c(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):e.onActionProduct.call(this)},onPrepareDataAction:function(t,i){c("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){t=t||[];var o={};return c("form.cart[method=post], .woocommerce-variation-add-to-cart, form.vtajaxform[method=post]").find("input, select").each(function(){var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val();("checkbox"!==i&&"radio"!==i||c(this).is(":checked"))&&(o["form"+t]=n)}),o=o.formvariation_id,t.filter(function(t){if("object"!==_typeof(t.in)||"string"!=typeof o)return t.in;var i=parseInt(o);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=e.onPrepareList.call(t)||t,t=e.filterProductAlreadyIn.call(this,t)||t,c(this).parent().parent().find(".already-in").remove();var n="";switch(t.length){case 0:break;default:n=c("<ul>");c.each(t,function(t,i){n.append(c("<li>").html(c("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}n.length&&c(this).closest(".tinv-modal-inner").find("img").after(c("<div>").addClass("already-in").html(e.text_already_in+" ").append(n))},onAction:{redirect:function(t){e.redirectTimer&&clearTimeout(e.redirectTimer),e.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(){},msg:function(t){if(!t)return!1;var i=c(t).eq(0);c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c("body > .tinv-wishlist").append(i),i.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),i.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer)})},status:function(t){c("body").trigger("tinvwl_wishlist_added_status",[this,t])},removed:function(){},make_remove:function(){},wishlists_data:function(t){d(JSON.stringify(t))}}};i.onActionProduct=function(t,i){var r={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:c(this).attr("data-tinv-wl-producttype"),product_id:c(this).attr("data-tinv-wl-product")||0,product_variation:c(this).attr("data-tinv-wl-productvariation")||0,product_action:c(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},n=this,o=[],d=new FormData;tinvwl_add_to_wishlist.wpml&&(r.lang=tinvwl_add_to_wishlist.wpml),c('form.cart[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"], form.vtajaxform[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),o.length||(c(n).closest("form.cart[method=post], form.vtajaxform[method=post]").each(function(){o.push(c(this))}),o.length||o.push(c("form.cart[method=post]"))),c('.tinv-wraper[data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),c.each(o,function(t,i){c(i).find("input:not(:disabled), select:not(:disabled), textarea:not(:disabled)").each(function(){function e(t,i){if("object"!==_typeof(i))return i;for(var n in void 0===t&&(t={}),i)if(""===n){var o=-1;for(o in t)o=o;t[o=parseInt(o)+1]=e(t[n],i[n])}else t[n]=e(t[n],i[n]);return t}var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val(),o=10;if("button"!==i&&void 0!==t){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<o;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=n,n=l}t=a[1],o--}if("file"===i){var s=c(this)[0].files;s&&d.append(t,s[0])}"checkbox"===i||"radio"===i?c(this).is(":checked")&&(n.length||"object"===_typeof(n)||(n=!0),r.form[t]=e(r.form[t],n)):r.form[t]=e(r.form[t],n)}})}),r=e.onPrepareDataAction.call(n,n,r)||r,c.each(r,function(n,t){"form"===n?c.each(t,function(t,i){"object"===_typeof(i)&&(i=JSON.stringify(i)),d.append(n+"["+t+"]",i)}):d.append(n,t)}),c.ajax({url:e.api_url,method:"POST",contentType:!1,processData:!1,data:d}).done(function(t){if(e.onDialogHide.call(n.tinvwl_dialog,n),"object"===_typeof(t))for(var i in t)"function"==typeof e.onAction[i]&&e.onAction[i].call(n,t[i]);else"function"==typeof e.onAction.msg&&e.onAction.msg.call(n,t)})};var e=c.extend(!0,{},i,t);return c(this).each(function(){if(!c(this).attr("data-tinv-wl-list"))return!1;if(e.dialogbox&&e.dialogbox.length&&(this.tinvwl_dialog=e.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=e.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=c(this).nextAll(e.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(this.tinvwl_dialog){e.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var n=c(this).find(e.class.select).eq(0);c(this).find(e.class.newtitle).hide().val(""),n.html(""),c.each(t,function(t,i){e.onCreateWishList.call(n,i)}),e.text_create&&e.onCreateWishList.call(n,{ID:"",title:e.text_create,in:!1}),e.onMultiProductAlreadyIn.call(n,t),e.onSelectWishList.call(n,t),c(this).find(e.class.newtitle).toggle(""===n.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=JSON.parse(c(this).attr("data-tinv-wl-list"))||[];t.length?(t=e.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),e.onDialogShow.call(this.tinvwl_dialog,this)):e.onActionProduct.call(this)});var o=this;c(this.tinvwl_dialog).find(e.class.dialogbutton).off("click").on("click",function(){var t,i=c(o.tinvwl_dialog).find(e.class.select),n=c(o.tinvwl_dialog).find(e.class.newtitle);i.val()||n.val()?e.onActionProduct.call(o,i.val(),n.val()):((t=n.is(":visible")?n:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})}c(this).off("click").on("click",e.onClick),e.onInited.call(this,e)})},c(document).ready(function(){c("body").on("click",".tinvwl_add_to_wishlist_button",function(t){if(c("body").trigger("tinvwl_add_to_wishlist_button_click",[this]),c(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);c(this).is(".inited-add-wishlist")||c(this).tinvwl_to_wishlist({onInited:function(t){c(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),c(document).on("hide_variation",".variations_form",function(t){var i=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(i.attr("data-tinv-wl-productvariation",0),i.length&&i.attr("data-tinv-wl-list")){var n=JSON.parse(i.attr("data-tinv-wl-list")),o=!1,e="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var a in n)n[a].hasOwnProperty("in")&&Array.isArray(n[a].in)&&-1<(n[a].in||[]).indexOf(0)&&(o=!0);i.toggleClass("tinvwl-product-in-list",o).toggleClass("tinvwl-product-make-remove",o&&e).attr("data-tinv-wl-action",o&&e?"remove":"addto")}i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),c(document).on("show_variation",".variations_form",function(t,i,n){var o=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(o.attr("data-tinv-wl-productvariation",i.variation_id),o.length&&o.attr("data-tinv-wl-list")){var e=JSON.parse(o.attr("data-tinv-wl-list")),a=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var s in e)e[s].hasOwnProperty("in")&&Array.isArray(e[s].in)&&-1<(e[s].in||[]).indexOf(i.variation_id)&&(a=!0);o.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&l).attr("data-tinv-wl-action",a&&l?"remove":"addto")}t.preventDefault(),o.removeClass("disabled-add-wishlist")}),c(window).on("storage onstorage",function(t){if(s===t.originalEvent.key&&localStorage.getItem(s)!==sessionStorage.getItem(s)&&localStorage.getItem(s)){var i=JSON.parse(localStorage.getItem(s));"object"===_typeof(i)&&null!==i&&(i.hasOwnProperty("products")||i.hasOwnProperty("counter"))&&d(localStorage.getItem(s))}});var n=[],i=!1;c("a.tinvwl_add_to_wishlist_button").each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))}),c(".wishlist_products_counter_number").each(function(){i=!0});function o(){if(n.length||i){var t={};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.plugin_url+"includes/api/ajax.php",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)}).fail(function(){!function(){if(n.length||i){var t={ids:n,counter:i,tinvwl_request:!0};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.rest_root+"wishlist/v1/products",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)})}}()})}}function e(){if(l&&(tinvwl_add_to_wishlist.update_wishlists_data&&localStorage.setItem(s,""),localStorage.getItem(s))){var t=JSON.parse(localStorage.getItem(s));if("object"===_typeof(t)&&null!==t&&(t.hasOwnProperty("products")||t.hasOwnProperty("counter"))&&(!t.hasOwnProperty("lang")&&!tinvwl_add_to_wishlist.wpml||tinvwl_add_to_wishlist.wpml&&t.lang===tinvwl_add_to_wishlist.wpml))return void r(t)}tinvwl_add_to_wishlist.block_ajax_wishlists_data||o()}e();var t=new MutationObserver(function(t){n=[],t.forEach(function(t){var i=t.addedNodes;null!==i&&c(i).each(function(){var t=c(this).find(".tinvwl_add_to_wishlist_button");t.length&&t.each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))})})}),n.length&&e()}),a=document.body;t.observe(a,{childList:!0,subtree:!0})});var l=!0,s=tinvwl_add_to_wishlist.hash_key;try{l="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("ti","test"),window.sessionStorage.removeItem("ti"),window.localStorage.setItem("ti","test"),window.localStorage.removeItem("ti")}catch(t){l=!1}function r(t){var l="1"==window.tinvwl_add_to_wishlist.simple_flow;l&&c("a.tinvwl_add_to_wishlist_button").each(function(){c(this).removeClass("tinvwl-product-make-remove").removeClass("tinvwl-product-already-on-wishlist").removeClass("tinvwl-product-in-list").attr("data-tinv-wl-action","addto").attr("data-tinv-wl-list","[]")}),c("body").trigger("tinvwl_wishlist_mark_products",[t]),c.each(t.products,function(t,e){var a=t;c('a.tinvwl_add_to_wishlist_button[data-tinv-wl-product="'+a+'"]').each(function(){var t=parseInt(c(this).attr("data-tinv-wl-productvariation")),i=c(this).data("tinv-wl-productvariations")||[],n=!1;for(var o in e)e[o].hasOwnProperty("in")&&Array.isArray(e[o].in)&&(-1<(e[o].in||[]).indexOf(a)||-1<(e[o].in||[]).indexOf(t)||i.some(function(t){return 0<=(e[o].in||[]).indexOf(t)}))&&(n=!0);c("body").trigger("tinvwl_wishlist_product_marked",[this,n]),c(this).attr("data-tinv-wl-list",JSON.stringify(e)).toggleClass("tinvwl-product-in-list",n).toggleClass("tinvwl-product-make-remove",n&&l).attr("data-tinv-wl-action",n&&l?"remove":"addto")})}),function(t){"1"==window.tinvwl_add_to_wishlist.hide_zero_counter&&0===t&&(t="false");jQuery("i.wishlist-icon").addClass("added"),"false"!==t?(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html(t),jQuery("i.wishlist-icon").attr("data-icon-label",t)):(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html("").closest("span.wishlist-counter-with-products").removeClass("wishlist-counter-with-products"),jQuery("i.wishlist-icon").removeAttr("data-icon-label"));var i=!("0"==t||"false"==t);jQuery(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",i),setTimeout(function(){jQuery("i.wishlist-icon").removeClass("added")},500)}(t.counter)}function d(t){l&&(localStorage.setItem(s,t),sessionStorage.setItem(s,t),r(JSON.parse(t)))}}(jQuery),function(o){o(document).ready(function(){if(o("#tinvwl_manage_actions, #tinvwl_product_actions").addClass("form-control").parent().wrapInner('<div class="tinvwl-input-group tinvwl-no-full">').find("button").wrap('<span class="tinvwl-input-group-btn">'),o(".tinv-lists-nav").each(function(){o(this).html().trim().length||o(this).remove()}),o("body").on("click",".social-buttons .social:not(.social-email,.social-whatsapp,.social-clipboard)",function(t){var i=window.open(o(this).attr("href"),o(this).attr("title"),"width=420,height=320,resizable=yes,scrollbars=yes,status=yes");i&&(i.focus(),t.preventDefault())}),"undefined"!=typeof ClipboardJS){new ClipboardJS(".social-buttons .social.social-clipboard",{text:function(t){return t.getAttribute("href")}}).on("success",function(t){showTooltip(t.trigger,tinvwl_add_to_wishlist.tinvwl_clipboard)});for(var t=document.querySelectorAll(".social-buttons .social.social-clipboard"),i=0;i<t.length;i++)t[i].addEventListener("mouseleave",clearTooltip),t[i].addEventListener("blur",clearTooltip)}o("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),o("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),o(this).parents(".tinv-modal:first").removeClass("tinv-modal-open"),o("body").trigger("tinvwl_modal_closed",[this])}),o("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){o(this).data("url")&&(t.preventDefault(),window.location=o(this).data("url"))});var n=o(".tinv-wishlist .navigation-button");n.length&&n.each(function(){var t=o(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),o(".tinv-login .showlogin").off("click").on("click",function(t){t.preventDefault(),o(this).closest(".tinv-login").find(".login").toggle()}),o(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){o(this).toggle(!!o(this).children().not(".look_in").length||!!o(this).children(".look_in").children().length)})})}(jQuery),function(o){o.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return o(this).val()},rule:function(){var t=o(this).parents("form").eq(0).find(n.selector),i=n.invert;return 0===t.length?n.ifempty:(t.each(function(){i&&!n.invert||!i&&n.invert||(i=Boolean(n.validate.call(o(this))))}),i)}},n=o.extend(!0,{},i,t);return o(this).each(function(){o(this).on("click",function(t){n.rule.call(o(this))||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault())})})},o(document).ready(function(){o(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),o(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return o(this).is(":checked")}}),o(".global-cb").on("click",function(){o(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",o(this).is(":checked"))})})}(jQuery);
|
includes/form.helper.php
CHANGED
@@ -7,14 +7,15 @@
|
|
7 |
*/
|
8 |
|
9 |
// If this file is called directly, abort.
|
10 |
-
if (
|
11 |
die;
|
12 |
}
|
13 |
|
14 |
/**
|
15 |
* Form plugin class
|
16 |
*/
|
17 |
-
class TInvWL_Form
|
|
|
18 |
|
19 |
/**
|
20 |
* Prefix for id elements
|
@@ -42,7 +43,8 @@ class TInvWL_Form {
|
|
42 |
*
|
43 |
* @param string $plugin_name Plugin name.
|
44 |
*/
|
45 |
-
public static function _init(
|
|
|
46 |
self::$_name = $plugin_name;
|
47 |
}
|
48 |
|
@@ -54,27 +56,28 @@ class TInvWL_Form {
|
|
54 |
*
|
55 |
* @return mixed
|
56 |
*/
|
57 |
-
public function __call(
|
|
|
58 |
$_arg = array(
|
59 |
0 => null,
|
60 |
1 => null,
|
61 |
2 => null,
|
62 |
3 => null,
|
63 |
);
|
64 |
-
foreach (
|
65 |
-
$_arg[
|
66 |
-
}
|
67 |
-
$arg
|
68 |
-
$glue
|
69 |
-
$method = sprintf(
|
70 |
-
if (
|
71 |
-
if (
|
72 |
-
$data = call_user_func(
|
73 |
echo $data; // WPCS: xss ok.
|
74 |
}
|
75 |
} else {
|
76 |
-
if (
|
77 |
-
return call_user_func(
|
78 |
}
|
79 |
}
|
80 |
|
@@ -89,8 +92,9 @@ class TInvWL_Form {
|
|
89 |
*
|
90 |
* @return mixed
|
91 |
*/
|
92 |
-
public static function __callStatic(
|
93 |
-
|
|
|
94 |
self::$_name = TINVWL_PREFIX;
|
95 |
}
|
96 |
$_arg = array(
|
@@ -99,20 +103,20 @@ class TInvWL_Form {
|
|
99 |
2 => null,
|
100 |
3 => null,
|
101 |
);
|
102 |
-
foreach (
|
103 |
-
$_arg[
|
104 |
-
}
|
105 |
-
$arg
|
106 |
-
$glue
|
107 |
-
$method = sprintf(
|
108 |
-
if (
|
109 |
-
if (
|
110 |
-
$data = call_user_func(
|
111 |
echo $data; // WPCS: xss ok.
|
112 |
}
|
113 |
} else {
|
114 |
-
if (
|
115 |
-
return call_user_func(
|
116 |
}
|
117 |
}
|
118 |
|
@@ -128,24 +132,25 @@ class TInvWL_Form {
|
|
128 |
*
|
129 |
* @return string
|
130 |
*/
|
131 |
-
public static function _text(
|
|
|
132 |
$load = true;
|
133 |
-
if (
|
134 |
-
if (
|
135 |
-
$load = (bool)
|
136 |
-
unset(
|
137 |
}
|
138 |
}
|
139 |
-
if (
|
140 |
-
$value = self::getvalue(
|
141 |
}
|
142 |
$defaults = array(
|
143 |
-
'type'
|
144 |
-
'name'
|
145 |
'value' => $value,
|
146 |
);
|
147 |
|
148 |
-
return sprintf(
|
149 |
}
|
150 |
|
151 |
/**
|
@@ -157,23 +162,24 @@ class TInvWL_Form {
|
|
157 |
*
|
158 |
* @return string
|
159 |
*/
|
160 |
-
public static function _number(
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
164 |
$extra['class'] .= $class;
|
165 |
} else {
|
166 |
$extra['class'] = $class;
|
167 |
}
|
168 |
} else {
|
169 |
-
$extra .= sprintf(
|
170 |
}
|
171 |
-
if (
|
172 |
-
$data = array(
|
173 |
}
|
174 |
$data['type'] = 'number';
|
175 |
|
176 |
-
return self::_text(
|
177 |
}
|
178 |
|
179 |
/**
|
@@ -187,32 +193,33 @@ class TInvWL_Form {
|
|
187 |
* @see colorpicker
|
188 |
*
|
189 |
*/
|
190 |
-
public static function _color(
|
191 |
-
|
192 |
-
$
|
193 |
-
|
194 |
-
|
|
|
195 |
$extra['class'] .= $class;
|
196 |
} else {
|
197 |
$extra['class'] = $class;
|
198 |
}
|
199 |
-
if (
|
200 |
-
$load = (bool)
|
201 |
-
unset(
|
202 |
}
|
203 |
} else {
|
204 |
-
$extra .= sprintf(
|
205 |
}
|
206 |
-
if (
|
207 |
-
$value = self::getvalue(
|
208 |
}
|
209 |
$defaults = array(
|
210 |
-
'type'
|
211 |
-
'name'
|
212 |
'value' => $value,
|
213 |
);
|
214 |
|
215 |
-
return sprintf(
|
216 |
}
|
217 |
|
218 |
/**
|
@@ -226,32 +233,33 @@ class TInvWL_Form {
|
|
226 |
* @see jquery-ui-datepicker
|
227 |
*
|
228 |
*/
|
229 |
-
public static function _date(
|
230 |
-
|
231 |
-
|
|
|
232 |
}
|
233 |
$extra_js = '';
|
234 |
-
$value
|
235 |
-
$class
|
236 |
-
if (
|
237 |
-
if (
|
238 |
$extra['class'] .= $class;
|
239 |
} else {
|
240 |
$extra['class'] = $class;
|
241 |
}
|
242 |
} else {
|
243 |
-
$extra .= sprintf(
|
244 |
}
|
245 |
-
if (
|
246 |
-
if (
|
247 |
$extra_js = $extra['date'];
|
248 |
-
unset(
|
249 |
}
|
250 |
}
|
251 |
|
252 |
-
$data['id'] = self::__createid(
|
253 |
|
254 |
-
return sprintf(
|
255 |
}
|
256 |
|
257 |
/**
|
@@ -263,23 +271,24 @@ class TInvWL_Form {
|
|
263 |
*
|
264 |
* @return string
|
265 |
*/
|
266 |
-
public static function _time(
|
267 |
-
|
268 |
-
|
269 |
-
|
|
|
270 |
$extra['class'] .= $class;
|
271 |
} else {
|
272 |
$extra['class'] = $class;
|
273 |
}
|
274 |
} else {
|
275 |
-
$extra .= sprintf(
|
276 |
}
|
277 |
$options = array();
|
278 |
-
for (
|
279 |
-
$options[
|
280 |
}
|
281 |
|
282 |
-
return self::_select(
|
283 |
}
|
284 |
|
285 |
/**
|
@@ -291,15 +300,16 @@ class TInvWL_Form {
|
|
291 |
*
|
292 |
* @return string
|
293 |
*/
|
294 |
-
public static function _textarea(
|
295 |
-
|
|
|
296 |
$defaults = array(
|
297 |
-
'name' => is_array(
|
298 |
'cols' => '40',
|
299 |
'rows' => '20',
|
300 |
);
|
301 |
|
302 |
-
return sprintf(
|
303 |
}
|
304 |
|
305 |
/**
|
@@ -309,14 +319,15 @@ class TInvWL_Form {
|
|
309 |
* @param string $value Value.
|
310 |
* @param array $extra Styling or Custom variable.
|
311 |
*/
|
312 |
-
public static function editor(
|
313 |
-
|
314 |
-
|
|
|
315 |
}
|
316 |
-
$value
|
317 |
-
$data['id']
|
318 |
$extra['textarea_name'] = $data['name'];
|
319 |
-
wp_editor(
|
320 |
}
|
321 |
|
322 |
/**
|
@@ -329,46 +340,47 @@ class TInvWL_Form {
|
|
329 |
*
|
330 |
* @return string
|
331 |
*/
|
332 |
-
public static function _checkbox(
|
|
|
333 |
$load = true;
|
334 |
-
if (
|
335 |
-
if (
|
336 |
-
$load = (bool)
|
337 |
-
unset(
|
338 |
}
|
339 |
}
|
340 |
-
if (
|
341 |
-
$checked = self::getvalue(
|
342 |
-
$value
|
343 |
}
|
344 |
-
if (
|
345 |
-
$value = array_shift(
|
346 |
}
|
347 |
-
if (
|
348 |
-
$checked = (
|
349 |
}
|
350 |
|
351 |
$defaults = array(
|
352 |
-
'type'
|
353 |
-
'name'
|
354 |
-
'value' => esc_html(
|
355 |
);
|
356 |
-
if (
|
357 |
$checked = $data['checked'];
|
358 |
|
359 |
-
if (
|
360 |
-
unset(
|
361 |
} else {
|
362 |
$data['checked'] = 'checked';
|
363 |
}
|
364 |
}
|
365 |
-
if (
|
366 |
$defaults['checked'] = 'checked';
|
367 |
} else {
|
368 |
-
unset(
|
369 |
}
|
370 |
|
371 |
-
return sprintf(
|
372 |
}
|
373 |
|
374 |
/**
|
@@ -381,13 +393,14 @@ class TInvWL_Form {
|
|
381 |
*
|
382 |
* @return string
|
383 |
*/
|
384 |
-
public static function _radio(
|
385 |
-
|
386 |
-
|
|
|
387 |
}
|
388 |
$data['type'] = 'radio';
|
389 |
|
390 |
-
return self::_checkbox(
|
391 |
}
|
392 |
|
393 |
/**
|
@@ -400,56 +413,57 @@ class TInvWL_Form {
|
|
400 |
*
|
401 |
* @return string
|
402 |
*/
|
403 |
-
public static function _select(
|
|
|
404 |
$defaults = array();
|
405 |
-
if (
|
406 |
-
$data
|
407 |
-
$defaults = array(
|
408 |
}
|
409 |
$load = true;
|
410 |
-
if (
|
411 |
-
if (
|
412 |
-
$load = (bool)
|
413 |
-
unset(
|
414 |
}
|
415 |
}
|
416 |
-
if (
|
417 |
-
$value = self::getvalue(
|
418 |
}
|
419 |
-
$options = self::getoption(
|
420 |
-
if (
|
421 |
-
$value = array(
|
422 |
}
|
423 |
-
if (
|
424 |
-
$options = array(
|
425 |
}
|
426 |
|
427 |
-
$extra
|
428 |
-
$multiple = (
|
429 |
|
430 |
-
if (
|
431 |
$data['name'] = $data['name'] . '[]';
|
432 |
}
|
433 |
$form = '';
|
434 |
-
foreach (
|
435 |
-
$key = (string)
|
436 |
-
if (
|
437 |
-
if (
|
438 |
continue;
|
439 |
}
|
440 |
$opt = '';
|
441 |
-
foreach (
|
442 |
-
$sel = in_array(
|
443 |
-
$opt .= sprintf(
|
444 |
}
|
445 |
-
$form .= sprintf(
|
446 |
} else {
|
447 |
-
$sel
|
448 |
-
$form .= sprintf(
|
449 |
}
|
450 |
}
|
451 |
|
452 |
-
return sprintf(
|
453 |
}
|
454 |
|
455 |
/**
|
@@ -462,54 +476,55 @@ class TInvWL_Form {
|
|
462 |
*
|
463 |
* @return string
|
464 |
*/
|
465 |
-
public static function _previewselect(
|
466 |
-
|
467 |
-
|
|
|
468 |
}
|
469 |
-
$class
|
470 |
-
$extra_select = array(
|
471 |
$extra_button = array();
|
472 |
-
$extra_url
|
473 |
-
$load
|
474 |
-
if (
|
475 |
-
if (
|
476 |
-
$load = (bool)
|
477 |
-
unset(
|
478 |
}
|
479 |
}
|
480 |
-
if (
|
481 |
-
$value = self::getvalue(
|
482 |
}
|
483 |
-
if (
|
484 |
-
if (
|
485 |
$extra_select = $extra['select'];
|
486 |
-
unset(
|
487 |
}
|
488 |
-
if (
|
489 |
$extra_button = $extra['button'];
|
490 |
-
unset(
|
491 |
}
|
492 |
-
if (
|
493 |
-
$extra_url = (string)
|
494 |
-
unset(
|
495 |
}
|
496 |
} else {
|
497 |
$extra_select = $extra_button = $extra;
|
498 |
}
|
499 |
-
$extra_url = str_replace(
|
500 |
-
if (
|
501 |
-
$extra_select['onchange'] = 'jQuery(this).next().find(\'.tinvwl-btn\').attr(\'href\', \'' . esc_attr(
|
502 |
} else {
|
503 |
-
$extra_select .= ' onchange="jQuery(this).next().find(\'.tinvwl-btn\').attr(\'href\', \'' . esc_attr(
|
504 |
}
|
505 |
-
if (
|
506 |
$extra_button['class'] = 'tinvwl-btn smaller';
|
507 |
-
$extra_button['href']
|
508 |
} else {
|
509 |
-
$extra_button .= ' class="tinvwl-btn smaller" href="' . sprintf(
|
510 |
}
|
511 |
|
512 |
-
return sprintf(
|
513 |
}
|
514 |
|
515 |
/**
|
@@ -521,70 +536,71 @@ class TInvWL_Form {
|
|
521 |
*
|
522 |
* @return string
|
523 |
*/
|
524 |
-
public static function _uploadfile(
|
525 |
-
|
526 |
-
|
|
|
527 |
}
|
528 |
-
$value
|
529 |
-
$extra_field
|
530 |
$extra_button = '';
|
531 |
$value_button = '';
|
532 |
-
$mimefiles
|
533 |
-
if (
|
534 |
-
if (
|
535 |
$mimefiles = $extra['type'];
|
536 |
-
unset(
|
537 |
}
|
538 |
-
if (
|
539 |
-
if (
|
540 |
$extra_field = $extra['field'];
|
541 |
}
|
542 |
-
unset(
|
543 |
}
|
544 |
-
if (
|
545 |
$extra_button = $extra['button'];
|
546 |
-
unset(
|
547 |
}
|
548 |
-
if (
|
549 |
-
foreach (
|
550 |
-
$extra_field[
|
551 |
}
|
552 |
} else {
|
553 |
-
$extra_field .= self::__atrtostr(
|
554 |
}
|
555 |
-
if (
|
556 |
-
if (
|
557 |
$value_button = $extra_button['value'];
|
558 |
-
unset(
|
559 |
-
} elseif (
|
560 |
$value_button = $extra_button['name'];
|
561 |
-
unset(
|
562 |
}
|
563 |
-
foreach (
|
564 |
-
$extra_button[
|
565 |
}
|
566 |
} else {
|
567 |
-
$extra_button .= self::__atrtostr(
|
568 |
}
|
569 |
} else {
|
570 |
$extra_button = $extra_field = $extra;
|
571 |
} // End if().
|
572 |
-
if (
|
573 |
-
$mimefiles = array(
|
574 |
}
|
575 |
-
$mimefiles = array_filter(
|
576 |
-
$mimefiles = wp_json_encode(
|
577 |
|
578 |
$data['type'] = 'text';
|
579 |
|
580 |
wp_enqueue_media();
|
581 |
|
582 |
-
return sprintf(
|
583 |
-
'<div class="' . $data['name'] . '-preview tinvwl-input-group-btn"><div class="tinvwl-icon-preview"><span><img src="' . $value . '" /></span></div></div>', self::_text(
|
584 |
-
'name'
|
585 |
-
'type'
|
586 |
'class' => 'tinvwl-btn white smaller',
|
587 |
-
), $value_button, $extra_button
|
588 |
$data['name']
|
589 |
);
|
590 |
}
|
@@ -599,13 +615,14 @@ class TInvWL_Form {
|
|
599 |
*
|
600 |
* @return string
|
601 |
*/
|
602 |
-
public static function _multiselect(
|
603 |
-
|
604 |
-
|
|
|
605 |
$extra .= ' multiple="multiple"';
|
606 |
}
|
607 |
|
608 |
-
return self::_select(
|
609 |
}
|
610 |
|
611 |
/**
|
@@ -618,56 +635,57 @@ class TInvWL_Form {
|
|
618 |
*
|
619 |
* @return string
|
620 |
*/
|
621 |
-
public static function _multicheckbox(
|
622 |
-
|
623 |
-
|
624 |
-
|
|
|
625 |
$extra['class'] .= $class;
|
626 |
} else {
|
627 |
$extra['class'] = $class;
|
628 |
}
|
629 |
} else {
|
630 |
-
$extra .= sprintf(
|
631 |
}
|
632 |
|
633 |
-
if (
|
634 |
-
$data = array(
|
635 |
}
|
636 |
-
$value
|
637 |
-
$options = self::getoption(
|
638 |
-
if (
|
639 |
-
$value = array(
|
640 |
}
|
641 |
-
$value = array_filter(
|
642 |
-
if (
|
643 |
-
$options = array(
|
644 |
}
|
645 |
$before = '';
|
646 |
-
$after
|
647 |
-
if (
|
648 |
-
if (
|
649 |
-
$before = sprintf(
|
650 |
-
unset(
|
651 |
}
|
652 |
-
if (
|
653 |
-
$after = sprintf(
|
654 |
-
unset(
|
655 |
}
|
656 |
}
|
657 |
-
$i
|
658 |
$name = $data['name'];
|
659 |
-
foreach (
|
660 |
$data['name'] = $name . '[' . $i . ']';
|
661 |
-
$i
|
662 |
-
$data['id']
|
663 |
-
$_form
|
664 |
-
$options [
|
665 |
'before' => $_form,
|
666 |
-
)
|
667 |
}
|
668 |
$glue = '</li><li>';
|
669 |
|
670 |
-
return sprintf(
|
671 |
}
|
672 |
|
673 |
/**
|
@@ -680,37 +698,38 @@ class TInvWL_Form {
|
|
680 |
*
|
681 |
* @return string
|
682 |
*/
|
683 |
-
public static function _multiradio(
|
684 |
-
|
685 |
-
|
|
|
686 |
}
|
687 |
-
$value
|
688 |
-
$options = self::getoption(
|
689 |
-
if (
|
690 |
-
$value = array(
|
691 |
}
|
692 |
|
693 |
-
if (
|
694 |
-
$options = array(
|
695 |
}
|
696 |
$separator = ' ';
|
697 |
-
if (
|
698 |
-
if (
|
699 |
$separator = $extra['separator'];
|
700 |
-
unset(
|
701 |
}
|
702 |
$extra['load'] = false;
|
703 |
} else {
|
704 |
-
$extra = array(
|
705 |
}
|
706 |
$form = '';
|
707 |
-
foreach (
|
708 |
-
$data['id'] = self::__createid(
|
709 |
-
$_form
|
710 |
-
$form
|
711 |
'before' => $_form,
|
712 |
-
)
|
713 |
-
$form
|
714 |
}
|
715 |
|
716 |
return $form;
|
@@ -725,41 +744,42 @@ class TInvWL_Form {
|
|
725 |
*
|
726 |
* @return string
|
727 |
*/
|
728 |
-
public static function _timeperiod(
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
$
|
734 |
-
$
|
735 |
-
$
|
736 |
-
|
737 |
-
|
|
|
738 |
$separator = $extra['separator'];
|
739 |
-
unset(
|
740 |
}
|
741 |
-
if (
|
742 |
$label_extra = $extra['label'];
|
743 |
-
unset(
|
744 |
-
for (
|
745 |
-
if (
|
746 |
-
$label[
|
747 |
-
unset(
|
748 |
}
|
749 |
}
|
750 |
}
|
751 |
$extra['load'] = false;
|
752 |
} else {
|
753 |
-
$extra = array(
|
754 |
}
|
755 |
$form = array();
|
756 |
-
for (
|
757 |
-
$_data
|
758 |
-
$_data['name']
|
759 |
-
$label_extra[
|
760 |
-
$form[]
|
761 |
}
|
762 |
-
$form = sprintf(
|
763 |
|
764 |
return $form;
|
765 |
}
|
@@ -773,43 +793,44 @@ class TInvWL_Form {
|
|
773 |
*
|
774 |
* @return string
|
775 |
*/
|
776 |
-
public static function _dateperiod(
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
$
|
782 |
-
$
|
783 |
-
$
|
784 |
-
|
785 |
-
|
|
|
786 |
$separator = $extra['separator'];
|
787 |
-
unset(
|
788 |
}
|
789 |
-
if (
|
790 |
$label_extra = $extra['label'];
|
791 |
-
unset(
|
792 |
-
for (
|
793 |
-
if (
|
794 |
-
$label[
|
795 |
-
unset(
|
796 |
}
|
797 |
}
|
798 |
}
|
799 |
$extra['load'] = false;
|
800 |
} else {
|
801 |
-
$extra = array(
|
802 |
}
|
803 |
$form = array();
|
804 |
-
for (
|
805 |
-
$_data
|
806 |
-
$_data['name']
|
807 |
-
$_data['id']
|
808 |
-
$extra['date']['onClose']
|
809 |
-
$label_extra[
|
810 |
-
$form[]
|
811 |
}
|
812 |
-
$form = sprintf(
|
813 |
|
814 |
return $form;
|
815 |
}
|
@@ -823,10 +844,11 @@ class TInvWL_Form {
|
|
823 |
*
|
824 |
* @return string
|
825 |
*/
|
826 |
-
public static function _html(
|
827 |
-
|
828 |
-
|
829 |
-
|
|
|
830 |
}
|
831 |
}
|
832 |
|
@@ -842,14 +864,15 @@ class TInvWL_Form {
|
|
842 |
*
|
843 |
* @return type
|
844 |
*/
|
845 |
-
public static function _button(
|
|
|
846 |
$defaults = array(
|
847 |
-
'type'
|
848 |
-
'name'
|
849 |
-
'value' => esc_attr(
|
850 |
);
|
851 |
|
852 |
-
return sprintf(
|
853 |
}
|
854 |
|
855 |
/**
|
@@ -861,8 +884,9 @@ class TInvWL_Form {
|
|
861 |
*
|
862 |
* @return type
|
863 |
*/
|
864 |
-
public static function _button_submit_quick(
|
865 |
-
|
|
|
866 |
}
|
867 |
|
868 |
/**
|
@@ -874,13 +898,14 @@ class TInvWL_Form {
|
|
874 |
*
|
875 |
* @return type
|
876 |
*/
|
877 |
-
public static function _button_submit(
|
878 |
-
|
879 |
-
|
|
|
880 |
}
|
881 |
$data['type'] = 'submit';
|
882 |
|
883 |
-
return self::_button(
|
884 |
}
|
885 |
|
886 |
/**
|
@@ -892,31 +917,32 @@ class TInvWL_Form {
|
|
892 |
*
|
893 |
* @return string
|
894 |
*/
|
895 |
-
public static function _label(
|
|
|
896 |
$attr = '';
|
897 |
-
if (
|
898 |
-
$attr .= ' for="' . self::__createid(
|
899 |
}
|
900 |
$before = '';
|
901 |
-
if (
|
902 |
$before = $extra['before'];
|
903 |
-
unset(
|
904 |
}
|
905 |
$after = '';
|
906 |
-
if (
|
907 |
$after = $extra['after'];
|
908 |
-
unset(
|
909 |
}
|
910 |
-
if (
|
911 |
-
foreach (
|
912 |
-
if (
|
913 |
continue;
|
914 |
}
|
915 |
-
$attr .= sprintf(
|
916 |
}
|
917 |
}
|
918 |
|
919 |
-
return sprintf(
|
920 |
}
|
921 |
|
922 |
/**
|
@@ -927,9 +953,10 @@ class TInvWL_Form {
|
|
927 |
*
|
928 |
* @return string
|
929 |
*/
|
930 |
-
private static function __createid(
|
931 |
-
|
932 |
-
|
|
|
933 |
$name = self::$_name . $separator . $name;
|
934 |
}
|
935 |
|
@@ -945,32 +972,33 @@ class TInvWL_Form {
|
|
945 |
*
|
946 |
* @return string
|
947 |
*/
|
948 |
-
private static function __parseatr(
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
|
|
954 |
}
|
955 |
}
|
956 |
|
957 |
-
if (
|
958 |
-
$default = array_merge(
|
959 |
}
|
960 |
}
|
961 |
-
if (
|
962 |
$default['name'] = self::__rndmane();
|
963 |
}
|
964 |
|
965 |
-
$default['id'] = self::__createid(
|
966 |
|
967 |
$att = '';
|
968 |
|
969 |
-
foreach (
|
970 |
-
if (
|
971 |
-
$val = implode(
|
972 |
}
|
973 |
-
$att .= sprintf(
|
974 |
}
|
975 |
|
976 |
return $att;
|
@@ -984,23 +1012,24 @@ class TInvWL_Form {
|
|
984 |
*
|
985 |
* @return string
|
986 |
*/
|
987 |
-
static function __atrtostr(
|
988 |
-
|
|
|
989 |
return '';
|
990 |
}
|
991 |
-
if (
|
992 |
-
return sprintf(
|
993 |
}
|
994 |
-
if (
|
995 |
-
$attributes = (array)
|
996 |
}
|
997 |
-
if (
|
998 |
$atts = '';
|
999 |
-
foreach (
|
1000 |
-
if (
|
1001 |
-
$val = implode(
|
1002 |
}
|
1003 |
-
$atts .= sprintf(
|
1004 |
}
|
1005 |
|
1006 |
return $atts;
|
@@ -1017,23 +1046,24 @@ class TInvWL_Form {
|
|
1017 |
*
|
1018 |
* @return string
|
1019 |
*/
|
1020 |
-
static function __atrtostrjs(
|
1021 |
-
|
|
|
1022 |
return '';
|
1023 |
}
|
1024 |
-
if (
|
1025 |
-
return sprintf(
|
1026 |
}
|
1027 |
-
if (
|
1028 |
-
$attributes = (array)
|
1029 |
}
|
1030 |
-
if (
|
1031 |
$atts = '';
|
1032 |
-
foreach (
|
1033 |
-
if (
|
1034 |
-
$val = implode(
|
1035 |
}
|
1036 |
-
$atts .= sprintf(
|
1037 |
}
|
1038 |
|
1039 |
return $atts;
|
@@ -1047,12 +1077,13 @@ class TInvWL_Form {
|
|
1047 |
*
|
1048 |
* @return string
|
1049 |
*/
|
1050 |
-
private static function __rndmane()
|
|
|
1051 |
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
1052 |
-
$data
|
1053 |
-
$length
|
1054 |
-
for (
|
1055 |
-
$data .= $characters[
|
1056 |
}
|
1057 |
|
1058 |
return $data;
|
@@ -1066,12 +1097,13 @@ class TInvWL_Form {
|
|
1066 |
*
|
1067 |
* @return mixed
|
1068 |
*/
|
1069 |
-
static function getvalue(
|
1070 |
-
|
1071 |
-
|
|
|
1072 |
} else {
|
1073 |
-
$_value = filter_input(
|
1074 |
-
if (
|
1075 |
return $value;
|
1076 |
} else {
|
1077 |
return $_value;
|
@@ -1087,20 +1119,21 @@ class TInvWL_Form {
|
|
1087 |
*
|
1088 |
* @return mixed
|
1089 |
*/
|
1090 |
-
public static function setvalue(
|
|
|
1091 |
$_value = $value;
|
1092 |
-
if (
|
1093 |
-
foreach (
|
1094 |
-
if (
|
1095 |
-
self::$value[
|
1096 |
-
unset(
|
1097 |
}
|
1098 |
}
|
1099 |
-
if (
|
1100 |
-
self::$value = array_merge(
|
1101 |
}
|
1102 |
} else {
|
1103 |
-
self::$value[
|
1104 |
}
|
1105 |
|
1106 |
return $_value;
|
@@ -1114,15 +1147,16 @@ class TInvWL_Form {
|
|
1114 |
*
|
1115 |
* @return mixed
|
1116 |
*/
|
1117 |
-
public static function removevalue(
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
|
|
1122 |
}
|
1123 |
}
|
1124 |
} else {
|
1125 |
-
unset(
|
1126 |
}
|
1127 |
|
1128 |
return $value;
|
@@ -1136,9 +1170,10 @@ class TInvWL_Form {
|
|
1136 |
*
|
1137 |
* @return array
|
1138 |
*/
|
1139 |
-
static function getoption(
|
1140 |
-
|
1141 |
-
|
|
|
1142 |
}
|
1143 |
|
1144 |
return $option;
|
@@ -1152,20 +1187,21 @@ class TInvWL_Form {
|
|
1152 |
*
|
1153 |
* @return array
|
1154 |
*/
|
1155 |
-
public static function setoptions(
|
|
|
1156 |
$_option = $option;
|
1157 |
-
if (
|
1158 |
-
foreach (
|
1159 |
-
if (
|
1160 |
-
self::$option[
|
1161 |
-
unset(
|
1162 |
}
|
1163 |
}
|
1164 |
-
if (
|
1165 |
-
self::$option = array_merge(
|
1166 |
}
|
1167 |
} else {
|
1168 |
-
self::$option[
|
1169 |
}
|
1170 |
|
1171 |
return $_option;
|
@@ -1179,15 +1215,16 @@ class TInvWL_Form {
|
|
1179 |
*
|
1180 |
* @return mixed
|
1181 |
*/
|
1182 |
-
public static function removeoptions(
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
|
|
1187 |
}
|
1188 |
}
|
1189 |
} else {
|
1190 |
-
unset(
|
1191 |
}
|
1192 |
|
1193 |
return $option;
|
@@ -1203,19 +1240,20 @@ class TInvWL_Form {
|
|
1203 |
*
|
1204 |
* @return string
|
1205 |
*/
|
1206 |
-
public static function _checkboxonoff(
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
|
|
1210 |
$extra['class'] .= $class;
|
1211 |
} else {
|
1212 |
$extra['class'] = $class;
|
1213 |
}
|
1214 |
} else {
|
1215 |
-
$extra .= sprintf(
|
1216 |
}
|
1217 |
|
1218 |
-
return self::_checkbox(
|
1219 |
}
|
1220 |
|
1221 |
/**
|
@@ -1228,27 +1266,28 @@ class TInvWL_Form {
|
|
1228 |
*
|
1229 |
* @return string
|
1230 |
*/
|
1231 |
-
public static function _multiradiobox(
|
1232 |
-
|
1233 |
-
|
|
|
1234 |
}
|
1235 |
$extra_input = '';
|
1236 |
-
$class
|
1237 |
-
if (
|
1238 |
-
if (
|
1239 |
$extra['class'] .= $class;
|
1240 |
} else {
|
1241 |
$extra['class'] = $class;
|
1242 |
}
|
1243 |
-
if (
|
1244 |
$extra_input = $extra['input'];
|
1245 |
-
unset(
|
1246 |
}
|
1247 |
} else {
|
1248 |
-
$extra .= sprintf(
|
1249 |
}
|
1250 |
|
1251 |
-
return sprintf(
|
1252 |
}
|
1253 |
|
1254 |
/**
|
@@ -1260,22 +1299,23 @@ class TInvWL_Form {
|
|
1260 |
*
|
1261 |
* @return string
|
1262 |
*/
|
1263 |
-
public static function _numberrange(
|
1264 |
-
|
1265 |
-
|
|
|
1266 |
}
|
1267 |
$data['type'] = 'range';
|
1268 |
-
$class
|
1269 |
-
if (
|
1270 |
-
if (
|
1271 |
$extra['class'] = $class;
|
1272 |
} else {
|
1273 |
$extra['class'] = $class;
|
1274 |
}
|
1275 |
} else {
|
1276 |
-
$extra .= sprintf(
|
1277 |
}
|
1278 |
|
1279 |
-
return self::_text(
|
1280 |
}
|
1281 |
}
|
7 |
*/
|
8 |
|
9 |
// If this file is called directly, abort.
|
10 |
+
if (!defined('ABSPATH')) {
|
11 |
die;
|
12 |
}
|
13 |
|
14 |
/**
|
15 |
* Form plugin class
|
16 |
*/
|
17 |
+
class TInvWL_Form
|
18 |
+
{
|
19 |
|
20 |
/**
|
21 |
* Prefix for id elements
|
43 |
*
|
44 |
* @param string $plugin_name Plugin name.
|
45 |
*/
|
46 |
+
public static function _init($plugin_name = TINVWL_PREFIX)
|
47 |
+
{
|
48 |
self::$_name = $plugin_name;
|
49 |
}
|
50 |
|
56 |
*
|
57 |
* @return mixed
|
58 |
*/
|
59 |
+
public function __call($name, $arg)
|
60 |
+
{
|
61 |
$_arg = array(
|
62 |
0 => null,
|
63 |
1 => null,
|
64 |
2 => null,
|
65 |
3 => null,
|
66 |
);
|
67 |
+
foreach (array_keys($_arg) as $key) {
|
68 |
+
$_arg[$key] = array_shift($arg);
|
69 |
+
}
|
70 |
+
$arg = $_arg;
|
71 |
+
$glue = '_';
|
72 |
+
$method = sprintf('%s%s', $glue, $name);
|
73 |
+
if (false === strpos($name, $glue)) {
|
74 |
+
if (method_exists(__CLASS__, $method)) {
|
75 |
+
$data = call_user_func(array(__CLASS__, $method), $arg[0], $arg[1], $arg[2], $arg[3]);
|
76 |
echo $data; // WPCS: xss ok.
|
77 |
}
|
78 |
} else {
|
79 |
+
if (method_exists(__CLASS__, $name)) {
|
80 |
+
return call_user_func(array(__CLASS__, $name), $arg[0], $arg[1], $arg[2], $arg[3]);
|
81 |
}
|
82 |
}
|
83 |
|
92 |
*
|
93 |
* @return mixed
|
94 |
*/
|
95 |
+
public static function __callStatic($name, $arg)
|
96 |
+
{
|
97 |
+
if (empty(self::$_name)) {
|
98 |
self::$_name = TINVWL_PREFIX;
|
99 |
}
|
100 |
$_arg = array(
|
103 |
2 => null,
|
104 |
3 => null,
|
105 |
);
|
106 |
+
foreach (array_keys($_arg) as $key) {
|
107 |
+
$_arg[$key] = array_shift($arg);
|
108 |
+
}
|
109 |
+
$arg = $_arg;
|
110 |
+
$glue = '_';
|
111 |
+
$method = sprintf('%s%s', $glue, $name);
|
112 |
+
if (false === strpos($name, $glue)) {
|
113 |
+
if (method_exists(__CLASS__, $method)) {
|
114 |
+
$data = call_user_func(array(__CLASS__, $method), $arg[0], $arg[1], $arg[2], $arg[3]);
|
115 |
echo $data; // WPCS: xss ok.
|
116 |
}
|
117 |
} else {
|
118 |
+
if (method_exists(__CLASS__, $name)) {
|
119 |
+
return call_user_func(array(__CLASS__, $name), $arg[0], $arg[1], $arg[2], $arg[3]);
|
120 |
}
|
121 |
}
|
122 |
|
132 |
*
|
133 |
* @return string
|
134 |
*/
|
135 |
+
public static function _text($data, $value = '', $extra = '')
|
136 |
+
{
|
137 |
$load = true;
|
138 |
+
if (is_array($extra)) {
|
139 |
+
if (isset($extra['load'])) {
|
140 |
+
$load = (bool)$extra['load'];
|
141 |
+
unset($extra['load']);
|
142 |
}
|
143 |
}
|
144 |
+
if ($load) {
|
145 |
+
$value = esc_attr(self::getvalue((is_array($data) ? @$data['name'] : $data), $value)); // @codingStandardsIgnoreLine Generic.PHP.NoSilencedErrors.Discouraged
|
146 |
}
|
147 |
$defaults = array(
|
148 |
+
'type' => is_array($data) ? @$data['type'] : 'text',
|
149 |
+
'name' => is_array($data) ? @$data['name'] : $data,
|
150 |
'value' => $value,
|
151 |
);
|
152 |
|
153 |
+
return sprintf('<input %s%s />', self::__parseatr($data, $defaults), self::__atrtostr($extra));
|
154 |
}
|
155 |
|
156 |
/**
|
162 |
*
|
163 |
* @return string
|
164 |
*/
|
165 |
+
public static function _number($data, $value = 0, $extra = '')
|
166 |
+
{
|
167 |
+
$class = sprintf(' %s-form-number', self::$_name);
|
168 |
+
if (is_array($extra)) {
|
169 |
+
if (isset($extra['class'])) {
|
170 |
$extra['class'] .= $class;
|
171 |
} else {
|
172 |
$extra['class'] = $class;
|
173 |
}
|
174 |
} else {
|
175 |
+
$extra .= sprintf(' class="%s" ', $class);
|
176 |
}
|
177 |
+
if (!is_array($data)) {
|
178 |
+
$data = array('name' => $data);
|
179 |
}
|
180 |
$data['type'] = 'number';
|
181 |
|
182 |
+
return self::_text($data, $value, $extra);
|
183 |
}
|
184 |
|
185 |
/**
|
193 |
* @see colorpicker
|
194 |
*
|
195 |
*/
|
196 |
+
public static function _color($data = '', $value = '', $extra = '')
|
197 |
+
{
|
198 |
+
$class = sprintf(' %s-form-color', self::$_name);
|
199 |
+
$load = true;
|
200 |
+
if (is_array($extra)) {
|
201 |
+
if (isset($extra['class'])) {
|
202 |
$extra['class'] .= $class;
|
203 |
} else {
|
204 |
$extra['class'] = $class;
|
205 |
}
|
206 |
+
if (isset($extra['load'])) {
|
207 |
+
$load = (bool)$extra['load'];
|
208 |
+
unset($extra['load']);
|
209 |
}
|
210 |
} else {
|
211 |
+
$extra .= sprintf(' class="%s" ', $class);
|
212 |
}
|
213 |
+
if ($load) {
|
214 |
+
$value = self::getvalue((is_array($data) ? @$data['name'] : $data), $value); // @codingStandardsIgnoreLine Generic.PHP.NoSilencedErrors.Discouraged
|
215 |
}
|
216 |
$defaults = array(
|
217 |
+
'type' => 'text',
|
218 |
+
'name' => is_array($data) ? '' : $data,
|
219 |
'value' => $value,
|
220 |
);
|
221 |
|
222 |
+
return sprintf('<div class="tinvwl-color-picker"><div class="tinvwl-input-group tinvwl-no-full"><input %s%s /><div class="tinvwl-input-group-btn"><div class="tinvwl-eyedropper"><a href="javascript:void(0);"><i class="ftinvwl ftinvwl-eyedropper"></i></a></div></div></div></div>', self::__parseatr($data, $defaults), self::__atrtostr($extra));
|
223 |
}
|
224 |
|
225 |
/**
|
233 |
* @see jquery-ui-datepicker
|
234 |
*
|
235 |
*/
|
236 |
+
public static function _date($data = '', $value = '', $extra = '')
|
237 |
+
{
|
238 |
+
if (!is_array($data)) {
|
239 |
+
$data = array('name' => $data);
|
240 |
}
|
241 |
$extra_js = '';
|
242 |
+
$value = self::getvalue($data['name'], $value);
|
243 |
+
$class = sprintf(' %s-date', self::$_name);
|
244 |
+
if (is_array($extra)) {
|
245 |
+
if (isset($extra['class'])) {
|
246 |
$extra['class'] .= $class;
|
247 |
} else {
|
248 |
$extra['class'] = $class;
|
249 |
}
|
250 |
} else {
|
251 |
+
$extra .= sprintf(' class="%s" ', $class);
|
252 |
}
|
253 |
+
if (is_array($extra)) {
|
254 |
+
if (isset($extra['date'])) {
|
255 |
$extra_js = $extra['date'];
|
256 |
+
unset($extra['date']);
|
257 |
}
|
258 |
}
|
259 |
|
260 |
+
$data['id'] = self::__createid($data['name']);
|
261 |
|
262 |
+
return sprintf("%s<script type=\"text/javascript\">jQuery(document).ready(function($){ $('#%s').datepicker({%s})});</script>", self::_text($data, $value, $extra), $data['id'], self::__atrtostrjs($extra_js));
|
263 |
}
|
264 |
|
265 |
/**
|
271 |
*
|
272 |
* @return string
|
273 |
*/
|
274 |
+
public static function _time($data = '', $value = '', $extra = '')
|
275 |
+
{
|
276 |
+
$class = sprintf(' %s-time', self::$_name);
|
277 |
+
if (is_array($extra)) {
|
278 |
+
if (isset($extra['class'])) {
|
279 |
$extra['class'] .= $class;
|
280 |
} else {
|
281 |
$extra['class'] = $class;
|
282 |
}
|
283 |
} else {
|
284 |
+
$extra .= sprintf(' class="%s"', $class);
|
285 |
}
|
286 |
$options = array();
|
287 |
+
for ($i = 0; $i < 24; $i++) {
|
288 |
+
$options[$i] = sprintf('%02d:00', $i);
|
289 |
}
|
290 |
|
291 |
+
return self::_select($data, intval($value), $extra, $options);
|
292 |
}
|
293 |
|
294 |
/**
|
300 |
*
|
301 |
* @return string
|
302 |
*/
|
303 |
+
public static function _textarea($data = '', $value = '', $extra = '')
|
304 |
+
{
|
305 |
+
$value = self::getvalue((is_array($data) ? @$data['name'] : $data), $value); // @codingStandardsIgnoreLine Generic.PHP.NoSilencedErrors.Discouraged
|
306 |
$defaults = array(
|
307 |
+
'name' => is_array($data) ? '' : $data,
|
308 |
'cols' => '40',
|
309 |
'rows' => '20',
|
310 |
);
|
311 |
|
312 |
+
return sprintf('<textarea %s%s>%s</textarea>', self::__parseatr($data, $defaults), self::__atrtostr($extra), esc_textarea($value));
|
313 |
}
|
314 |
|
315 |
/**
|
319 |
* @param string $value Value.
|
320 |
* @param array $extra Styling or Custom variable.
|
321 |
*/
|
322 |
+
public static function editor($data = '', $value = '', $extra = array())
|
323 |
+
{
|
324 |
+
if (!is_array($data)) {
|
325 |
+
$data = array('name' => $data);
|
326 |
}
|
327 |
+
$value = self::getvalue($data['name'], $value);
|
328 |
+
$data['id'] = self::__createid($data['name']);
|
329 |
$extra['textarea_name'] = $data['name'];
|
330 |
+
wp_editor($value, $data['id'], $extra);
|
331 |
}
|
332 |
|
333 |
/**
|
340 |
*
|
341 |
* @return string
|
342 |
*/
|
343 |
+
public static function _checkbox($data = '', $checked = false, $extra = '', $value = '')
|
344 |
+
{
|
345 |
$load = true;
|
346 |
+
if (is_array($extra)) {
|
347 |
+
if (isset($extra['load'])) {
|
348 |
+
$load = (bool)$extra['load'];
|
349 |
+
unset($extra['load']);
|
350 |
}
|
351 |
}
|
352 |
+
if ($load) {
|
353 |
+
$checked = self::getvalue((is_array($data) ? @$data['name'] : $data), $checked); // @codingStandardsIgnoreLine Generic.PHP.NoSilencedErrors.Discouraged
|
354 |
+
$value = self::getoption((is_array($data) ? @$data['name'] : $data), $value); // @codingStandardsIgnoreLine Generic.PHP.NoSilencedErrors.Discouraged
|
355 |
}
|
356 |
+
if (is_array($value)) {
|
357 |
+
$value = array_shift($value);
|
358 |
}
|
359 |
+
if (!is_bool($checked)) {
|
360 |
+
$checked = ($checked == $value) ? true : false; // WPCS: loose comparison ok.
|
361 |
}
|
362 |
|
363 |
$defaults = array(
|
364 |
+
'type' => 'checkbox',
|
365 |
+
'name' => (!is_array($data) ? $data : ''),
|
366 |
+
'value' => esc_html($value),
|
367 |
);
|
368 |
+
if (is_array($data) && array_key_exists('checked', $data)) {
|
369 |
$checked = $data['checked'];
|
370 |
|
371 |
+
if (false == $checked) { // WPCS: loose comparison ok.
|
372 |
+
unset($data['checked']);
|
373 |
} else {
|
374 |
$data['checked'] = 'checked';
|
375 |
}
|
376 |
}
|
377 |
+
if (true == $checked) { // WPCS: loose comparison ok.
|
378 |
$defaults['checked'] = 'checked';
|
379 |
} else {
|
380 |
+
unset($defaults['checked']);
|
381 |
}
|
382 |
|
383 |
+
return sprintf('<input %s%s />', self::__parseatr($data, $defaults), self::__atrtostr($extra));
|
384 |
}
|
385 |
|
386 |
/**
|
393 |
*
|
394 |
* @return string
|
395 |
*/
|
396 |
+
public static function _radio($data = '', $checked = false, $extra = '', $value = '')
|
397 |
+
{
|
398 |
+
if (!is_array($data)) {
|
399 |
+
$data = array('name' => $data);
|
400 |
}
|
401 |
$data['type'] = 'radio';
|
402 |
|
403 |
+
return self::_checkbox($data, $checked, $extra, $value);
|
404 |
}
|
405 |
|
406 |
/**
|
413 |
*
|
414 |
* @return string
|
415 |
*/
|
416 |
+
public static function _select($data = '', $value = array(), $extra = '', $options = array())
|
417 |
+
{
|
418 |
$defaults = array();
|
419 |
+
if (!is_array($data)) {
|
420 |
+
$data = array('name' => $data);
|
421 |
+
$defaults = array('name' => $data);
|
422 |
}
|
423 |
$load = true;
|
424 |
+
if (is_array($extra)) {
|
425 |
+
if (isset($extra['load'])) {
|
426 |
+
$load = (bool)$extra['load'];
|
427 |
+
unset($extra['load']);
|
428 |
}
|
429 |
}
|
430 |
+
if ($load) {
|
431 |
+
$value = self::getvalue($data['name'], $value);
|
432 |
}
|
433 |
+
$options = self::getoption($data['name'], $options);
|
434 |
+
if (!is_array($value)) {
|
435 |
+
$value = array($value);
|
436 |
}
|
437 |
+
if (!is_array($options)) {
|
438 |
+
$options = array($options);
|
439 |
}
|
440 |
|
441 |
+
$extra = self::__atrtostr($extra);
|
442 |
+
$multiple = (count($value) > 1 && false === stripos($extra, 'multiple')) ? ' multiple="multiple"' : '';
|
443 |
|
444 |
+
if ($multiple || strpos($extra, 'multiple') > -1) {
|
445 |
$data['name'] = $data['name'] . '[]';
|
446 |
}
|
447 |
$form = '';
|
448 |
+
foreach ($options as $key => $val) {
|
449 |
+
$key = (string)$key;
|
450 |
+
if (is_array($val)) {
|
451 |
+
if (empty($val)) {
|
452 |
continue;
|
453 |
}
|
454 |
$opt = '';
|
455 |
+
foreach ($val as $opt_key => $opt_val) {
|
456 |
+
$sel = in_array($opt_key, $value) ? ' selected="selected"' : ''; // @codingStandardsIgnoreLine WordPress.PHP.StrictInArray.MissingTrueStrict
|
457 |
+
$opt .= sprintf('<option value="%s"%s>%s</option>', esc_attr($opt_key), $sel, esc_html($opt_val));
|
458 |
}
|
459 |
+
$form .= sprintf('<optgroup label="%s" >%s</optgroup>', esc_attr($key), esc_html($opt));
|
460 |
} else {
|
461 |
+
$sel = in_array($key, $value) ? ' selected="selected"' : ''; // @codingStandardsIgnoreLine WordPress.PHP.StrictInArray.MissingTrueStrict
|
462 |
+
$form .= sprintf('<option value="%s"%s>%s</option>', esc_attr($key), $sel, esc_html($val));
|
463 |
}
|
464 |
}
|
465 |
|
466 |
+
return sprintf('<select %s %s%s>%s</select>', rtrim(self::__parseatr($data, $defaults)), $extra, $multiple, $form);
|
467 |
}
|
468 |
|
469 |
/**
|
476 |
*
|
477 |
* @return string
|
478 |
*/
|
479 |
+
public static function _previewselect($data = '', $value = '', $extra = '', $options = array())
|
480 |
+
{
|
481 |
+
if (!is_array($data)) {
|
482 |
+
$data = array('name' => $data);
|
483 |
}
|
484 |
+
$class = sprintf(' %s-form-preview-select', self::$_name);
|
485 |
+
$extra_select = array('class' => 'form-control');
|
486 |
$extra_button = array();
|
487 |
+
$extra_url = '';
|
488 |
+
$load = true;
|
489 |
+
if (is_array($extra)) {
|
490 |
+
if (isset($extra['load'])) {
|
491 |
+
$load = (bool)$extra['load'];
|
492 |
+
unset($extra['load']);
|
493 |
}
|
494 |
}
|
495 |
+
if ($load) {
|
496 |
+
$value = self::getvalue($data['name'], $value);
|
497 |
}
|
498 |
+
if (is_array($extra)) {
|
499 |
+
if (isset($extra['select'])) {
|
500 |
$extra_select = $extra['select'];
|
501 |
+
unset($extra['select']);
|
502 |
}
|
503 |
+
if (isset($extra['button'])) {
|
504 |
$extra_button = $extra['button'];
|
505 |
+
unset($extra['button']);
|
506 |
}
|
507 |
+
if (isset($extra['url'])) {
|
508 |
+
$extra_url = (string)$extra['url'];
|
509 |
+
unset($extra['url']);
|
510 |
}
|
511 |
} else {
|
512 |
$extra_select = $extra_button = $extra;
|
513 |
}
|
514 |
+
$extra_url = str_replace('%25', '%', $extra_url);
|
515 |
+
if (is_array($extra_select)) {
|
516 |
+
$extra_select['onchange'] = 'jQuery(this).next().find(\'.tinvwl-btn\').attr(\'href\', \'' . esc_attr($extra_url) . '\'.replace(/\%s/i, jQuery(this).val().trim()));';
|
517 |
} else {
|
518 |
+
$extra_select .= ' onchange="jQuery(this).next().find(\'.tinvwl-btn\').attr(\'href\', \'' . esc_attr($extra_url) . '\'.replace(/\%s/i, jQuery(this).val().trim()));"';
|
519 |
}
|
520 |
+
if (is_array($extra_button)) {
|
521 |
$extra_button['class'] = 'tinvwl-btn smaller';
|
522 |
+
$extra_button['href'] = sprintf($extra_url, $value);
|
523 |
} else {
|
524 |
+
$extra_button .= ' class="tinvwl-btn smaller" href="' . sprintf($extra_url, $value);
|
525 |
}
|
526 |
|
527 |
+
return sprintf('<div class="tinvwl-input-group %s">%s<div class="tinvwl-input-group-btn">%s</div></div>', $class, self::_select($data, $value, $extra_select, $options), self::_button($data, __('Preview', 'ti-woocommerce-wishlist'), $extra_button));
|
528 |
}
|
529 |
|
530 |
/**
|
536 |
*
|
537 |
* @return string
|
538 |
*/
|
539 |
+
public static function _uploadfile($data = '', $value = '', $extra = '')
|
540 |
+
{
|
541 |
+
if (!is_array($data)) {
|
542 |
+
$data = array('name' => $data);
|
543 |
}
|
544 |
+
$value = self::getvalue($data['name'], $value);
|
545 |
+
$extra_field = '';
|
546 |
$extra_button = '';
|
547 |
$value_button = '';
|
548 |
+
$mimefiles = '';
|
549 |
+
if (is_array($extra)) {
|
550 |
+
if (isset($extra['type'])) {
|
551 |
$mimefiles = $extra['type'];
|
552 |
+
unset($extra['type']);
|
553 |
}
|
554 |
+
if (isset($extra['field'])) {
|
555 |
+
if (is_array($extra['field'])) {
|
556 |
$extra_field = $extra['field'];
|
557 |
}
|
558 |
+
unset($extra['field']);
|
559 |
}
|
560 |
+
if (isset($extra['button'])) {
|
561 |
$extra_button = $extra['button'];
|
562 |
+
unset($extra['button']);
|
563 |
}
|
564 |
+
if (is_array($extra_field)) {
|
565 |
+
foreach ($extra as $key => $val) {
|
566 |
+
$extra_field[$key] = $val;
|
567 |
}
|
568 |
} else {
|
569 |
+
$extra_field .= self::__atrtostr($extra);
|
570 |
}
|
571 |
+
if (is_array($extra_button)) {
|
572 |
+
if (isset($extra_button['value'])) {
|
573 |
$value_button = $extra_button['value'];
|
574 |
+
unset($extra_button['value']);
|
575 |
+
} elseif (isset($extra_button['name'])) {
|
576 |
$value_button = $extra_button['name'];
|
577 |
+
unset($extra_button['name']);
|
578 |
}
|
579 |
+
foreach ($extra as $key => $val) {
|
580 |
+
$extra_button[$key] = $val;
|
581 |
}
|
582 |
} else {
|
583 |
+
$extra_button .= self::__atrtostr($extra);
|
584 |
}
|
585 |
} else {
|
586 |
$extra_button = $extra_field = $extra;
|
587 |
} // End if().
|
588 |
+
if (!is_array($mimefiles)) {
|
589 |
+
$mimefiles = array($mimefiles);
|
590 |
}
|
591 |
+
$mimefiles = array_filter($mimefiles);
|
592 |
+
$mimefiles = wp_json_encode($mimefiles);
|
593 |
|
594 |
$data['type'] = 'text';
|
595 |
|
596 |
wp_enqueue_media();
|
597 |
|
598 |
+
return sprintf("<div class='tinvwl-input-group'>%s%s<div class='tinvwl-input-group-btn'>%s</div></div><script type=\"text/javascript\">jQuery(document).ready(function($){var nn='%s';" . (empty($value) ? "$('.' + nn + '-preview').hide();" : "") . "$('input[name=\"'+nn+'-btn\"]').click(function(e){e.preventDefault();var i=wp.media({multiple:false, library:{type:{$mimefiles}}}).open().on('select',function(e){var u=i.state().get('selection').first();var iu=u.toJSON().url;$('input[name=\"'+nn+'\"]').val(iu);$('.' + nn + '-preview').show();$('.' + nn + '-preview span img').attr('src', iu);});});});</script>", // @codingStandardsIgnoreLine Squiz.Strings.DoubleQuoteUsage.NotRequired
|
599 |
+
'<div class="' . $data['name'] . '-preview tinvwl-input-group-btn"><div class="tinvwl-icon-preview"><span><img src="' . $value . '" /></span></div></div>', self::_text($data, $value, $extra_field), self::_text(array(
|
600 |
+
'name' => $data['name'] . '-btn',
|
601 |
+
'type' => 'button',
|
602 |
'class' => 'tinvwl-btn white smaller',
|
603 |
+
), $value_button, $extra_button),
|
604 |
$data['name']
|
605 |
);
|
606 |
}
|
615 |
*
|
616 |
* @return string
|
617 |
*/
|
618 |
+
public static function _multiselect($data = '', $value = array(), $extra = '', $options = array())
|
619 |
+
{
|
620 |
+
$extra = self::__atrtostr($extra);
|
621 |
+
if (stripos($extra, 'multiple') === false) {
|
622 |
$extra .= ' multiple="multiple"';
|
623 |
}
|
624 |
|
625 |
+
return self::_select($data, $value, $extra, $options);
|
626 |
}
|
627 |
|
628 |
/**
|
635 |
*
|
636 |
* @return string
|
637 |
*/
|
638 |
+
public static function _multicheckbox($data = '', $value = array(), $extra = '', $options = array())
|
639 |
+
{
|
640 |
+
$class = sprintf(' %s-multicheckbox', self::$_name);
|
641 |
+
if (is_array($extra)) {
|
642 |
+
if (isset($extra['class'])) {
|
643 |
$extra['class'] .= $class;
|
644 |
} else {
|
645 |
$extra['class'] = $class;
|
646 |
}
|
647 |
} else {
|
648 |
+
$extra .= sprintf(' class="%s" ', $class);
|
649 |
}
|
650 |
|
651 |
+
if (!is_array($data)) {
|
652 |
+
$data = array('name' => $data);
|
653 |
}
|
654 |
+
$value = self::getvalue($data['name'], $value);
|
655 |
+
$options = self::getoption($data['name'], $options);
|
656 |
+
if (!is_array($value)) {
|
657 |
+
$value = array($value);
|
658 |
}
|
659 |
+
$value = array_filter($value);
|
660 |
+
if (!is_array($options)) {
|
661 |
+
$options = array($options);
|
662 |
}
|
663 |
$before = '';
|
664 |
+
$after = '';
|
665 |
+
if (is_array($extra)) {
|
666 |
+
if (isset($extra['before'])) {
|
667 |
+
$before = sprintf('<div class="%s-before">%s</div>', self::$_name, $extra['before']);
|
668 |
+
unset($extra['before']);
|
669 |
}
|
670 |
+
if (isset($extra['after'])) {
|
671 |
+
$after = sprintf('<div class="%s-after">%s</div>', self::$_name, $extra['after']);
|
672 |
+
unset($extra['after']);
|
673 |
}
|
674 |
}
|
675 |
+
$i = 0;
|
676 |
$name = $data['name'];
|
677 |
+
foreach ($options as $key => $_data) {
|
678 |
$data['name'] = $name . '[' . $i . ']';
|
679 |
+
$i++;
|
680 |
+
$data['id'] = self::__createid($data['name'] . $key);
|
681 |
+
$_form = self::_checkbox($data, in_array($key, $value), array('load' => false), esc_html($key)); // @codingStandardsIgnoreLine WordPress.PHP.StrictInArray.MissingTrueStrict
|
682 |
+
$options [$key] = self::_label($data['id'], $_data, array(
|
683 |
'before' => $_form,
|
684 |
+
));
|
685 |
}
|
686 |
$glue = '</li><li>';
|
687 |
|
688 |
+
return sprintf('<div %s >%s<ul class="list"><li>%s</li></ul>%s</div>', self::__atrtostr($extra), $before, implode($glue, $options), $after);
|
689 |
}
|
690 |
|
691 |
/**
|
698 |
*
|
699 |
* @return string
|
700 |
*/
|
701 |
+
public static function _multiradio($data = '', $value = '', $extra = '', $options = array())
|
702 |
+
{
|
703 |
+
if (!is_array($data)) {
|
704 |
+
$data = array('name' => $data);
|
705 |
}
|
706 |
+
$value = self::getvalue($data['name'], $value);
|
707 |
+
$options = self::getoption($data['name'], $options);
|
708 |
+
if (!is_array($value)) {
|
709 |
+
$value = array($value);
|
710 |
}
|
711 |
|
712 |
+
if (!is_array($options)) {
|
713 |
+
$options = array($options);
|
714 |
}
|
715 |
$separator = ' ';
|
716 |
+
if (is_array($extra)) {
|
717 |
+
if (isset($extra['separator'])) {
|
718 |
$separator = $extra['separator'];
|
719 |
+
unset($extra['separator']);
|
720 |
}
|
721 |
$extra['load'] = false;
|
722 |
} else {
|
723 |
+
$extra = array('load' => false);
|
724 |
}
|
725 |
$form = '';
|
726 |
+
foreach ($options as $key => $_data) {
|
727 |
+
$data['id'] = self::__createid($data['name'] . $key);
|
728 |
+
$_form = self::_radio($data, in_array($key, $value), $extra, esc_html($key)); // @codingStandardsIgnoreLine WordPress.PHP.StrictInArray.MissingTrueStrict
|
729 |
+
$form .= self::_label($data['id'], $_data, array(
|
730 |
'before' => $_form,
|
731 |
+
));
|
732 |
+
$form .= $separator;
|
733 |
}
|
734 |
|
735 |
return $form;
|
744 |
*
|
745 |
* @return string
|
746 |
*/
|
747 |
+
public static function _timeperiod($data = '', $value = array(), $extra = array())
|
748 |
+
{
|
749 |
+
if (!is_array($data)) {
|
750 |
+
$data = array('name' => $data);
|
751 |
+
}
|
752 |
+
$label = array('', '');
|
753 |
+
$label_extra = array('', '');
|
754 |
+
$value = (array)self::getvalue($data['name'], $value);
|
755 |
+
$separator = ' ';
|
756 |
+
if (is_array($extra)) {
|
757 |
+
if (isset($extra['separator'])) {
|
758 |
$separator = $extra['separator'];
|
759 |
+
unset($extra['separator']);
|
760 |
}
|
761 |
+
if (isset($extra['label'])) {
|
762 |
$label_extra = $extra['label'];
|
763 |
+
unset($extra['label']);
|
764 |
+
for ($i = 0; $i < count($label); $i++) { // @codingStandardsIgnoreLine Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
|
765 |
+
if (isset($label_extra[$i]['text'])) {
|
766 |
+
$label[$i] = $label_extra[$i]['text'];
|
767 |
+
unset($label_extra[$i]['text']);
|
768 |
}
|
769 |
}
|
770 |
}
|
771 |
$extra['load'] = false;
|
772 |
} else {
|
773 |
+
$extra = array('load' => false);
|
774 |
}
|
775 |
$form = array();
|
776 |
+
for ($i = 0; $i < count($label); $i++) { // @codingStandardsIgnoreLine Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
|
777 |
+
$_data = $data;
|
778 |
+
$_data['name'] .= "[$i]";
|
779 |
+
$label_extra[$i]['after'] = self::_time($_data, (isset($value[$i]) ? $value[$i] : ''), $extra);
|
780 |
+
$form[] = self::_label($_data['name'], $label[$i], $label_extra[$i]);
|
781 |
}
|
782 |
+
$form = sprintf('<div class="%s-timeperiod">%s</div>', self::$_name, implode($separator, $form));
|
783 |
|
784 |
return $form;
|
785 |
}
|
793 |
*
|
794 |
* @return string
|
795 |
*/
|
796 |
+
public static function _dateperiod($data = '', $value = array(), $extra = array())
|
797 |
+
{
|
798 |
+
if (!is_array($data)) {
|
799 |
+
$data = array('name' => $data);
|
800 |
+
}
|
801 |
+
$label = array('', '');
|
802 |
+
$label_extra = array('', '');
|
803 |
+
$value = (array)self::getvalue($data['name'], $value);
|
804 |
+
$separator = ' ';
|
805 |
+
if (is_array($extra)) {
|
806 |
+
if (isset($extra['separator'])) {
|
807 |
$separator = $extra['separator'];
|
808 |
+
unset($extra['separator']);
|
809 |
}
|
810 |
+
if (isset($extra['label'])) {
|
811 |
$label_extra = $extra['label'];
|
812 |
+
unset($extra['label']);
|
813 |
+
for ($i = 0; $i < count($label); $i++) { // @codingStandardsIgnoreLine Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
|
814 |
+
if (isset($label_extra[$i]['text'])) {
|
815 |
+
$label[$i] = $label_extra[$i]['text'];
|
816 |
+
unset($label_extra[$i]['text']);
|
817 |
}
|
818 |
}
|
819 |
}
|
820 |
$extra['load'] = false;
|
821 |
} else {
|
822 |
+
$extra = array('load' => false);
|
823 |
}
|
824 |
$form = array();
|
825 |
+
for ($i = 0; $i < count($label); $i++) { // @codingStandardsIgnoreLine Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
|
826 |
+
$_data = $data;
|
827 |
+
$_data['name'] .= "[$i]";
|
828 |
+
$_data['id'] = self::__createid($data['name'] . '[' . ($i ? 0 : 1) . ']');
|
829 |
+
$extra['date']['onClose'] = sprintf("function(selectedDate){ $('#%s').datepicker('option','%sDate',selectedDate);}", $_data['id'], ($i ? 'max' : 'min'));
|
830 |
+
$label_extra[$i]['after'] = self::_date($_data, (isset($value[$i]) ? $value[$i] : ''), $extra);
|
831 |
+
$form[] = self::_label($_data['name'], $label[$i], $label_extra[$i]);
|
832 |
}
|
833 |
+
$form = sprintf('<div class="%s-dateperiod">%s</div>', self::$_name, implode($separator, $form));
|
834 |
|
835 |
return $form;
|
836 |
}
|
844 |
*
|
845 |
* @return string
|
846 |
*/
|
847 |
+
public static function _html($data = '', $html = '', $extra = '')
|
848 |
+
{
|
849 |
+
if (is_array($extra)) {
|
850 |
+
foreach ($extra as $key => $value) {
|
851 |
+
$html = str_replace('{' . $key . '}', (string)$value, $html);
|
852 |
}
|
853 |
}
|
854 |
|
864 |
*
|
865 |
* @return type
|
866 |
*/
|
867 |
+
public static function _button($data = '', $value = '', $extra = '')
|
868 |
+
{
|
869 |
$defaults = array(
|
870 |
+
'type' => 'button',
|
871 |
+
'name' => is_array($data) ? '' : $data,
|
872 |
+
'value' => esc_attr($value),
|
873 |
);
|
874 |
|
875 |
+
return sprintf('<button %s%s>%s</button>', self::__parseatr($data, $defaults), self::__atrtostr($extra), $value);
|
876 |
}
|
877 |
|
878 |
/**
|
884 |
*
|
885 |
* @return type
|
886 |
*/
|
887 |
+
public static function _button_submit_quick($data = '', $value = '', $extra = '')
|
888 |
+
{
|
889 |
+
return sprintf('<div class="%s-quick-btns">%s</div>', self::$_name, self::_button_submit($data, $value, $extra));
|
890 |
}
|
891 |
|
892 |
/**
|
898 |
*
|
899 |
* @return type
|
900 |
*/
|
901 |
+
public static function _button_submit($data = '', $value = '', $extra = '')
|
902 |
+
{
|
903 |
+
if (!is_array($data)) {
|
904 |
+
$data = array('name' => $data);
|
905 |
}
|
906 |
$data['type'] = 'submit';
|
907 |
|
908 |
+
return self::_button($data, $value, $extra);
|
909 |
}
|
910 |
|
911 |
/**
|
917 |
*
|
918 |
* @return string
|
919 |
*/
|
920 |
+
public static function _label($data = '', $value = '', $extra = array())
|
921 |
+
{
|
922 |
$attr = '';
|
923 |
+
if (!empty($data)) {
|
924 |
+
$attr .= ' for="' . self::__createid($data) . '"';
|
925 |
}
|
926 |
$before = '';
|
927 |
+
if (isset($extra['before'])) {
|
928 |
$before = $extra['before'];
|
929 |
+
unset($extra['before']);
|
930 |
}
|
931 |
$after = '';
|
932 |
+
if (isset($extra['after'])) {
|
933 |
$after = $extra['after'];
|
934 |
+
unset($extra['after']);
|
935 |
}
|
936 |
+
if (is_array($extra) && count($extra) > 0) {
|
937 |
+
foreach ($extra as $key => $val) {
|
938 |
+
if ('for' == $key) { // WPCS: loose comparison ok.
|
939 |
continue;
|
940 |
}
|
941 |
+
$attr .= sprintf(' %s="%s"', $key, $val);
|
942 |
}
|
943 |
}
|
944 |
|
945 |
+
return sprintf('<label %s>%s%s%s</label>', $attr, $before, $value, $after);
|
946 |
}
|
947 |
|
948 |
/**
|
953 |
*
|
954 |
* @return string
|
955 |
*/
|
956 |
+
private static function __createid($name = '', $separator = '_')
|
957 |
+
{ // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidFunctionName.MethodDoubleUnderscore
|
958 |
+
$name = preg_replace('/[^A-Za-z0-9_-]{1}/i', $separator, $name);
|
959 |
+
if (false === strpos($name, self::$_name)) {
|
960 |
$name = self::$_name . $separator . $name;
|
961 |
}
|
962 |
|
972 |
*
|
973 |
* @return string
|
974 |
*/
|
975 |
+
private static function __parseatr($attributes, $default)
|
976 |
+
{ // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidFunctionName.MethodDoubleUnderscore
|
977 |
+
if (is_array($attributes)) {
|
978 |
+
foreach ($default as $key => $val) {
|
979 |
+
if (isset($attributes[$key])) {
|
980 |
+
$default[$key] = $attributes[$key];
|
981 |
+
unset($attributes[$key]);
|
982 |
}
|
983 |
}
|
984 |
|
985 |
+
if (count($attributes) > 0) {
|
986 |
+
$default = array_merge($default, $attributes);
|
987 |
}
|
988 |
}
|
989 |
+
if (!isset($default['name'])) {
|
990 |
$default['name'] = self::__rndmane();
|
991 |
}
|
992 |
|
993 |
+
$default['id'] = self::__createid((!isset($default['id']) ? $default['name'] : $default['id']));
|
994 |
|
995 |
$att = '';
|
996 |
|
997 |
+
foreach ($default as $key => $val) {
|
998 |
+
if (is_array($val)) {
|
999 |
+
$val = implode(', ', $val);
|
1000 |
}
|
1001 |
+
$att .= sprintf('%s="%s" ', $key, $val);
|
1002 |
}
|
1003 |
|
1004 |
return $att;
|
1012 |
*
|
1013 |
* @return string
|
1014 |
*/
|
1015 |
+
static function __atrtostr($attributes)
|
1016 |
+
{ // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidFunctionName.MethodDoubleUnderscore
|
1017 |
+
if (empty($attributes)) {
|
1018 |
return '';
|
1019 |
}
|
1020 |
+
if (is_string($attributes)) {
|
1021 |
+
return sprintf('%s ', $attributes);
|
1022 |
}
|
1023 |
+
if (is_object($attributes)) {
|
1024 |
+
$attributes = (array)$attributes;
|
1025 |
}
|
1026 |
+
if (is_array($attributes)) {
|
1027 |
$atts = '';
|
1028 |
+
foreach ($attributes as $key => $val) {
|
1029 |
+
if (is_array($val)) {
|
1030 |
+
$val = implode(', ', $val);
|
1031 |
}
|
1032 |
+
$atts .= sprintf('%s="%s" ', $key, $val);
|
1033 |
}
|
1034 |
|
1035 |
return $atts;
|
1046 |
*
|
1047 |
* @return string
|
1048 |
*/
|
1049 |
+
static function __atrtostrjs($attributes)
|
1050 |
+
{ // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidFunctionName.MethodDoubleUnderscore
|
1051 |
+
if (empty($attributes)) {
|
1052 |
return '';
|
1053 |
}
|
1054 |
+
if (is_string($attributes)) {
|
1055 |
+
return sprintf('%s ', $attributes);
|
1056 |
}
|
1057 |
+
if (is_object($attributes)) {
|
1058 |
+
$attributes = (array)$attributes;
|
1059 |
}
|
1060 |
+
if (is_array($attributes)) {
|
1061 |
$atts = '';
|
1062 |
+
foreach ($attributes as $key => $val) {
|
1063 |
+
if (is_array($val)) {
|
1064 |
+
$val = implode(', ', $val);
|
1065 |
}
|
1066 |
+
$atts .= sprintf('%s: %s,', $key, $val);
|
1067 |
}
|
1068 |
|
1069 |
return $atts;
|
1077 |
*
|
1078 |
* @return string
|
1079 |
*/
|
1080 |
+
private static function __rndmane()
|
1081 |
+
{ // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidFunctionName.MethodDoubleUnderscore
|
1082 |
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
1083 |
+
$data = '';
|
1084 |
+
$length = rand(4, 10);
|
1085 |
+
for ($i = 0; $i < $length; $i++) {
|
1086 |
+
$data .= $characters[rand(0, strlen($characters) - 1)];
|
1087 |
}
|
1088 |
|
1089 |
return $data;
|
1097 |
*
|
1098 |
* @return mixed
|
1099 |
*/
|
1100 |
+
static function getvalue($data, $value = '')
|
1101 |
+
{
|
1102 |
+
if (isset(self::$value[$data])) {
|
1103 |
+
return self::$value[$data];
|
1104 |
} else {
|
1105 |
+
$_value = filter_input(INPUT_POST, $data);
|
1106 |
+
if (is_null($_value)) {
|
1107 |
return $value;
|
1108 |
} else {
|
1109 |
return $_value;
|
1119 |
*
|
1120 |
* @return mixed
|
1121 |
*/
|
1122 |
+
public static function setvalue($data, $value = '')
|
1123 |
+
{
|
1124 |
$_value = $value;
|
1125 |
+
if (is_array($data)) {
|
1126 |
+
foreach (array_keys(self::$value) as $key) {
|
1127 |
+
if (isset($data[$key])) {
|
1128 |
+
self::$value[$key] = $data[$key];
|
1129 |
+
unset($data[$key]);
|
1130 |
}
|
1131 |
}
|
1132 |
+
if (count($data) > 0) {
|
1133 |
+
self::$value = array_merge(self::$value, $data);
|
1134 |
}
|
1135 |
} else {
|
1136 |
+
self::$value[$data] = $value;
|
1137 |
}
|
1138 |
|
1139 |
return $_value;
|
1147 |
*
|
1148 |
* @return mixed
|
1149 |
*/
|
1150 |
+
public static function removevalue($data, $value = '')
|
1151 |
+
{
|
1152 |
+
if (is_array($data)) {
|
1153 |
+
foreach ($data as $val) {
|
1154 |
+
if (isset(self::$value[$val])) {
|
1155 |
+
unset(self::$value[$val]);
|
1156 |
}
|
1157 |
}
|
1158 |
} else {
|
1159 |
+
unset(self::$value[$data]);
|
1160 |
}
|
1161 |
|
1162 |
return $value;
|
1170 |
*
|
1171 |
* @return array
|
1172 |
*/
|
1173 |
+
static function getoption($data, $option = array())
|
1174 |
+
{
|
1175 |
+
if (isset(self::$option[$data])) {
|
1176 |
+
return self::$option[$data];
|
1177 |
}
|
1178 |
|
1179 |
return $option;
|
1187 |
*
|
1188 |
* @return array
|
1189 |
*/
|
1190 |
+
public static function setoptions($data, $option = array())
|
1191 |
+
{
|
1192 |
$_option = $option;
|
1193 |
+
if (is_array($data)) {
|
1194 |
+
foreach (array_keys(self::$option) as $key) {
|
1195 |
+
if (isset($data[$key])) {
|
1196 |
+
self::$option[$key] = $data[$key];
|
1197 |
+
unset($data[$key]);
|
1198 |
}
|
1199 |
}
|
1200 |
+
if (count($data) > 0) {
|
1201 |
+
self::$option = array_merge(self::$option, $data);
|
1202 |
}
|
1203 |
} else {
|
1204 |
+
self::$option[$data] = $option;
|
1205 |
}
|
1206 |
|
1207 |
return $_option;
|
1215 |
*
|
1216 |
* @return mixed
|
1217 |
*/
|
1218 |
+
public static function removeoptions($data, $option = array())
|
1219 |
+
{
|
1220 |
+
if (is_array($data)) {
|
1221 |
+
foreach ($data as $val) {
|
1222 |
+
if (isset(self::$option[$val])) {
|
1223 |
+
unset(self::$option[$val]);
|
1224 |
}
|
1225 |
}
|
1226 |
} else {
|
1227 |
+
unset(self::$option[$data]);
|
1228 |
}
|
1229 |
|
1230 |
return $option;
|
1240 |
*
|
1241 |
* @return string
|
1242 |
*/
|
1243 |
+
public static function _checkboxonoff($data = '', $checked = false, $extra = '', $value = 'on')
|
1244 |
+
{
|
1245 |
+
$class = sprintf(' %s-form-onoff', self::$_name);
|
1246 |
+
if (is_array($extra)) {
|
1247 |
+
if (isset($extra['class'])) {
|
1248 |
$extra['class'] .= $class;
|
1249 |
} else {
|
1250 |
$extra['class'] = $class;
|
1251 |
}
|
1252 |
} else {
|
1253 |
+
$extra .= sprintf(' class="%s" ', $class);
|
1254 |
}
|
1255 |
|
1256 |
+
return self::_checkbox($data, $checked, $extra, $value);
|
1257 |
}
|
1258 |
|
1259 |
/**
|
1266 |
*
|
1267 |
* @return string
|
1268 |
*/
|
1269 |
+
public static function _multiradiobox($data = '', $value = '', $extra = '', $options = array())
|
1270 |
+
{
|
1271 |
+
if (!is_array($data)) {
|
1272 |
+
$data = array('name' => $data);
|
1273 |
}
|
1274 |
$extra_input = '';
|
1275 |
+
$class = sprintf(' %s-form-multirbox', self::$_name);
|
1276 |
+
if (is_array($extra)) {
|
1277 |
+
if (isset($extra['class'])) {
|
1278 |
$extra['class'] .= $class;
|
1279 |
} else {
|
1280 |
$extra['class'] = $class;
|
1281 |
}
|
1282 |
+
if (isset($extra['input'])) {
|
1283 |
$extra_input = $extra['input'];
|
1284 |
+
unset($extra['input']);
|
1285 |
}
|
1286 |
} else {
|
1287 |
+
$extra .= sprintf(' class="%s" ', $class);
|
1288 |
}
|
1289 |
|
1290 |
+
return sprintf('<div id="%s" %s >%s</div>', self::__createid($data['name']), self::__atrtostr($extra), self::_multiradio($data, $value, $extra_input, $options));
|
1291 |
}
|
1292 |
|
1293 |
/**
|
1299 |
*
|
1300 |
* @return string
|
1301 |
*/
|
1302 |
+
public static function _numberrange($data = '', $value = 0, $extra = array())
|
1303 |
+
{
|
1304 |
+
if (!is_array($data)) {
|
1305 |
+
$data = array('name' => $data);
|
1306 |
}
|
1307 |
$data['type'] = 'range';
|
1308 |
+
$class = sprintf(' %s-form-range', self::$_name);
|
1309 |
+
if (is_array($extra)) {
|
1310 |
+
if (isset($extra['class'])) {
|
1311 |
$extra['class'] = $class;
|
1312 |
} else {
|
1313 |
$extra['class'] = $class;
|
1314 |
}
|
1315 |
} else {
|
1316 |
+
$extra .= sprintf(' class="%s" ', $class);
|
1317 |
}
|
1318 |
|
1319 |
+
return self::_text($data, $value, $extra);
|
1320 |
}
|
1321 |
}
|
integrations/advanced-product-fields-for-woocommerce-pro.php
CHANGED
@@ -26,7 +26,7 @@ $name = "Advanced Product Fields for WooCommerce Pro";
|
|
26 |
|
27 |
$available = class_exists('SW_WAPF_PRO\WAPF');
|
28 |
|
29 |
-
$tinvwl_integrations = is_array(
|
30 |
|
31 |
$tinvwl_integrations[$slug] = array(
|
32 |
'name' => $name,
|
26 |
|
27 |
$available = class_exists('SW_WAPF_PRO\WAPF');
|
28 |
|
29 |
+
$tinvwl_integrations = is_array($tinvwl_integrations) ? $tinvwl_integrations : [];
|
30 |
|
31 |
$tinvwl_integrations[$slug] = array(
|
32 |
'name' => $name,
|
integrations/advanced-product-fields-for-woocommerce.php
CHANGED
@@ -13,6 +13,7 @@
|
|
13 |
*/
|
14 |
|
15 |
// If this file is called directly, abort.
|
|
|
16 |
if (!defined('ABSPATH')) {
|
17 |
exit;
|
18 |
}
|
13 |
*/
|
14 |
|
15 |
// If this file is called directly, abort.
|
16 |
+
|
17 |
if (!defined('ABSPATH')) {
|
18 |
exit;
|
19 |
}
|
integrations/automatewoo.php
CHANGED
@@ -26,7 +26,7 @@ $name = "AutomateWoo";
|
|
26 |
|
27 |
$available = class_exists('AutomateWoo');
|
28 |
|
29 |
-
$tinvwl_integrations = is_array(
|
30 |
|
31 |
$tinvwl_integrations[$slug] = array(
|
32 |
'name' => $name,
|
26 |
|
27 |
$available = class_exists('AutomateWoo');
|
28 |
|
29 |
+
$tinvwl_integrations = is_array($tinvwl_integrations) ? $tinvwl_integrations : [];
|
30 |
|
31 |
$tinvwl_integrations[$slug] = array(
|
32 |
'name' => $name,
|
integrations/automatewoo/trigger-wishlist-item-added-to-cart.php
CHANGED
@@ -1,23 +1,27 @@
|
|
1 |
<?php
|
2 |
-
if (
|
3 |
exit;
|
4 |
}
|
5 |
|
6 |
-
class TINVWL_Trigger_Wishlist_Item_Added_To_Cart extends AutomateWoo\Trigger
|
|
|
7 |
|
8 |
-
public $supplied_data_items = array(
|
9 |
|
10 |
-
function load_admin_details()
|
11 |
-
|
12 |
-
$this->
|
|
|
13 |
}
|
14 |
|
15 |
-
function load_fields()
|
|
|
16 |
$this->add_field_user_pause_period();
|
17 |
}
|
18 |
|
19 |
-
function register_hooks()
|
20 |
-
|
|
|
21 |
}
|
22 |
|
23 |
/**
|
@@ -27,21 +31,22 @@ class TINVWL_Trigger_Wishlist_Item_Added_To_Cart extends AutomateWoo\Trigger {
|
|
27 |
* @param integer $quantity Product quantity.
|
28 |
* @param array $product product data.
|
29 |
*/
|
30 |
-
function catch_hooks(
|
|
|
31 |
|
32 |
-
if (
|
33 |
return;
|
34 |
}
|
35 |
|
36 |
-
$wishlist
|
37 |
-
$wishlist->id
|
38 |
$wishlist->owner_id = $product['author'];
|
39 |
|
40 |
-
$this->maybe_run(
|
41 |
-
'customer' => AutomateWoo\Customer_Factory::get_by_user_id(
|
42 |
'wishlist' => $wishlist,
|
43 |
-
'product'
|
44 |
-
)
|
45 |
|
46 |
}
|
47 |
|
@@ -50,8 +55,9 @@ class TINVWL_Trigger_Wishlist_Item_Added_To_Cart extends AutomateWoo\Trigger {
|
|
50 |
*
|
51 |
* @return bool
|
52 |
*/
|
53 |
-
function validate_workflow(
|
54 |
-
|
|
|
55 |
return false;
|
56 |
}
|
57 |
|
@@ -64,10 +70,11 @@ class TINVWL_Trigger_Wishlist_Item_Added_To_Cart extends AutomateWoo\Trigger {
|
|
64 |
*
|
65 |
* @return bool
|
66 |
*/
|
67 |
-
function validate_before_queued_event(
|
|
|
68 |
$product = $workflow->data_layer()->get_product();
|
69 |
|
70 |
-
if (
|
71 |
return false;
|
72 |
}
|
73 |
|
1 |
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
exit;
|
4 |
}
|
5 |
|
6 |
+
class TINVWL_Trigger_Wishlist_Item_Added_To_Cart extends AutomateWoo\Trigger
|
7 |
+
{
|
8 |
|
9 |
+
public $supplied_data_items = array('customer', 'product', 'wishlist');
|
10 |
|
11 |
+
function load_admin_details()
|
12 |
+
{
|
13 |
+
$this->title = __('Customer Added Product From Wishlist To Cart (TI WooCommerce Wishlist)', 'ti-woocommerce-wishlist');
|
14 |
+
$this->group = __('Wishlists', 'ti-woocommerce-wishlist');
|
15 |
}
|
16 |
|
17 |
+
function load_fields()
|
18 |
+
{
|
19 |
$this->add_field_user_pause_period();
|
20 |
}
|
21 |
|
22 |
+
function register_hooks()
|
23 |
+
{
|
24 |
+
add_action('tinvwl_product_added_to_cart', array($this, 'catch_hooks'), 10, 3);
|
25 |
}
|
26 |
|
27 |
/**
|
31 |
* @param integer $quantity Product quantity.
|
32 |
* @param array $product product data.
|
33 |
*/
|
34 |
+
function catch_hooks($cart_item_key, $quantity, $product)
|
35 |
+
{
|
36 |
|
37 |
+
if (!$this->has_workflows()) {
|
38 |
return;
|
39 |
}
|
40 |
|
41 |
+
$wishlist = new TINVWL_AutomateWoo_Wishlist();
|
42 |
+
$wishlist->id = $product['wishlist_id'];
|
43 |
$wishlist->owner_id = $product['author'];
|
44 |
|
45 |
+
$this->maybe_run(array(
|
46 |
+
'customer' => AutomateWoo\Customer_Factory::get_by_user_id($product['author']),
|
47 |
'wishlist' => $wishlist,
|
48 |
+
'product' => wc_get_product($product['product_id']),
|
49 |
+
));
|
50 |
|
51 |
}
|
52 |
|
55 |
*
|
56 |
* @return bool
|
57 |
*/
|
58 |
+
function validate_workflow($workflow)
|
59 |
+
{
|
60 |
+
if (!$this->validate_field_user_pause_period($workflow)) {
|
61 |
return false;
|
62 |
}
|
63 |
|
70 |
*
|
71 |
* @return bool
|
72 |
*/
|
73 |
+
function validate_before_queued_event($workflow)
|
74 |
+
{
|
75 |
$product = $workflow->data_layer()->get_product();
|
76 |
|
77 |
+
if (!$product) {
|
78 |
return false;
|
79 |
}
|
80 |
|
integrations/automatewoo/trigger-wishlist-item-added.php
CHANGED
@@ -1,23 +1,27 @@
|
|
1 |
<?php
|
2 |
-
if (
|
3 |
exit;
|
4 |
}
|
5 |
|
6 |
-
class TINVWL_Trigger_Wishlist_Item_Added extends AutomateWoo\Trigger
|
|
|
7 |
|
8 |
-
public $supplied_data_items = array(
|
9 |
|
10 |
-
function load_admin_details()
|
11 |
-
|
12 |
-
$this->
|
|
|
13 |
}
|
14 |
|
15 |
-
function load_fields()
|
|
|
16 |
$this->add_field_user_pause_period();
|
17 |
}
|
18 |
|
19 |
-
function register_hooks()
|
20 |
-
|
|
|
21 |
}
|
22 |
|
23 |
/**
|
@@ -25,21 +29,22 @@ class TINVWL_Trigger_Wishlist_Item_Added extends AutomateWoo\Trigger {
|
|
25 |
*
|
26 |
* @param array $data
|
27 |
*/
|
28 |
-
function catch_hooks(
|
|
|
29 |
|
30 |
-
if (
|
31 |
return;
|
32 |
}
|
33 |
|
34 |
-
$wishlist
|
35 |
-
$wishlist->id
|
36 |
$wishlist->owner_id = $data['author'];
|
37 |
|
38 |
-
$this->maybe_run(
|
39 |
-
'customer' => AutomateWoo\Customer_Factory::get_by_user_id(
|
40 |
'wishlist' => $wishlist,
|
41 |
-
'product'
|
42 |
-
)
|
43 |
|
44 |
}
|
45 |
|
@@ -48,8 +53,9 @@ class TINVWL_Trigger_Wishlist_Item_Added extends AutomateWoo\Trigger {
|
|
48 |
*
|
49 |
* @return bool
|
50 |
*/
|
51 |
-
function validate_workflow(
|
52 |
-
|
|
|
53 |
return false;
|
54 |
}
|
55 |
|
@@ -62,10 +68,11 @@ class TINVWL_Trigger_Wishlist_Item_Added extends AutomateWoo\Trigger {
|
|
62 |
*
|
63 |
* @return bool
|
64 |
*/
|
65 |
-
function validate_before_queued_event(
|
|
|
66 |
$product = $workflow->data_layer()->get_product();
|
67 |
|
68 |
-
if (
|
69 |
return false;
|
70 |
}
|
71 |
|
1 |
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
exit;
|
4 |
}
|
5 |
|
6 |
+
class TINVWL_Trigger_Wishlist_Item_Added extends AutomateWoo\Trigger
|
7 |
+
{
|
8 |
|
9 |
+
public $supplied_data_items = array('customer', 'product', 'wishlist');
|
10 |
|
11 |
+
function load_admin_details()
|
12 |
+
{
|
13 |
+
$this->title = __('Customer Added Product To Wishlist (TI WooCommerce Wishlist)', 'ti-woocommerce-wishlist');
|
14 |
+
$this->group = __('Wishlists', 'ti-woocommerce-wishlist');
|
15 |
}
|
16 |
|
17 |
+
function load_fields()
|
18 |
+
{
|
19 |
$this->add_field_user_pause_period();
|
20 |
}
|
21 |
|
22 |
+
function register_hooks()
|
23 |
+
{
|
24 |
+
add_action('tinvwl_product_added', array($this, 'catch_hooks'));
|
25 |
}
|
26 |
|
27 |
/**
|
29 |
*
|
30 |
* @param array $data
|
31 |
*/
|
32 |
+
function catch_hooks($data)
|
33 |
+
{
|
34 |
|
35 |
+
if (!$this->has_workflows()) {
|
36 |
return;
|
37 |
}
|
38 |
|
39 |
+
$wishlist = new TINVWL_AutomateWoo_Wishlist();
|
40 |
+
$wishlist->id = $data['wishlist_id'];
|
41 |
$wishlist->owner_id = $data['author'];
|
42 |
|
43 |
+
$this->maybe_run(array(
|
44 |
+
'customer' => AutomateWoo\Customer_Factory::get_by_user_id($data['author']),
|
45 |
'wishlist' => $wishlist,
|
46 |
+
'product' => wc_get_product($data['product_id']),
|
47 |
+
));
|
48 |
|
49 |
}
|
50 |
|
53 |
*
|
54 |
* @return bool
|
55 |
*/
|
56 |
+
function validate_workflow($workflow)
|
57 |
+
{
|
58 |
+
if (!$this->validate_field_user_pause_period($workflow)) {
|
59 |
return false;
|
60 |
}
|
61 |
|
68 |
*
|
69 |
* @return bool
|
70 |
*/
|
71 |
+
function validate_before_queued_event($workflow)
|
72 |
+
{
|
73 |
$product = $workflow->data_layer()->get_product();
|
74 |
|
75 |
+
if (!$product) {
|
76 |
return false;
|
77 |
}
|
78 |
|
integrations/automatewoo/trigger-wishlist-item-purchased.php
CHANGED
@@ -1,23 +1,27 @@
|
|
1 |
<?php
|
2 |
-
if (
|
3 |
exit;
|
4 |
}
|
5 |
|
6 |
-
class TINVWL_Trigger_Wishlist_Item_Purchased extends AutomateWoo\Trigger
|
|
|
7 |
|
8 |
-
public $supplied_data_items = array(
|
9 |
|
10 |
-
function load_admin_details()
|
11 |
-
|
12 |
-
$this->
|
|
|
13 |
}
|
14 |
|
15 |
-
function load_fields()
|
|
|
16 |
$this->add_field_user_pause_period();
|
17 |
}
|
18 |
|
19 |
-
function register_hooks()
|
20 |
-
|
|
|
21 |
}
|
22 |
|
23 |
/**
|
@@ -27,21 +31,22 @@ class TINVWL_Trigger_Wishlist_Item_Purchased extends AutomateWoo\Trigger {
|
|
27 |
* @param WC_Order_Item_Product $item Order item product object.
|
28 |
* @param array $wishlist_data A wishlist data where product added from.
|
29 |
*/
|
30 |
-
function catch_hooks(
|
|
|
31 |
|
32 |
-
if (
|
33 |
return;
|
34 |
}
|
35 |
|
36 |
-
$wishlist
|
37 |
-
$wishlist->id
|
38 |
$wishlist->owner_id = $wishlist_data['author'];
|
39 |
|
40 |
-
$this->maybe_run(
|
41 |
-
'customer' => AutomateWoo\Customer_Factory::get_by_user_id(
|
42 |
'wishlist' => $wishlist,
|
43 |
-
'product'
|
44 |
-
)
|
45 |
|
46 |
}
|
47 |
|
@@ -50,8 +55,9 @@ class TINVWL_Trigger_Wishlist_Item_Purchased extends AutomateWoo\Trigger {
|
|
50 |
*
|
51 |
* @return bool
|
52 |
*/
|
53 |
-
function validate_workflow(
|
54 |
-
|
|
|
55 |
return false;
|
56 |
}
|
57 |
|
@@ -64,10 +70,11 @@ class TINVWL_Trigger_Wishlist_Item_Purchased extends AutomateWoo\Trigger {
|
|
64 |
*
|
65 |
* @return bool
|
66 |
*/
|
67 |
-
function validate_before_queued_event(
|
|
|
68 |
$product = $workflow->data_layer()->get_product();
|
69 |
|
70 |
-
if (
|
71 |
return false;
|
72 |
}
|
73 |
|
1 |
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
exit;
|
4 |
}
|
5 |
|
6 |
+
class TINVWL_Trigger_Wishlist_Item_Purchased extends AutomateWoo\Trigger
|
7 |
+
{
|
8 |
|
9 |
+
public $supplied_data_items = array('customer', 'product', 'wishlist');
|
10 |
|
11 |
+
function load_admin_details()
|
12 |
+
{
|
13 |
+
$this->title = __('Product Purchased From Wishlist (TI WooCommerce Wishlist)', 'ti-woocommerce-wishlist');
|
14 |
+
$this->group = __('Wishlists', 'ti-woocommerce-wishlist');
|
15 |
}
|
16 |
|
17 |
+
function load_fields()
|
18 |
+
{
|
19 |
$this->add_field_user_pause_period();
|
20 |
}
|
21 |
|
22 |
+
function register_hooks()
|
23 |
+
{
|
24 |
+
add_action('tinvwl_product_purchased', array($this, 'catch_hooks'), 10, 3);
|
25 |
}
|
26 |
|
27 |
/**
|
31 |
* @param WC_Order_Item_Product $item Order item product object.
|
32 |
* @param array $wishlist_data A wishlist data where product added from.
|
33 |
*/
|
34 |
+
function catch_hooks($order, $item, $wishlist_data)
|
35 |
+
{
|
36 |
|
37 |
+
if (!$this->has_workflows()) {
|
38 |
return;
|
39 |
}
|
40 |
|
41 |
+
$wishlist = new TINVWL_AutomateWoo_Wishlist();
|
42 |
+
$wishlist->id = $wishlist_data['ID'];
|
43 |
$wishlist->owner_id = $wishlist_data['author'];
|
44 |
|
45 |
+
$this->maybe_run(array(
|
46 |
+
'customer' => AutomateWoo\Customer_Factory::get_by_user_id($wishlist_data['author']),
|
47 |
'wishlist' => $wishlist,
|
48 |
+
'product' => wc_get_product($item->get_product_id()),
|
49 |
+
));
|
50 |
|
51 |
}
|
52 |
|
55 |
*
|
56 |
* @return bool
|
57 |
*/
|
58 |
+
function validate_workflow($workflow)
|
59 |
+
{
|
60 |
+
if (!$this->validate_field_user_pause_period($workflow)) {
|
61 |
return false;
|
62 |
}
|
63 |
|
70 |
*
|
71 |
* @return bool
|
72 |
*/
|
73 |
+
function validate_before_queued_event($workflow)
|
74 |
+
{
|
75 |
$product = $workflow->data_layer()->get_product();
|
76 |
|
77 |
+
if (!$product) {
|
78 |
return false;
|
79 |
}
|
80 |
|
integrations/automatewoo/trigger-wishlist-item-removed.php
CHANGED
@@ -1,24 +1,28 @@
|
|
1 |
<?php
|
2 |
-
if (
|
3 |
exit;
|
4 |
}
|
5 |
|
6 |
-
class TINVWL_Trigger_Wishlist_Item_Removed extends AutomateWoo\Trigger
|
|
|
7 |
|
8 |
-
public $supplied_data_items = array(
|
9 |
|
10 |
-
function load_admin_details()
|
11 |
-
|
12 |
-
$this->
|
|
|
13 |
}
|
14 |
|
15 |
-
function load_fields()
|
|
|
16 |
$this->add_field_user_pause_period();
|
17 |
}
|
18 |
|
19 |
-
function register_hooks()
|
|
|
20 |
//TODO: add support for bulk remove action.
|
21 |
-
add_action(
|
22 |
}
|
23 |
|
24 |
/**
|
@@ -26,21 +30,22 @@ class TINVWL_Trigger_Wishlist_Item_Removed extends AutomateWoo\Trigger {
|
|
26 |
*
|
27 |
* @param array $data
|
28 |
*/
|
29 |
-
function catch_hooks(
|
|
|
30 |
|
31 |
-
if (
|
32 |
return;
|
33 |
}
|
34 |
|
35 |
-
$wishlist
|
36 |
-
$wishlist->id
|
37 |
$wishlist->owner_id = $data['author'];
|
38 |
|
39 |
-
$this->maybe_run(
|
40 |
-
'customer' => AutomateWoo\Customer_Factory::get_by_user_id(
|
41 |
'wishlist' => $wishlist,
|
42 |
-
'product'
|
43 |
-
)
|
44 |
|
45 |
}
|
46 |
|
@@ -49,8 +54,9 @@ class TINVWL_Trigger_Wishlist_Item_Removed extends AutomateWoo\Trigger {
|
|
49 |
*
|
50 |
* @return bool
|
51 |
*/
|
52 |
-
function validate_workflow(
|
53 |
-
|
|
|
54 |
return false;
|
55 |
}
|
56 |
|
@@ -63,10 +69,11 @@ class TINVWL_Trigger_Wishlist_Item_Removed extends AutomateWoo\Trigger {
|
|
63 |
*
|
64 |
* @return bool
|
65 |
*/
|
66 |
-
function validate_before_queued_event(
|
|
|
67 |
$product = $workflow->data_layer()->get_product();
|
68 |
|
69 |
-
if (
|
70 |
return false;
|
71 |
}
|
72 |
|
1 |
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
exit;
|
4 |
}
|
5 |
|
6 |
+
class TINVWL_Trigger_Wishlist_Item_Removed extends AutomateWoo\Trigger
|
7 |
+
{
|
8 |
|
9 |
+
public $supplied_data_items = array('customer', 'product', 'wishlist');
|
10 |
|
11 |
+
function load_admin_details()
|
12 |
+
{
|
13 |
+
$this->title = __('Customer Removed Product From Wishlist (TI WooCommerce Wishlist)', 'ti-woocommerce-wishlist');
|
14 |
+
$this->group = __('Wishlists', 'ti-woocommerce-wishlist');
|
15 |
}
|
16 |
|
17 |
+
function load_fields()
|
18 |
+
{
|
19 |
$this->add_field_user_pause_period();
|
20 |
}
|
21 |
|
22 |
+
function register_hooks()
|
23 |
+
{
|
24 |
//TODO: add support for bulk remove action.
|
25 |
+
add_action('tinvwl_product_removed', array($this, 'catch_hooks'));
|
26 |
}
|
27 |
|
28 |
/**
|
30 |
*
|
31 |
* @param array $data
|
32 |
*/
|
33 |
+
function catch_hooks($data)
|
34 |
+
{
|
35 |
|
36 |
+
if (!$this->has_workflows()) {
|
37 |
return;
|
38 |
}
|
39 |
|
40 |
+
$wishlist = new TINVWL_AutomateWoo_Wishlist();
|
41 |
+
$wishlist->id = $data['wishlist_id'];
|
42 |
$wishlist->owner_id = $data['author'];
|
43 |
|
44 |
+
$this->maybe_run(array(
|
45 |
+
'customer' => AutomateWoo\Customer_Factory::get_by_user_id($data['author']),
|
46 |
'wishlist' => $wishlist,
|
47 |
+
'product' => wc_get_product($data['product_id']),
|
48 |
+
));
|
49 |
|
50 |
}
|
51 |
|
54 |
*
|
55 |
* @return bool
|
56 |
*/
|
57 |
+
function validate_workflow($workflow)
|
58 |
+
{
|
59 |
+
if (!$this->validate_field_user_pause_period($workflow)) {
|
60 |
return false;
|
61 |
}
|
62 |
|
69 |
*
|
70 |
* @return bool
|
71 |
*/
|
72 |
+
function validate_before_queued_event($workflow)
|
73 |
+
{
|
74 |
$product = $workflow->data_layer()->get_product();
|
75 |
|
76 |
+
if (!$product) {
|
77 |
return false;
|
78 |
}
|
79 |
|
integrations/check-pincodezipcode-for-shipping-woocommerce.php
CHANGED
@@ -24,9 +24,9 @@ $slug = "check-pincodezipcode-for-shipping-woocommerce";
|
|
24 |
|
25 |
$name = "Check Pincode/Zipcode for Shipping Woocommerce";
|
26 |
|
27 |
-
$available = defined(
|
28 |
|
29 |
-
$tinvwl_integrations = is_array(
|
30 |
|
31 |
$tinvwl_integrations[$slug] = array(
|
32 |
'name' => $name,
|
@@ -41,7 +41,7 @@ if (!$available) {
|
|
41 |
return;
|
42 |
}
|
43 |
|
44 |
-
if (
|
45 |
|
46 |
/**
|
47 |
* Set description for meta Check Pincode/Zipcode for Shipping Woocommerce
|
@@ -53,11 +53,12 @@ if ( defined( 'WCZP_PLUGIN_NAME' ) ) {
|
|
53 |
* @return array
|
54 |
*/
|
55 |
|
56 |
-
function tinv_wishlist_item_meta_wczp(
|
|
|
57 |
|
58 |
-
foreach (
|
59 |
-
if (
|
60 |
-
unset(
|
61 |
}
|
62 |
}
|
63 |
|
@@ -65,5 +66,5 @@ if ( defined( 'WCZP_PLUGIN_NAME' ) ) {
|
|
65 |
return $item_data;
|
66 |
}
|
67 |
|
68 |
-
add_filter(
|
69 |
}
|
24 |
|
25 |
$name = "Check Pincode/Zipcode for Shipping Woocommerce";
|
26 |
|
27 |
+
$available = defined('WCZP_PLUGIN_NAME');
|
28 |
|
29 |
+
$tinvwl_integrations = is_array($tinvwl_integrations) ? $tinvwl_integrations : [];
|
30 |
|
31 |
$tinvwl_integrations[$slug] = array(
|
32 |
'name' => $name,
|
41 |
return;
|
42 |
}
|
43 |
|
44 |
+
if (defined('WCZP_PLUGIN_NAME')) {
|
45 |
|
46 |
/**
|
47 |
* Set description for meta Check Pincode/Zipcode for Shipping Woocommerce
|
53 |
* @return array
|
54 |
*/
|
55 |
|
56 |
+
function tinv_wishlist_item_meta_wczp($item_data, $product_id, $variation_id)
|
57 |
+
{
|
58 |
|
59 |
+
foreach (array_keys($item_data) as $key) {
|
60 |
+
if (strpos($key, 'wczp') === 0) {
|
61 |
+
unset($item_data[$key]);
|
62 |
}
|
63 |
}
|
64 |
|
66 |
return $item_data;
|
67 |
}
|
68 |
|
69 |
+
add_filter('tinvwl_wishlist_item_meta_post', 'tinv_wishlist_item_meta_wczp', 10, 3);
|
70 |
}
|
integrations/clever-swatches.php
CHANGED
@@ -26,7 +26,7 @@ $name = "Clever Swatches";
|
|
26 |
|
27 |
$available = class_exists('Zoo_Clever_Swatch_Install');
|
28 |
|
29 |
-
$tinvwl_integrations = is_array(
|
30 |
|
31 |
$tinvwl_integrations[$slug] = array(
|
32 |
'name' => $name,
|
26 |
|
27 |
$available = class_exists('Zoo_Clever_Swatch_Install');
|
28 |
|
29 |
+
$tinvwl_integrations = is_array($tinvwl_integrations) ? $tinvwl_integrations : [];
|
30 |
|
31 |
$tinvwl_integrations[$slug] = array(
|
32 |
'name' => $name,
|
integrations/mycred.php
CHANGED
@@ -26,7 +26,7 @@ $name = "myCRED";
|
|
26 |
|
27 |
$available = defined('myCRED_VERSION');
|
28 |
|
29 |
-
$tinvwl_integrations = is_array(
|
30 |
|
31 |
$tinvwl_integrations[$slug] = array(
|
32 |
'name' => $name,
|
26 |
|
27 |
$available = defined('myCRED_VERSION');
|
28 |
|
29 |
+
$tinvwl_integrations = is_array($tinvwl_integrations) ? $tinvwl_integrations : [];
|
30 |
|
31 |
$tinvwl_integrations[$slug] = array(
|
32 |
'name' => $name,
|
integrations/product-extras-for-woocommerce.php
CHANGED
@@ -60,6 +60,13 @@ if (!function_exists('tinv_wishlist_item_meta_pewc')) {
|
|
60 |
// Check for product_extra groups
|
61 |
$product_extra_groups = pewc_get_extra_fields($product_id);
|
62 |
$hidden_group_types = apply_filters('pewc_hidden_field_types_in_cart', array());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
if ($product_extra_groups) {
|
64 |
|
65 |
foreach ($product_extra_groups as $group) {
|
@@ -68,12 +75,17 @@ if (!function_exists('tinv_wishlist_item_meta_pewc')) {
|
|
68 |
|
69 |
foreach ($group['items'] as $item) {
|
70 |
|
71 |
-
|
72 |
if (in_array($item['field_type'], $hidden_group_types)) {
|
73 |
// Don't add this to the cart if it's a hidden field type
|
74 |
continue;
|
75 |
}
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
// Don't display hidden fields
|
78 |
if (isset($item['hidden_calculation'])) {
|
79 |
continue;
|
60 |
// Check for product_extra groups
|
61 |
$product_extra_groups = pewc_get_extra_fields($product_id);
|
62 |
$hidden_group_types = apply_filters('pewc_hidden_field_types_in_cart', array());
|
63 |
+
|
64 |
+
$posted_data = array();
|
65 |
+
|
66 |
+
foreach ($item_data as $values) {
|
67 |
+
$posted_data[$values['key']] = $values['display'];
|
68 |
+
}
|
69 |
+
|
70 |
if ($product_extra_groups) {
|
71 |
|
72 |
foreach ($product_extra_groups as $group) {
|
75 |
|
76 |
foreach ($group['items'] as $item) {
|
77 |
|
|
|
78 |
if (in_array($item['field_type'], $hidden_group_types)) {
|
79 |
// Don't add this to the cart if it's a hidden field type
|
80 |
continue;
|
81 |
}
|
82 |
|
83 |
+
$is_visible = pewc_get_conditional_field_visibility($item['id'], $item, $group['items'], $product_id, $posted_data, $variation_id);
|
84 |
+
|
85 |
+
if (!$is_visible) {
|
86 |
+
continue;
|
87 |
+
}
|
88 |
+
|
89 |
// Don't display hidden fields
|
90 |
if (isset($item['hidden_calculation'])) {
|
91 |
continue;
|
integrations/woocommerce-bookings.php
CHANGED
@@ -166,19 +166,16 @@ if (class_exists('WC_Bookings')) {
|
|
166 |
add_filter('tinvwl_wishlist_item_status', 'tinvwl_item_status_woocommerce_bookings', 10, 4);
|
167 |
}
|
168 |
|
169 |
-
|
170 |
add_filter('woocommerce_product_object_query_args', 'tinvwl_item_product_type_woocommerce_bookings');
|
171 |
|
172 |
function tinvwl_item_product_type_woocommerce_bookings($args)
|
173 |
{
|
174 |
-
|
175 |
if (!is_array($args['type'])) {
|
176 |
$args['type'] = [$args['type']];
|
177 |
}
|
178 |
|
179 |
$args['type'][] = 'booking';
|
180 |
|
181 |
-
|
182 |
return $args;
|
183 |
}
|
184 |
}
|
166 |
add_filter('tinvwl_wishlist_item_status', 'tinvwl_item_status_woocommerce_bookings', 10, 4);
|
167 |
}
|
168 |
|
|
|
169 |
add_filter('woocommerce_product_object_query_args', 'tinvwl_item_product_type_woocommerce_bookings');
|
170 |
|
171 |
function tinvwl_item_product_type_woocommerce_bookings($args)
|
172 |
{
|
|
|
173 |
if (!is_array($args['type'])) {
|
174 |
$args['type'] = [$args['type']];
|
175 |
}
|
176 |
|
177 |
$args['type'][] = 'booking';
|
178 |
|
|
|
179 |
return $args;
|
180 |
}
|
181 |
}
|
integrations/woocommerce-gravityforms-product-addons.php
CHANGED
@@ -51,7 +51,7 @@ if (!function_exists('tinvwl_gf_productaddon_support')) {
|
|
51 |
if (!class_exists('woocommerce_gravityforms')) {
|
52 |
return false;
|
53 |
}
|
54 |
-
if (!function_exists('
|
55 |
|
56 |
/**
|
57 |
* Change text for button add to cart
|
@@ -62,17 +62,17 @@ if (!function_exists('tinvwl_gf_productaddon_support')) {
|
|
62 |
*
|
63 |
* @return string
|
64 |
*/
|
65 |
-
function
|
66 |
{
|
67 |
$gravity_form_data = get_post_meta((($product->is_type('variation') ? $product->get_parent_id() : $product->get_id())), '_gravity_form_data', true);
|
68 |
|
69 |
return ($gravity_form_data) ? __('Select options', 'ti-woocommerce-wishlist') : $text_add_to_cart;
|
70 |
}
|
71 |
|
72 |
-
add_filter('tinvwl_wishlist_item_add_to_cart', '
|
73 |
}
|
74 |
|
75 |
-
if (!function_exists('
|
76 |
|
77 |
/**
|
78 |
* Check for make redirect to url
|
@@ -82,14 +82,14 @@ if (!function_exists('tinvwl_gf_productaddon_support')) {
|
|
82 |
*
|
83 |
* @return boolean
|
84 |
*/
|
85 |
-
function
|
86 |
{
|
87 |
$gravity_form_data = get_post_meta(($product->is_type('variation') ? $product->get_parent_id() : $product->get_id()), '_gravity_form_data', true);
|
88 |
|
89 |
return ($gravity_form_data) ? true : $need;
|
90 |
}
|
91 |
|
92 |
-
add_filter('tinvwl_product_add_to_cart_need_redirect', '
|
93 |
}
|
94 |
|
95 |
if (!function_exists('gf_productaddon_action_button')) {
|
51 |
if (!class_exists('woocommerce_gravityforms')) {
|
52 |
return false;
|
53 |
}
|
54 |
+
if (!function_exists('tinvwl_gf_productaddon_text_button')) {
|
55 |
|
56 |
/**
|
57 |
* Change text for button add to cart
|
62 |
*
|
63 |
* @return string
|
64 |
*/
|
65 |
+
function tinvwl_gf_productaddon_text_button($text_add_to_cart, $wl_product, $product)
|
66 |
{
|
67 |
$gravity_form_data = get_post_meta((($product->is_type('variation') ? $product->get_parent_id() : $product->get_id())), '_gravity_form_data', true);
|
68 |
|
69 |
return ($gravity_form_data) ? __('Select options', 'ti-woocommerce-wishlist') : $text_add_to_cart;
|
70 |
}
|
71 |
|
72 |
+
add_filter('tinvwl_wishlist_item_add_to_cart', 'tinvwl_gf_productaddon_text_button', 10, 3);
|
73 |
}
|
74 |
|
75 |
+
if (!function_exists('tinvwl_gf_productaddon_run_action_button')) {
|
76 |
|
77 |
/**
|
78 |
* Check for make redirect to url
|
82 |
*
|
83 |
* @return boolean
|
84 |
*/
|
85 |
+
function tinvwl_gf_productaddon_run_action_button($need, $product)
|
86 |
{
|
87 |
$gravity_form_data = get_post_meta(($product->is_type('variation') ? $product->get_parent_id() : $product->get_id()), '_gravity_form_data', true);
|
88 |
|
89 |
return ($gravity_form_data) ? true : $need;
|
90 |
}
|
91 |
|
92 |
+
add_filter('tinvwl_product_add_to_cart_need_redirect', 'tinvwl_gf_productaddon_run_action_button', 10, 2);
|
93 |
}
|
94 |
|
95 |
if (!function_exists('gf_productaddon_action_button')) {
|
integrations/woocommerce-multilingual.php
CHANGED
@@ -120,7 +120,6 @@ if (!function_exists('tinvwl_wpml_addtowishlist_check_product')) {
|
|
120 |
add_filter('tinvwl_addtowishlist_check_product', 'tinvwl_wpml_addtowishlist_check_product');
|
121 |
}
|
122 |
|
123 |
-
|
124 |
if (!function_exists('tinvwl_wpml_addtowishlist_out_prepare')) {
|
125 |
|
126 |
/**
|
@@ -144,7 +143,6 @@ if (!function_exists('tinvwl_wpml_addtowishlist_out_prepare')) {
|
|
144 |
if (!($woocommerce_wpml instanceof woocommerce_wpml) || !($sitepress instanceof SitePress) || !($wpml_post_translations instanceof WPML_Post_Translation)) {
|
145 |
return $attr;
|
146 |
}
|
147 |
-
|
148 |
$woocommerce_wpml->products = new WCML_Products($woocommerce_wpml, $sitepress, $wpml_post_translations, $wpdb);
|
149 |
}
|
150 |
|
120 |
add_filter('tinvwl_addtowishlist_check_product', 'tinvwl_wpml_addtowishlist_check_product');
|
121 |
}
|
122 |
|
|
|
123 |
if (!function_exists('tinvwl_wpml_addtowishlist_out_prepare')) {
|
124 |
|
125 |
/**
|
143 |
if (!($woocommerce_wpml instanceof woocommerce_wpml) || !($sitepress instanceof SitePress) || !($wpml_post_translations instanceof WPML_Post_Translation)) {
|
144 |
return $attr;
|
145 |
}
|
|
|
146 |
$woocommerce_wpml->products = new WCML_Products($woocommerce_wpml, $sitepress, $wpml_post_translations, $wpdb);
|
147 |
}
|
148 |
|
integrations/woocommerce-product-table.php
CHANGED
@@ -26,7 +26,7 @@ $name = "WooCommerce Product Table";
|
|
26 |
|
27 |
$available = class_exists('Barn2\Plugin\WC_Product_Table');
|
28 |
|
29 |
-
$tinvwl_integrations = is_array(
|
30 |
|
31 |
$tinvwl_integrations[$slug] = array(
|
32 |
'name' => $name,
|
26 |
|
27 |
$available = class_exists('Barn2\Plugin\WC_Product_Table');
|
28 |
|
29 |
+
$tinvwl_integrations = is_array($tinvwl_integrations) ? $tinvwl_integrations : [];
|
30 |
|
31 |
$tinvwl_integrations[$slug] = array(
|
32 |
'name' => $name,
|
integrations/wp-fastest-cache.php
CHANGED
@@ -49,7 +49,6 @@ if (!function_exists('tinvwl_wp_fastest_cache_reject')) {
|
|
49 |
{
|
50 |
if (defined('WPFC_WP_PLUGIN_DIR')) {
|
51 |
$rules_json = get_option('WpFastestCacheExclude');
|
52 |
-
|
53 |
$ids = array(
|
54 |
tinv_get_option('page', 'wishlist'),
|
55 |
tinv_get_option('page', 'manage'),
|
@@ -105,7 +104,6 @@ if (!function_exists('tinvwl_wp_fastest_cache_reject')) {
|
|
105 |
$data = json_encode($rules_std);
|
106 |
update_option('WpFastestCacheExclude', $data);
|
107 |
}
|
108 |
-
|
109 |
} // End if().
|
110 |
}
|
111 |
|
49 |
{
|
50 |
if (defined('WPFC_WP_PLUGIN_DIR')) {
|
51 |
$rules_json = get_option('WpFastestCacheExclude');
|
|
|
52 |
$ids = array(
|
53 |
tinv_get_option('page', 'wishlist'),
|
54 |
tinv_get_option('page', 'manage'),
|
104 |
$data = json_encode($rules_std);
|
105 |
update_option('WpFastestCacheExclude', $data);
|
106 |
}
|
|
|
107 |
} // End if().
|
108 |
}
|
109 |
|
languages/ti-woocommerce-wishlist.pot
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
# Copyright (C) 2021 TI WooCommerce Wishlist Plugin - 1.24.
|
2 |
-
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.24.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.24.
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -868,7 +868,7 @@ msgstr ""
|
|
868 |
msgid "There was an error exporting your settings, please try again."
|
869 |
msgstr ""
|
870 |
|
871 |
-
#: includes/form.helper.php:
|
872 |
msgid "Preview"
|
873 |
msgstr ""
|
874 |
|
@@ -972,23 +972,23 @@ msgstr ""
|
|
972 |
msgid "Ready!"
|
973 |
msgstr ""
|
974 |
|
975 |
-
#: integrations/automatewoo/trigger-wishlist-item-added-to-cart.php:
|
976 |
msgid "Customer Added Product From Wishlist To Cart (TI WooCommerce Wishlist)"
|
977 |
msgstr ""
|
978 |
|
979 |
-
#: integrations/automatewoo/trigger-wishlist-item-added-to-cart.php:
|
980 |
msgid "Wishlists"
|
981 |
msgstr ""
|
982 |
|
983 |
-
#: integrations/automatewoo/trigger-wishlist-item-added.php:
|
984 |
msgid "Customer Added Product To Wishlist (TI WooCommerce Wishlist)"
|
985 |
msgstr ""
|
986 |
|
987 |
-
#: integrations/automatewoo/trigger-wishlist-item-purchased.php:
|
988 |
msgid "Product Purchased From Wishlist (TI WooCommerce Wishlist)"
|
989 |
msgstr ""
|
990 |
|
991 |
-
#: integrations/automatewoo/trigger-wishlist-item-removed.php:
|
992 |
msgid "Customer Removed Product From Wishlist (TI WooCommerce Wishlist)"
|
993 |
msgstr ""
|
994 |
|
@@ -1076,7 +1076,7 @@ msgstr ""
|
|
1076 |
msgid "Added To Wishlist"
|
1077 |
msgstr ""
|
1078 |
|
1079 |
-
#: integrations/product-extras-for-woocommerce.php:
|
1080 |
msgid "Flat rate cost"
|
1081 |
msgstr ""
|
1082 |
|
1 |
+
# Copyright (C) 2021 TI WooCommerce Wishlist Plugin - 1.24.4
|
2 |
+
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.24.4 package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.24.4\n"
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
868 |
msgid "There was an error exporting your settings, please try again."
|
869 |
msgstr ""
|
870 |
|
871 |
+
#: includes/form.helper.php:527
|
872 |
msgid "Preview"
|
873 |
msgstr ""
|
874 |
|
972 |
msgid "Ready!"
|
973 |
msgstr ""
|
974 |
|
975 |
+
#: integrations/automatewoo/trigger-wishlist-item-added-to-cart.php:13
|
976 |
msgid "Customer Added Product From Wishlist To Cart (TI WooCommerce Wishlist)"
|
977 |
msgstr ""
|
978 |
|
979 |
+
#: integrations/automatewoo/trigger-wishlist-item-added-to-cart.php:14, integrations/automatewoo/trigger-wishlist-item-added.php:14, integrations/automatewoo/trigger-wishlist-item-purchased.php:14, integrations/automatewoo/trigger-wishlist-item-removed.php:14, integrations/automatewoo/trigger-wishlist-reminder.php:23
|
980 |
msgid "Wishlists"
|
981 |
msgstr ""
|
982 |
|
983 |
+
#: integrations/automatewoo/trigger-wishlist-item-added.php:13
|
984 |
msgid "Customer Added Product To Wishlist (TI WooCommerce Wishlist)"
|
985 |
msgstr ""
|
986 |
|
987 |
+
#: integrations/automatewoo/trigger-wishlist-item-purchased.php:13
|
988 |
msgid "Product Purchased From Wishlist (TI WooCommerce Wishlist)"
|
989 |
msgstr ""
|
990 |
|
991 |
+
#: integrations/automatewoo/trigger-wishlist-item-removed.php:13
|
992 |
msgid "Customer Removed Product From Wishlist (TI WooCommerce Wishlist)"
|
993 |
msgstr ""
|
994 |
|
1076 |
msgid "Added To Wishlist"
|
1077 |
msgstr ""
|
1078 |
|
1079 |
+
#: integrations/product-extras-for-woocommerce.php:106
|
1080 |
msgid "Flat rate cost"
|
1081 |
msgstr ""
|
1082 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: templateinvaders
|
|
3 |
Tags: woocommerce, wishlist, woocommerce wishlist, e-commerce, ecommerce
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.7
|
6 |
-
Stable tag: 1.24.
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
@@ -163,6 +163,11 @@ Yes, you can! Join in on our [GitHub repository](https://github.com/TemplateInva
|
|
163 |
|
164 |
|
165 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
166 |
= 1.24.3 =
|
167 |
*Release Date - 22 March 2021*
|
168 |
|
3 |
Tags: woocommerce, wishlist, woocommerce wishlist, e-commerce, ecommerce
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.7
|
6 |
+
Stable tag: 1.24.4
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
163 |
|
164 |
|
165 |
== Changelog ==
|
166 |
+
= 1.24.4 =
|
167 |
+
*Release Date - 25 March 2021*
|
168 |
+
|
169 |
+
* Security update
|
170 |
+
|
171 |
= 1.24.3 =
|
172 |
*Release Date - 22 March 2021*
|
173 |
|
ti-woocommerce-wishlist.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: TI WooCommerce Wishlist
|
5 |
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
6 |
* Description: Wishlist functionality for your WooCommerce store.
|
7 |
-
* Version: 1.24.
|
8 |
* Requires at least: 4.7
|
9 |
* Tested up to: 5.7
|
10 |
* WC requires at least: 3.0
|
@@ -41,7 +41,7 @@ if (!defined('TINVWL_DOMAIN')) {
|
|
41 |
}
|
42 |
|
43 |
if (!defined('TINVWL_FVERSION')) {
|
44 |
-
define('TINVWL_FVERSION', '1.24.
|
45 |
}
|
46 |
|
47 |
if (!defined('TINVWL_LOAD_FREE')) {
|
4 |
* Plugin Name: TI WooCommerce Wishlist
|
5 |
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
6 |
* Description: Wishlist functionality for your WooCommerce store.
|
7 |
+
* Version: 1.24.4
|
8 |
* Requires at least: 4.7
|
9 |
* Tested up to: 5.7
|
10 |
* WC requires at least: 3.0
|
41 |
}
|
42 |
|
43 |
if (!defined('TINVWL_FVERSION')) {
|
44 |
+
define('TINVWL_FVERSION', '1.24.4');
|
45 |
}
|
46 |
|
47 |
if (!defined('TINVWL_LOAD_FREE')) {
|