YITH WooCommerce Catalog Mode - Version 2.1.0

Version Description

Last Stable Tag 2.1.0

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Catalog Mode
Version 2.1.0
Comparing to
See all releases

Code changes from version 2.0.16 to 2.1.0

assets/css/admin.css CHANGED
@@ -1,9 +1,3 @@
1
- .yith-plugin-fw-yith-multiple-field-field-wrapper .option-element label,
2
- .yith-multiple-field .option-element label {
3
- font-size: 11px;
4
- font-weight: 600;
5
- }
6
-
7
  .ywctm-inline-selects .option-element {
8
  height: 100%;
9
  display: inline-flex;
@@ -26,57 +20,3 @@
26
  width: 220px !important;
27
  min-width: 220px !important;
28
  }
29
-
30
- .ywctm-multiple-numbers {
31
- display: grid;
32
- grid-template-columns: 90px 90px 90px 90px;
33
- grid-gap: 20px;
34
- }
35
-
36
- .ywctm-multiple-numbers .option-element {
37
- width: 90px;
38
- display: inline-block;
39
- }
40
-
41
- .ywctm-multiple-languages .option-element {
42
- display: block;
43
- }
44
-
45
- .ywctm-multiple-mixed {
46
- display: grid;
47
- grid-template-columns: 90px 90px;
48
- grid-gap: 20px;
49
- }
50
-
51
- .ywctm-multiple-mixed .option-element {
52
- width: 90px;
53
- display: inline-block;
54
- }
55
-
56
- .ywctm-multiple-mixed .option-element > .yith-plugin-fw-select-field-wrapper > .select2 {
57
- width: 90px !important;
58
- min-width: 90px !important;
59
- height: 38px !important;
60
- }
61
-
62
- .ywctm-multiple-sliders .option-element {
63
- display: grid;
64
- grid-template-columns: 10ch 400px;
65
- grid-gap: 2%;
66
- }
67
-
68
- .ywctm-multiple-sliders .option-element label {
69
- padding-top: 9px;
70
- }
71
-
72
- @media screen and (min-width: 1280px) {
73
- .yith-colorpicker-group {
74
- display: grid;
75
- grid-template-columns: fit-content(48%) fit-content(48%);
76
- grid-gap: 4%;
77
- }
78
-
79
- .yith-colorpicker-group .colorpicker {
80
- width: auto !important;
81
- }
82
- }
 
 
 
 
 
 
1
  .ywctm-inline-selects .option-element {
2
  height: 100%;
3
  display: inline-flex;
20
  width: 220px !important;
21
  min-width: 220px !important;
22
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/admin.min.css CHANGED
@@ -1 +1 @@
1
- .yith-multiple-field .option-element label,.yith-plugin-fw-yith-multiple-field-field-wrapper .option-element label{font-size:11px;font-weight:600}.ywctm-inline-selects .option-element{height:100%;display:inline-flex;align-items:center;padding:0 10px 0 0;vertical-align:top}.ywctm-inline-selects .option-element.hidden{padding:0}.ywctm-inline-selects .option-element>span{display:flex;min-height:38px;align-items:center}.woocommerce table.form-table .ywctm-inline-selects .option-element>.yith-plugin-fw-select-field-wrapper>.select2{width:220px!important;min-width:220px!important}.ywctm-multiple-numbers{display:grid;grid-template-columns:90px 90px 90px 90px;grid-gap:20px}.ywctm-multiple-numbers .option-element{width:90px;display:inline-block}.ywctm-multiple-languages .option-element{display:block}.ywctm-multiple-mixed{display:grid;grid-template-columns:90px 90px;grid-gap:20px}.ywctm-multiple-mixed .option-element{width:90px;display:inline-block}.ywctm-multiple-mixed .option-element>.yith-plugin-fw-select-field-wrapper>.select2{width:90px!important;min-width:90px!important;height:38px!important}.ywctm-multiple-sliders .option-element{display:grid;grid-template-columns:10ch 400px;grid-gap:2%}.ywctm-multiple-sliders .option-element label{padding-top:9px}@media screen and (min-width:1280px){.yith-colorpicker-group{display:grid;grid-template-columns:fit-content(48%) fit-content(48%);grid-gap:4%}.yith-colorpicker-group .colorpicker{width:auto!important}}
1
+ .ywctm-inline-selects .option-element{height:100%;display:inline-flex;align-items:center;padding:0 10px 0 0;vertical-align:top}.ywctm-inline-selects .option-element.hidden{padding:0}.ywctm-inline-selects .option-element>span{display:flex;min-height:38px;align-items:center}.woocommerce table.form-table .ywctm-inline-selects .option-element>.yith-plugin-fw-select-field-wrapper>.select2{width:220px!important;min-width:220px!important}
class-yith-woocommerce-catalog-mode.php CHANGED
@@ -1,13 +1,8 @@
1
  <?php
2
  /**
3
- * This file belongs to the YITH Plugin Framework.
4
  *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- *
10
- * @package YITH WooCommerce Catalog Mode
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
@@ -22,7 +17,7 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
22
  * @class YITH_WooCommerce_Catalog_Mode
23
  * @since 1.0.0
24
  * @author YITH
25
- * @package YITH
26
  */
27
  class YITH_WooCommerce_Catalog_Mode {
28
 
@@ -101,8 +96,6 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
101
 
102
  $this->include_files();
103
 
104
- add_filter( 'yith_plugin_fw_get_field_template_path', array( $this, 'add_custom_fields' ), 10, 2 );
105
- add_action( 'woocommerce_admin_settings_sanitize_option', array( $this, 'sanitize_custom_field' ), 10, 2 );
106
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts_admin' ) );
107
  add_action( 'admin_menu', array( $this, 'add_menu_page' ), 5 );
108
  add_action( 'yith_catalog_mode_premium', array( $this, 'premium_tab' ) );
@@ -111,6 +104,7 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
111
 
112
  add_action( 'init', array( $this, 'check_disable_shop' ), 11 );
113
  add_action( 'woocommerce_before_shop_loop_item_title', array( $this, 'hide_add_to_cart_loop' ), 5 );
 
114
  add_filter( 'woocommerce_add_to_cart_validation', array( $this, 'avoid_add_to_cart' ), 10, 2 );
115
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_frontend' ) );
116
  add_filter( 'ywctm_css_classes', array( $this, 'hide_atc_single_page' ) );
@@ -134,7 +128,7 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
134
 
135
  // Check if options should be upgraded.
136
  $update_path = YWCTM_DIR . 'includes/actions/update-2.0.0/ywctm-install.php';
137
- if ( ( '' === get_option( 'ywctm_update_version' ) || YWCTM_VERSION === get_transient( 'ywctm_prune_settings' ) ) && file_exists( $update_path ) ) {
138
  include_once $update_path;
139
  }
140
 
@@ -146,58 +140,6 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
146
  * ADMIN FUNCTIONS
147
  */
148
 
149
- /**
150
- * Initialize custom fields
151
- *
152
- * @param string $path Template Path.
153
- * @param array $field Field options.
154
- *
155
- * @return string
156
- * @since 2.0.0
157
- * @author Alberto Ruggiero <alberto.ruggiero@yithemes.com>
158
- */
159
- public function add_custom_fields( $path, $field ) {
160
-
161
- $custom_fields = array(
162
- 'yith-multiple-field',
163
- );
164
-
165
- if ( in_array( $field['type'], $custom_fields, true ) ) {
166
- $path = YWCTM_DIR . '/includes/admin/fields/' . $field['type'] . '.php';
167
- }
168
-
169
- return $path;
170
-
171
- }
172
-
173
- /**
174
- * Sanitize array fields
175
- *
176
- * @param mixed $value Option value.
177
- * @param array $option Option array.
178
- *
179
- * @return string
180
- * @since 2.0.0
181
- * @author Alberto Ruggiero <alberto.ruggiero@yithemes.com>
182
- */
183
- public function sanitize_custom_field( $value, $option ) {
184
-
185
- $allowed_fields = array(
186
- 'yith-multiple-field',
187
- );
188
-
189
- if ( isset( $option['yith-type'] ) && in_array( $option['yith-type'], $allowed_fields, true ) ) {
190
- if ( empty( $value ) ) {
191
- $value = '';
192
- } elseif ( is_array( $value ) ) {
193
- $value = maybe_serialize( $value );
194
- }
195
- }
196
-
197
- return $value;
198
-
199
- }
200
-
201
  /**
202
  * Enqueue script file
203
  *
@@ -209,9 +151,7 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
209
 
210
  wp_register_style( 'ywctm-admin', yit_load_css_file( YWCTM_ASSETS_URL . 'css/admin.css' ), array(), YWCTM_VERSION );
211
 
212
- $getted = $_GET; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
213
-
214
- if ( ! empty( $getted['page'] ) && ( $getted['page'] === $this->panel_page || 'yith_vendor_ctm_settings' === $getted['page'] ) ) {
215
  wp_enqueue_style( 'ywctm-admin' );
216
  }
217
 
@@ -263,6 +203,19 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
263
  'admin-tabs' => $admin_tabs,
264
  'options-path' => YWCTM_DIR . '/plugin-options',
265
  'class' => yith_set_wrapper_class(),
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  );
267
 
268
  $this->panel = new YIT_Plugin_Panel_WooCommerce( $args );
@@ -419,6 +372,17 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
419
  if ( is_callable( array( $this, 'country_check' ) ) ) {
420
  $apply = $this->country_check( $apply, $post_id );
421
  }
 
 
 
 
 
 
 
 
 
 
 
422
  }
423
 
424
  return apply_filters( 'ywctm_applied_roles', $apply, $post_id );
@@ -454,6 +418,20 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
454
 
455
  }
456
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
  /**
458
  * Checks if "Add to cart" needs to be hidden
459
  *
@@ -616,6 +594,10 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
616
  if ( 'storefront' === $theme_name ) {
617
  $args[] = '.site-header-cart.menu';
618
  }
 
 
 
 
619
  // APPLY_FILTER: ywctm_cart_widget_classes: CSS selector of cart widgets.
620
  $classes = array_merge( $classes, apply_filters( 'ywctm_cart_widget_classes', $args ) );
621
 
@@ -654,6 +636,12 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
654
  $args[] = '.single_variation_wrap .variations_button';
655
  }
656
 
 
 
 
 
 
 
657
  // APPLY_FILTER: ywctm_cart_widget_classes: CSS selector of add to cart buttons.
658
  $classes = array_merge( $classes, apply_filters( 'ywctm_catalog_classes', $args ) );
659
 
@@ -763,9 +751,8 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
763
  public function is_quick_view() {
764
 
765
  $actions = apply_filters( 'ywctm_quick_view_actions', array( 'yith_load_product_quick_view', 'yit_load_product_quick_view' ) );
766
- $request = $_REQUEST; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
767
 
768
- return defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $request['action'] ) && in_array( $request['action'], $actions, true );
769
  }
770
 
771
  /**
@@ -829,16 +816,13 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
829
  // APPLY_FILTER: ywctm_cart_widget_classes: CSS selector of add to cart buttons.
830
  $classes = implode( ', ', apply_filters( 'ywctm_catalog_classes', $args ) );
831
 
832
- ob_start();
833
  ?>
834
  <style type="text/css">
835
- <?php echo esc_attr( $classes ); ?>
836
- {
837
- display: none !important
838
  }
839
  </style>
840
  <?php
841
- echo ob_get_clean(); //phpcs:ignore
842
  }
843
 
844
  }
@@ -950,8 +934,8 @@ if ( ! class_exists( 'YITH_WooCommerce_Catalog_Mode' ) ) {
950
  $plugin_data = get_plugin_data( plugin_dir_path( __FILE__ ) . '/init.php' );
951
  $plugin_name = $plugin_data['Name'];
952
  $requirements = array(
953
- 'min_wp_version' => '5.2.0',
954
- 'min_wc_version' => '4.0.0',
955
  );
956
  yith_plugin_fw_add_requirements( $plugin_name, $requirements );
957
  }
1
  <?php
2
  /**
3
+ * Base Class
4
  *
5
+ * @package YITH\CatalogMode
 
 
 
 
 
6
  */
7
 
8
  if ( ! defined( 'ABSPATH' ) ) {
17
  * @class YITH_WooCommerce_Catalog_Mode
18
  * @since 1.0.0
19
  * @author YITH
20
+ * @package YITH\CatalogMode
21
  */
22
  class YITH_WooCommerce_Catalog_Mode {
23
 
96
 
97
  $this->include_files();
98
 
 
 
99
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts_admin' ) );
100
  add_action( 'admin_menu', array( $this, 'add_menu_page' ), 5 );
101
  add_action( 'yith_catalog_mode_premium', array( $this, 'premium_tab' ) );
104
 
105
  add_action( 'init', array( $this, 'check_disable_shop' ), 11 );
106
  add_action( 'woocommerce_before_shop_loop_item_title', array( $this, 'hide_add_to_cart_loop' ), 5 );
107
+ add_filter( 'woocommerce_loop_add_to_cart_link', array( $this, 'hide_add_to_cart_loop_alt' ), 10, 2 );
108
  add_filter( 'woocommerce_add_to_cart_validation', array( $this, 'avoid_add_to_cart' ), 10, 2 );
109
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_frontend' ) );
110
  add_filter( 'ywctm_css_classes', array( $this, 'hide_atc_single_page' ) );
128
 
129
  // Check if options should be upgraded.
130
  $update_path = YWCTM_DIR . 'includes/actions/update-2.0.0/ywctm-install.php';
131
+ if ( ( '' === (string) get_option( 'ywctm_update_version' ) || (string) YWCTM_VERSION === (string) get_transient( 'ywctm_prune_settings' ) ) && file_exists( $update_path ) ) {
132
  include_once $update_path;
133
  }
134
 
140
  * ADMIN FUNCTIONS
141
  */
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  /**
144
  * Enqueue script file
145
  *
151
 
152
  wp_register_style( 'ywctm-admin', yit_load_css_file( YWCTM_ASSETS_URL . 'css/admin.css' ), array(), YWCTM_VERSION );
153
 
154
+ if ( ! empty( $_GET['page'] ) && ( sanitize_text_field( wp_unslash( $_GET['page'] ) ) === $this->panel_page || 'yith_vendor_ctm_settings' === sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
 
 
155
  wp_enqueue_style( 'ywctm-admin' );
156
  }
157
 
203
  'admin-tabs' => $admin_tabs,
204
  'options-path' => YWCTM_DIR . '/plugin-options',
205
  'class' => yith_set_wrapper_class(),
206
+ 'help_tab' => array(
207
+ 'main_video' => array(
208
+ /* translators: %1$s opening B tag - %2$s closing B tag */
209
+ 'desc' => sprintf( _x( 'Check this video to learn how to %1$sconvert your shop into a product catalog%2$s', '[HELP TAB] Video title', 'yith-woocommerce-catalog-mode' ), '<b>', ':</b>' ),
210
+ 'url' => array(
211
+ 'it' => 'https://www.youtube.com/embed/5i8fTXTw97I',
212
+ ),
213
+ ),
214
+ 'playlists' => array(
215
+ 'it' => 'https://www.youtube.com/watch?v=5i8fTXTw97I&list=PL9c19edGMs09CTincDLWuCumR9A7JwZ4C',
216
+ ),
217
+ 'hc_url' => 'https://support.yithemes.com/hc/en-us/categories/4402976774161-YITH-WOOCOMMERCE-CATALOG-MODE',
218
+ ),
219
  );
220
 
221
  $this->panel = new YIT_Plugin_Panel_WooCommerce( $args );
372
  if ( is_callable( array( $this, 'country_check' ) ) ) {
373
  $apply = $this->country_check( $apply, $post_id );
374
  }
375
+
376
+ // Applies date and time check only if the user needs to have Catalog Mode applied.
377
+ if ( $apply ) {
378
+ if ( is_callable( array( $this, 'timeframe_check' ) ) ) {
379
+ $apply = $this->timeframe_check( $apply );
380
+ }
381
+
382
+ if ( is_callable( array( $this, 'dateframe_check' ) ) ) {
383
+ $apply = $this->dateframe_check( $apply );
384
+ }
385
+ }
386
  }
387
 
388
  return apply_filters( 'ywctm_applied_roles', $apply, $post_id );
418
 
419
  }
420
 
421
+ /**
422
+ * Hides "Add to cart" button, if not excluded, from loop page (alternative method)
423
+ *
424
+ * @param string $html The button HTML.
425
+ * @param WC_Product $product The current product.
426
+ *
427
+ * @return string
428
+ * @since 1.0.0
429
+ * @author Alberto Ruggiero <alberto.ruggiero@yithemes.com>
430
+ */
431
+ public function hide_add_to_cart_loop_alt( $html, $product ) {
432
+ return $this->check_hide_add_cart( false, $product->get_id() ) ? '' : $html;
433
+ }
434
+
435
  /**
436
  * Checks if "Add to cart" needs to be hidden
437
  *
594
  if ( 'storefront' === $theme_name ) {
595
  $args[] = '.site-header-cart.menu';
596
  }
597
+
598
+ if ( 'flatsome' === $theme_name ) {
599
+ $args[] = '.cart-item.has-icon.has-dropdown';
600
+ }
601
  // APPLY_FILTER: ywctm_cart_widget_classes: CSS selector of cart widgets.
602
  $classes = array_merge( $classes, apply_filters( 'ywctm_cart_widget_classes', $args ) );
603
 
636
  $args[] = '.single_variation_wrap .variations_button';
637
  }
638
 
639
+ $theme_name = ywctm_get_theme_name();
640
+
641
+ if ( 'storefront' === $theme_name ) {
642
+ $args[] = '.storefront-sticky-add-to-cart__content-button';
643
+ }
644
+
645
  // APPLY_FILTER: ywctm_cart_widget_classes: CSS selector of add to cart buttons.
646
  $classes = array_merge( $classes, apply_filters( 'ywctm_catalog_classes', $args ) );
647
 
751
  public function is_quick_view() {
752
 
753
  $actions = apply_filters( 'ywctm_quick_view_actions', array( 'yith_load_product_quick_view', 'yit_load_product_quick_view' ) );
 
754
 
755
+ return defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_REQUEST['action'] ) && in_array( sanitize_text_field( wp_unslash( $_REQUEST['action'] ) ), $actions, true ); //phpcs:ignore WordPress.Security.NonceVerification.Recommended
756
  }
757
 
758
  /**
816
  // APPLY_FILTER: ywctm_cart_widget_classes: CSS selector of add to cart buttons.
817
  $classes = implode( ', ', apply_filters( 'ywctm_catalog_classes', $args ) );
818
 
 
819
  ?>
820
  <style type="text/css">
821
+ .ywctm-void, <?php echo esc_attr( $classes ); ?> {
822
+ display: none !important;
 
823
  }
824
  </style>
825
  <?php
 
826
  }
827
 
828
  }
934
  $plugin_data = get_plugin_data( plugin_dir_path( __FILE__ ) . '/init.php' );
935
  $plugin_name = $plugin_data['Name'];
936
  $requirements = array(
937
+ 'min_wp_version' => '5.6.0',
938
+ 'min_wc_version' => '5.3.0',
939
  );
940
  yith_plugin_fw_add_requirements( $plugin_name, $requirements );
941
  }
includes/actions/update-2.0.0/ywctm-install.php CHANGED
@@ -1,13 +1,8 @@
1
  <?php
2
  /**
3
- * This file belongs to the YITH Plugin Framework.
4
  *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- *
10
- * @package YITH WooCommerce Catalog Mode
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
@@ -16,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
16
 
17
  if ( defined( 'YWCTM_PREMIUM' ) && YWCTM_PREMIUM ) {
18
 
19
- if ( '' !== get_option( 'ywctm_enable_plugin' ) ) {
20
  include_once YWCTM_DIR . 'includes/actions/update-2.0.0/ywctm-update-premium.php';
21
  } else {
22
  include_once YWCTM_DIR . 'includes/actions/update-2.0.0/ywctm-default-buttons.php';
1
  <?php
2
  /**
3
+ * Plugin installation functions
4
  *
5
+ * @package YITH\CatalogMode
 
 
 
 
 
6
  */
7
 
8
  if ( ! defined( 'ABSPATH' ) ) {
11
 
12
  if ( defined( 'YWCTM_PREMIUM' ) && YWCTM_PREMIUM ) {
13
 
14
+ if ( '' !== (string) get_option( 'ywctm_enable_plugin' ) ) {
15
  include_once YWCTM_DIR . 'includes/actions/update-2.0.0/ywctm-update-premium.php';
16
  } else {
17
  include_once YWCTM_DIR . 'includes/actions/update-2.0.0/ywctm-default-buttons.php';
includes/actions/update-2.0.0/ywctm-update.php CHANGED
@@ -1,13 +1,8 @@
1
  <?php
2
  /**
3
- * This file belongs to the YITH Plugin Framework.
4
  *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- *
10
- * @package YITH WooCommerce Catalog Mode
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
1
  <?php
2
  /**
3
+ * Base update functions
4
  *
5
+ * @package YITH\CatalogMode
 
 
 
 
 
6
  */
7
 
8
  if ( ! defined( 'ABSPATH' ) ) {
includes/admin/fields/yith-multiple-field.php DELETED
@@ -1,52 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YITH Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- *
10
- * @package YITH WooCommerce Catalog Mode
11
- */
12
-
13
- if ( ! defined( 'ABSPATH' ) ) {
14
- exit; // Exit if accessed directly.
15
- }
16
-
17
- extract( $field ); //phpcs:ignore
18
- $value = maybe_unserialize( $value );
19
- if ( ! empty( $fields ) && is_array( $fields ) ) { ?>
20
- <div id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( isset( $class ) ? $class : '' ); ?>">
21
- <?php
22
- foreach ( $fields as $key => $field ) {
23
- $allowed_types = array( 'select', 'select-buttons', 'number', 'slider', 'hidden' );
24
- $default_args = array( 'type' => 'select' );
25
- $field['value'] = isset( $value[ $key ] ) ? maybe_unserialize( $value[ $key ] ) : $field['std'];
26
- $field['id'] = $id . '_' . $key;
27
- $field['name'] = $name . '[' . $key . ']';
28
-
29
- if ( ! in_array( $field['type'], $allowed_types, true ) ) {
30
- continue;
31
- }
32
-
33
- if ( in_array( $field['type'], array( 'select', 'select-buttons' ), true ) ) {
34
- $field['class'] = 'wc-enhanced-select';
35
- }
36
- ?>
37
- <?php if ( isset( $field['inline-label'] ) && '' !== $field['inline-label'] ) : ?>
38
- <div class="option-element">
39
- <span><?php echo esc_attr( $field['inline-label'] ); ?></span>
40
- </div>
41
- <?php endif; ?>
42
- <div class="option-element <?php echo esc_attr( $field['type'] ); ?>">
43
- <?php if ( isset( $field['label'] ) && '' !== $field['label'] ) : ?>
44
- <label for="<?php echo esc_attr( $field['id'] ); ?>"><?php echo esc_attr( $field['label'] ); ?></label>
45
- <?php endif; ?>
46
- <?php yith_plugin_fw_get_field( $field, true ); ?>
47
- </div>
48
- <?php } ?>
49
- </div>
50
- <?php
51
-
52
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/ywctm-functions.php CHANGED
@@ -1,13 +1,8 @@
1
  <?php
2
  /**
3
- * This file belongs to the YITH Plugin Framework.
4
  *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- *
10
- * @package YITH WooCommerce Catalog Mode
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
1
  <?php
2
  /**
3
+ * Plugin base functions
4
  *
5
+ * @package YITH\CatalogMode
 
 
 
 
 
6
  */
7
 
8
  if ( ! defined( 'ABSPATH' ) ) {
init.php CHANGED
@@ -5,10 +5,10 @@
5
  * Description: <code><strong>YITH WooCommerce Catalog Mode</strong></code> allows hiding product prices, cart and checkout from your store and turning it into a performing product catalogue. You will be able to adjust your catalogue settings as you prefer based on your requirements. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>
6
  * Author: YITH
7
  * Text Domain: yith-woocommerce-catalog-mode
8
- * Version: 2.0.16
9
  * Author URI: https://yithemes.com/
10
  * WC requires at least: 5.3.0
11
- * WC tested up to: 5.6.x
12
  *
13
  * @package YITH WooCommerce Catalog Mode
14
  */
@@ -61,7 +61,7 @@ function ywctm_install_free_admin_notice() {
61
  <?php
62
  }
63
 
64
- ! defined( 'YWCTM_VERSION' ) && define( 'YWCTM_VERSION', '2.0.16' );
65
  ! defined( 'YWCTM_FREE_INIT' ) && define( 'YWCTM_FREE_INIT', plugin_basename( __FILE__ ) );
66
  ! defined( 'YWCTM_SLUG' ) && define( 'YWCTM_SLUG', 'yith-woocommerce-catalog-mode' );
67
  ! defined( 'YWCTM_FILE' ) && define( 'YWCTM_FILE', __FILE__ );
@@ -133,7 +133,7 @@ if ( ! function_exists( 'YITH_WCTM' ) ) {
133
  * @since 1.1.5
134
  * @author Alberto Ruggiero <alberto.ruggiero@yithemes.com>
135
  */
136
- function YITH_WCTM() { //phpcs:ignore
137
 
138
  // Load required classes and functions.
139
  require_once YWCTM_DIR . 'class-yith-woocommerce-catalog-mode.php';
5
  * Description: <code><strong>YITH WooCommerce Catalog Mode</strong></code> allows hiding product prices, cart and checkout from your store and turning it into a performing product catalogue. You will be able to adjust your catalogue settings as you prefer based on your requirements. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>
6
  * Author: YITH
7
  * Text Domain: yith-woocommerce-catalog-mode
8
+ * Version: 2.1.0
9
  * Author URI: https://yithemes.com/
10
  * WC requires at least: 5.3.0
11
+ * WC tested up to: 5.7.x
12
  *
13
  * @package YITH WooCommerce Catalog Mode
14
  */
61
  <?php
62
  }
63
 
64
+ ! defined( 'YWCTM_VERSION' ) && define( 'YWCTM_VERSION', '2.1.0' );
65
  ! defined( 'YWCTM_FREE_INIT' ) && define( 'YWCTM_FREE_INIT', plugin_basename( __FILE__ ) );
66
  ! defined( 'YWCTM_SLUG' ) && define( 'YWCTM_SLUG', 'yith-woocommerce-catalog-mode' );
67
  ! defined( 'YWCTM_FILE' ) && define( 'YWCTM_FILE', __FILE__ );
133
  * @since 1.1.5
134
  * @author Alberto Ruggiero <alberto.ruggiero@yithemes.com>
135
  */
136
+ function YITH_WCTM() { //phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
137
 
138
  // Load required classes and functions.
139
  require_once YWCTM_DIR . 'class-yith-woocommerce-catalog-mode.php';
languages/yith-woocommerce-catalog-mode.pot CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the YITH WooCommerce Catalog Mode package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: YITH WooCommerce Catalog Mode 2.0.16\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/yith-woocommerce-catalog-mode\n"
8
- "POT-Creation-Date: 2021-08-19 13:43:44+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -14,12 +14,12 @@ msgstr ""
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
  "X-Generator: grunt-wp-i18n 1.0.3\n"
16
 
17
- #: class-yith-woocommerce-catalog-mode.php:247
18
- #: plugin-options/settings-options.php:20
19
  msgid "Settings"
20
  msgstr ""
21
 
22
- #: class-yith-woocommerce-catalog-mode.php:248
23
  msgid "Premium Version"
24
  msgstr ""
25
 
@@ -35,50 +35,50 @@ msgid ""
35
  "one."
36
  msgstr ""
37
 
38
- #: plugin-options/settings-options.php:24
39
  msgid "Catalog mode for administrators"
40
  msgstr ""
41
 
42
- #: plugin-options/settings-options.php:27
43
- msgid "Choose to enable the Catalog Mode for admins."
44
  msgstr ""
45
 
46
- #: plugin-options/settings-options.php:32
47
  msgid "Disable shop"
48
  msgstr ""
49
 
50
- #: plugin-options/settings-options.php:35
51
  msgid ""
52
  "Use this option to hide the \"Cart\" page, \"Checkout\" page and all the "
53
  "\"Add to Cart\" buttons in the shop."
54
  msgstr ""
55
 
56
- #: plugin-options/settings-options.php:42
57
- msgid "Hide \"Add to Cart\" in:"
58
  msgstr ""
59
 
60
- #: plugin-options/settings-options.php:43
61
  msgid "Choose where to hide \"Add to Cart\"."
62
  msgstr ""
63
 
64
- #: plugin-options/settings-options.php:52
65
  msgid "All pages"
66
  msgstr ""
67
 
68
- #: plugin-options/settings-options.php:53
69
  msgid "Shop page"
70
  msgstr ""
71
 
72
- #: plugin-options/settings-options.php:54
73
  msgid "Product page"
74
  msgstr ""
75
 
76
- #: plugin-options/settings-options.php:72
77
  msgid "Hide product variations"
78
  msgstr ""
79
 
80
- #: plugin-options/settings-options.php:75
81
- msgid "Use this option to hide product variations where \"add to cart\" is hidden."
82
  msgstr ""
83
 
84
  #: templates/admin/premium.php:210 templates/admin/premium.php:337
@@ -221,22 +221,30 @@ msgid ""
221
  "e-commerce shop on <strong>YITH</strong></a>"
222
  msgstr ""
223
 
224
- #: class-yith-woocommerce-catalog-mode.php:238
225
  msgctxt "general settings tab name"
226
  msgid "Settings"
227
  msgstr ""
228
 
229
- #: class-yith-woocommerce-catalog-mode.php:239
230
  msgctxt "exclusion settings tab name"
231
  msgid "Exclusion List"
232
  msgstr ""
233
 
234
- #: class-yith-woocommerce-catalog-mode.php:240
235
  msgctxt "inquiry form settings tab name"
236
  msgid "Inquiry Form"
237
  msgstr ""
238
 
239
- #: class-yith-woocommerce-catalog-mode.php:241
240
  msgctxt "buttons & labels settings tab name"
241
  msgid "Buttons & Labels"
 
 
 
 
 
 
 
 
242
  msgstr ""
2
  # This file is distributed under the same license as the YITH WooCommerce Catalog Mode package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: YITH WooCommerce Catalog Mode 2.1.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/yith-woocommerce-catalog-mode\n"
8
+ "POT-Creation-Date: 2021-09-16 14:21:23+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
  "X-Generator: grunt-wp-i18n 1.0.3\n"
16
 
17
+ #: class-yith-woocommerce-catalog-mode.php:187
18
+ #: plugin-options/settings-options.php:15
19
  msgid "Settings"
20
  msgstr ""
21
 
22
+ #: class-yith-woocommerce-catalog-mode.php:188
23
  msgid "Premium Version"
24
  msgstr ""
25
 
35
  "one."
36
  msgstr ""
37
 
38
+ #: plugin-options/settings-options.php:19
39
  msgid "Catalog mode for administrators"
40
  msgstr ""
41
 
42
+ #: plugin-options/settings-options.php:22
43
+ msgid "If enabled, the Catalog Mode rules will also work for admin users."
44
  msgstr ""
45
 
46
+ #: plugin-options/settings-options.php:27
47
  msgid "Disable shop"
48
  msgstr ""
49
 
50
+ #: plugin-options/settings-options.php:30
51
  msgid ""
52
  "Use this option to hide the \"Cart\" page, \"Checkout\" page and all the "
53
  "\"Add to Cart\" buttons in the shop."
54
  msgstr ""
55
 
56
+ #: plugin-options/settings-options.php:37
57
+ msgid "\"Add to Cart\" settings in Catalog Mode"
58
  msgstr ""
59
 
60
+ #: plugin-options/settings-options.php:38
61
  msgid "Choose where to hide \"Add to Cart\"."
62
  msgstr ""
63
 
64
+ #: plugin-options/settings-options.php:47
65
  msgid "All pages"
66
  msgstr ""
67
 
68
+ #: plugin-options/settings-options.php:48
69
  msgid "Shop page"
70
  msgstr ""
71
 
72
+ #: plugin-options/settings-options.php:49
73
  msgid "Product page"
74
  msgstr ""
75
 
76
+ #: plugin-options/settings-options.php:67
77
  msgid "Hide product variations"
78
  msgstr ""
79
 
80
+ #: plugin-options/settings-options.php:70
81
+ msgid "Use this option to hide product variations where \"Add to cart\" is hidden."
82
  msgstr ""
83
 
84
  #: templates/admin/premium.php:210 templates/admin/premium.php:337
221
  "e-commerce shop on <strong>YITH</strong></a>"
222
  msgstr ""
223
 
224
+ #: class-yith-woocommerce-catalog-mode.php:178
225
  msgctxt "general settings tab name"
226
  msgid "Settings"
227
  msgstr ""
228
 
229
+ #: class-yith-woocommerce-catalog-mode.php:179
230
  msgctxt "exclusion settings tab name"
231
  msgid "Exclusion List"
232
  msgstr ""
233
 
234
+ #: class-yith-woocommerce-catalog-mode.php:180
235
  msgctxt "inquiry form settings tab name"
236
  msgid "Inquiry Form"
237
  msgstr ""
238
 
239
+ #: class-yith-woocommerce-catalog-mode.php:181
240
  msgctxt "buttons & labels settings tab name"
241
  msgid "Buttons & Labels"
242
+ msgstr ""
243
+
244
+ #: class-yith-woocommerce-catalog-mode.php:209
245
+ #. translators: %1$s opening B tag - %2$s closing B tag
246
+ msgctxt "[HELP TAB] Video title"
247
+ msgid ""
248
+ "Check this video to learn how to %1$sconvert your shop into a product "
249
+ "catalog%2$s"
250
  msgstr ""
plugin-fw/assets/css/metaboxes.css CHANGED
@@ -176,10 +176,10 @@
176
  }
177
 
178
  .metaboxes-tab span.description.inline {
179
- display : inline-block;
180
- line-height : 23px;
181
- width : auto;
182
- margin : 0;
183
  }
184
 
185
  .metaboxes-tab .slider label {
@@ -254,8 +254,8 @@
254
  }
255
 
256
  .metaboxes-tab.yith-plugin-ui input[type=number] {
257
- width : auto;
258
- min-width : 90px;
259
  }
260
 
261
  .metaboxes-tab.yith-plugin-ui p {
176
  }
177
 
178
  .metaboxes-tab span.description.inline {
179
+ display : inline-block;
180
+ line-height : 23px;
181
+ width : auto;
182
+ margin : 0;
183
  }
184
 
185
  .metaboxes-tab .slider label {
254
  }
255
 
256
  .metaboxes-tab.yith-plugin-ui input[type=number] {
257
+ width : 70px;
258
+ min-width : 70px;
259
  }
260
 
261
  .metaboxes-tab.yith-plugin-ui p {
plugin-fw/assets/css/yit-plugin-panel.css CHANGED
@@ -842,7 +842,7 @@
842
  margin-right : 0;
843
  background-color : #f1f1f1;
844
  color : #336374;
845
- font-size : 13px;
846
  padding : 8px 20px 9px;
847
  border : 0;
848
  }
842
  margin-right : 0;
843
  background-color : #f1f1f1;
844
  color : #336374;
845
+ font-size : 12px;
846
  padding : 8px 20px 9px;
847
  border : 0;
848
  }
plugin-fw/assets/css/yith-fields.css CHANGED
@@ -71,6 +71,12 @@
71
  line-height : 1;
72
  }
73
 
 
 
 
 
 
 
74
  .woocommerce .yith-plugin-fw table.form-table input[type=text].wp-color-picker,
75
  .woocommerce .yith-plugin-fw table.form-table input[type=text].yith-plugin-fw-colorpicker,
76
  .yith-plugin-fw input[type=text].wp-color-picker,
@@ -535,8 +541,8 @@ YITH UI
535
  .yith-plugin-ui .nav-tab {
536
  background-color : #336374;
537
  color : #fff;
538
- font-size : 15px;
539
- padding : 7px 20px;
540
  border : 0;
541
  margin : 0 4px 0 0;
542
  transition : background-color 0.3s linear;
@@ -730,6 +736,27 @@ YITH UI
730
  color : #716269;
731
  }
732
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
733
  .yith-plugin-ui textarea:not(.wp-editor-area),
734
  .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table textarea:not(.wp-editor-area) {
735
  height : auto;
@@ -1962,11 +1989,11 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
1962
  }
1963
 
1964
  .yith-plugin-ui .yith-plugin-fw-image-dimensions label {
1965
- display : block;
1966
- font-size : 11px;
1967
- font-weight : 600;
1968
- text-transform : uppercase;
1969
- margin : 0 0 10px 0;
1970
  }
1971
 
1972
  /**
71
  line-height : 1;
72
  }
73
 
74
+ .yith-plugin-fw input[type=number],
75
+ .woocommerce .yith-plugin-fw table.form-table input[type=number] {
76
+ width : 70px;
77
+ min-width : 70px;
78
+ }
79
+
80
  .woocommerce .yith-plugin-fw table.form-table input[type=text].wp-color-picker,
81
  .woocommerce .yith-plugin-fw table.form-table input[type=text].yith-plugin-fw-colorpicker,
82
  .yith-plugin-fw input[type=text].wp-color-picker,
541
  .yith-plugin-ui .nav-tab {
542
  background-color : #336374;
543
  color : #fff;
544
+ font-size : 13px;
545
+ padding : 7px 15px;
546
  border : 0;
547
  margin : 0 4px 0 0;
548
  transition : background-color 0.3s linear;
736
  color : #716269;
737
  }
738
 
739
+
740
+ .yith-plugin-ui input::-webkit-input-placeholder {
741
+ color : #999999;
742
+ }
743
+
744
+ .yith-plugin-ui input:-ms-input-placeholder {
745
+ color : #999999;
746
+ }
747
+
748
+ .yith-plugin-ui input::-ms-input-placeholder {
749
+ color : #999999;
750
+ }
751
+
752
+ .yith-plugin-ui input::placeholder {
753
+ color : #999999;
754
+ }
755
+
756
+ .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=number] {
757
+ min-width : 70px;
758
+ }
759
+
760
  .yith-plugin-ui textarea:not(.wp-editor-area),
761
  .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table textarea:not(.wp-editor-area) {
762
  height : auto;
1989
  }
1990
 
1991
  .yith-plugin-ui .yith-plugin-fw-image-dimensions label {
1992
+ display : block;
1993
+ font-size : 11px;
1994
+ font-weight : 600;
1995
+ text-transform : uppercase;
1996
+ margin : 0 0 10px 0;
1997
  }
1998
 
1999
  /**
plugin-fw/assets/css/yith-plugin-ui.css CHANGED
@@ -29,6 +29,12 @@
29
  --yith-outline-bg-hover: rgba(157, 198, 205, 0.2);
30
  --yith-outline-border-hover: #007ba3;
31
  --yith-outline-focus: #dfeef2;
 
 
 
 
 
 
32
  --yith-accent: #98aa36;
33
  --yith-light-bg: #f0f6fb;
34
  --yith-light-border-color: #d7e3e7;
@@ -322,13 +328,25 @@
322
  .yith-plugin-ui #doaction,
323
  .yith-plugin-ui #doaction2,
324
  .yith-plugin-ui #post-query-submit,
 
325
  .yith-plugin-ui #search-submit,
326
  .yith-plugin-ui .button.filter-button, .wp-core-ui .yith-plugin-ui .button.action,
327
  .wp-core-ui .yith-plugin-ui #doaction,
328
  .wp-core-ui .yith-plugin-ui #doaction2,
329
  .wp-core-ui .yith-plugin-ui #post-query-submit,
 
330
  .wp-core-ui .yith-plugin-ui #search-submit,
331
  .wp-core-ui .yith-plugin-ui .button.filter-button {
 
 
 
 
 
 
 
 
 
 
332
  background: var(--yith-outline-bg);
333
  border: 1px solid var(--yith-outline-border);
334
  color: var(--yith-outline-text);
@@ -343,11 +361,30 @@
343
  .yith-plugin-ui #doaction:focus,
344
  .yith-plugin-ui #doaction2:focus,
345
  .yith-plugin-ui #post-query-submit:focus,
 
346
  .yith-plugin-ui #search-submit:focus,
347
  .yith-plugin-ui .button.filter-button:focus, .wp-core-ui .yith-plugin-ui .button.action:focus,
348
  .wp-core-ui .yith-plugin-ui #doaction:focus,
349
  .wp-core-ui .yith-plugin-ui #doaction2:focus,
350
  .wp-core-ui .yith-plugin-ui #post-query-submit:focus,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  .wp-core-ui .yith-plugin-ui #search-submit:focus,
352
  .wp-core-ui .yith-plugin-ui .button.filter-button:focus {
353
  background: var(--yith-outline-bg);
@@ -363,6 +400,8 @@
363
  .yith-plugin-ui #doaction2:active,
364
  .yith-plugin-ui #post-query-submit:hover,
365
  .yith-plugin-ui #post-query-submit:active,
 
 
366
  .yith-plugin-ui #search-submit:hover,
367
  .yith-plugin-ui #search-submit:active,
368
  .yith-plugin-ui .button.filter-button:hover,
@@ -373,6 +412,8 @@
373
  .wp-core-ui .yith-plugin-ui #doaction2:active,
374
  .wp-core-ui .yith-plugin-ui #post-query-submit:hover,
375
  .wp-core-ui .yith-plugin-ui #post-query-submit:active,
 
 
376
  .wp-core-ui .yith-plugin-ui #search-submit:hover,
377
  .wp-core-ui .yith-plugin-ui #search-submit:active,
378
  .wp-core-ui .yith-plugin-ui .button.filter-button:hover,
@@ -382,6 +423,25 @@
382
  color: var(--yith-outline-text);
383
  }
384
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  .yith-plugin-ui .tablenav .tablenav-pages .button,
386
  .yith-plugin-ui .tablenav .tablenav-pages .tablenav-pages-navspan, .wp-core-ui .yith-plugin-ui .tablenav .tablenav-pages .button,
387
  .wp-core-ui .yith-plugin-ui .tablenav .tablenav-pages .tablenav-pages-navspan {
29
  --yith-outline-bg-hover: rgba(157, 198, 205, 0.2);
30
  --yith-outline-border-hover: #007ba3;
31
  --yith-outline-focus: #dfeef2;
32
+ --yith-delete-outline-text: #c41d04;
33
+ --yith-delete-outline-border: #c41d04;
34
+ --yith-delete-outline-bg: rgba(205, 157, 157, 0);
35
+ --yith-delete-outline-bg-hover: rgba(232, 184, 184, 0.15);
36
+ --yith-delete-outline-border-hover: #db2b11;
37
+ --yith-delete-outline-focus: #ffe9e7;
38
  --yith-accent: #98aa36;
39
  --yith-light-bg: #f0f6fb;
40
  --yith-light-border-color: #d7e3e7;
328
  .yith-plugin-ui #doaction,
329
  .yith-plugin-ui #doaction2,
330
  .yith-plugin-ui #post-query-submit,
331
+ .yith-plugin-ui #posts-filter #delete_all,
332
  .yith-plugin-ui #search-submit,
333
  .yith-plugin-ui .button.filter-button, .wp-core-ui .yith-plugin-ui .button.action,
334
  .wp-core-ui .yith-plugin-ui #doaction,
335
  .wp-core-ui .yith-plugin-ui #doaction2,
336
  .wp-core-ui .yith-plugin-ui #post-query-submit,
337
+ .wp-core-ui .yith-plugin-ui #posts-filter #delete_all,
338
  .wp-core-ui .yith-plugin-ui #search-submit,
339
  .wp-core-ui .yith-plugin-ui .button.filter-button {
340
+ display: inline-block;
341
+ height: auto;
342
+ line-height: 30px;
343
+ border-radius: 4px;
344
+ padding: 0 17px;
345
+ font-weight: 600;
346
+ cursor: pointer;
347
+ transition: all .3s ease-in-out;
348
+ text-decoration: none;
349
+ white-space: nowrap;
350
  background: var(--yith-outline-bg);
351
  border: 1px solid var(--yith-outline-border);
352
  color: var(--yith-outline-text);
361
  .yith-plugin-ui #doaction:focus,
362
  .yith-plugin-ui #doaction2:focus,
363
  .yith-plugin-ui #post-query-submit:focus,
364
+ .yith-plugin-ui #posts-filter #delete_all:focus,
365
  .yith-plugin-ui #search-submit:focus,
366
  .yith-plugin-ui .button.filter-button:focus, .wp-core-ui .yith-plugin-ui .button.action:focus,
367
  .wp-core-ui .yith-plugin-ui #doaction:focus,
368
  .wp-core-ui .yith-plugin-ui #doaction2:focus,
369
  .wp-core-ui .yith-plugin-ui #post-query-submit:focus,
370
+ .wp-core-ui .yith-plugin-ui #posts-filter #delete_all:focus,
371
+ .wp-core-ui .yith-plugin-ui #search-submit:focus,
372
+ .wp-core-ui .yith-plugin-ui .button.filter-button:focus {
373
+ outline: none;
374
+ box-shadow: none;
375
+ }
376
+
377
+ .yith-plugin-ui .button.action:focus,
378
+ .yith-plugin-ui #doaction:focus,
379
+ .yith-plugin-ui #doaction2:focus,
380
+ .yith-plugin-ui #post-query-submit:focus,
381
+ .yith-plugin-ui #posts-filter #delete_all:focus,
382
+ .yith-plugin-ui #search-submit:focus,
383
+ .yith-plugin-ui .button.filter-button:focus, .wp-core-ui .yith-plugin-ui .button.action:focus,
384
+ .wp-core-ui .yith-plugin-ui #doaction:focus,
385
+ .wp-core-ui .yith-plugin-ui #doaction2:focus,
386
+ .wp-core-ui .yith-plugin-ui #post-query-submit:focus,
387
+ .wp-core-ui .yith-plugin-ui #posts-filter #delete_all:focus,
388
  .wp-core-ui .yith-plugin-ui #search-submit:focus,
389
  .wp-core-ui .yith-plugin-ui .button.filter-button:focus {
390
  background: var(--yith-outline-bg);
400
  .yith-plugin-ui #doaction2:active,
401
  .yith-plugin-ui #post-query-submit:hover,
402
  .yith-plugin-ui #post-query-submit:active,
403
+ .yith-plugin-ui #posts-filter #delete_all:hover,
404
+ .yith-plugin-ui #posts-filter #delete_all:active,
405
  .yith-plugin-ui #search-submit:hover,
406
  .yith-plugin-ui #search-submit:active,
407
  .yith-plugin-ui .button.filter-button:hover,
412
  .wp-core-ui .yith-plugin-ui #doaction2:active,
413
  .wp-core-ui .yith-plugin-ui #post-query-submit:hover,
414
  .wp-core-ui .yith-plugin-ui #post-query-submit:active,
415
+ .wp-core-ui .yith-plugin-ui #posts-filter #delete_all:hover,
416
+ .wp-core-ui .yith-plugin-ui #posts-filter #delete_all:active,
417
  .wp-core-ui .yith-plugin-ui #search-submit:hover,
418
  .wp-core-ui .yith-plugin-ui #search-submit:active,
419
  .wp-core-ui .yith-plugin-ui .button.filter-button:hover,
423
  color: var(--yith-outline-text);
424
  }
425
 
426
+ .yith-plugin-ui #posts-filter #delete_all, .wp-core-ui .yith-plugin-ui #posts-filter #delete_all {
427
+ background: var(--yith-delete-outline-bg);
428
+ border: 1px solid var(--yith-delete-outline-border);
429
+ color: var(--yith-delete-outline-text);
430
+ }
431
+
432
+ .yith-plugin-ui #posts-filter #delete_all:focus, .wp-core-ui .yith-plugin-ui #posts-filter #delete_all:focus {
433
+ background: var(--yith-delete-outline-bg);
434
+ border: 1px solid var(--yith-delete-outline-border);
435
+ color: var(--yith-delete-outline-text);
436
+ box-shadow: 0 0 0 3px var(--yith-delete-outline-focus);
437
+ }
438
+
439
+ .yith-plugin-ui #posts-filter #delete_all:hover, .yith-plugin-ui #posts-filter #delete_all:active, .wp-core-ui .yith-plugin-ui #posts-filter #delete_all:hover, .wp-core-ui .yith-plugin-ui #posts-filter #delete_all:active {
440
+ background: var(--yith-delete-outline-bg-hover);
441
+ border-color: var(--yith-delete-outline-border-hover);
442
+ color: var(--yith-delete-outline-text);
443
+ }
444
+
445
  .yith-plugin-ui .tablenav .tablenav-pages .button,
446
  .yith-plugin-ui .tablenav .tablenav-pages .tablenav-pages-navspan, .wp-core-ui .yith-plugin-ui .tablenav .tablenav-pages .button,
447
  .wp-core-ui .yith-plugin-ui .tablenav .tablenav-pages .tablenav-pages-navspan {
plugin-fw/assets/js/yith-fields.js CHANGED
@@ -483,7 +483,6 @@
483
  } else {
484
  $( this ).attr( 'value', 'no' ).removeClass( 'onoffchecked' );
485
  }
486
- $( this ).trigger( 'change' );
487
  } );
488
 
489
 
483
  } else {
484
  $( this ).attr( 'value', 'no' ).removeClass( 'onoffchecked' );
485
  }
 
486
  } );
487
 
488
 
plugin-fw/assets/js/yith-fields.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={selectors:{imgPreview:".yith-plugin-fw-upload-img-preview",uploadButton:".yith-plugin-fw-upload-button",imgUrl:".yith-plugin-fw-upload-img-url",resetButton:".yith-plugin-fw-upload-button-reset"},onImageChange:function(){var i=e(this).val(),n=new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico|svg)"),a=e(this).parent().find(t.selectors.imgPreview).first();a.length<1&&(a=e(this).parent().parent().find(t.selectors.imgPreview).first()),n.test(i)?a.html('<img src="'+i+'" style="max-width:100px; max-height:100px;" />'):a.html("")},onButtonClick:function(i){i.preventDefault();var n,a=e(this).attr("id").replace(/-button$/,"").replace(/(\[|\])/g,"\\$1");if(n)n.open();else{var l=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];(n=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:l})).on("select",function(){var i=n.state().get("selection").first().toJSON(),l=e("#"+a+"-yith-attachment-id");e("#"+a).val(i.url),l.length&&l.val(i.id),t.triggerImageChange()}),n.open()}},onResetClick:function(){var i=e(this),n=i.attr("id").replace(/(\[|\])/g,"\\$1"),a=i.attr("id").replace(/-button-reset$/,"").replace(/(\[|\])/g,"\\$1"),l=e("#"+n).data("default");e("#"+a).val(l),t.triggerImageChange()},triggerImageChange:function(){e(t.selectors.imgUrl).trigger("change")},initOnce:function(){"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(e(document).on("change",t.selectors.imgUrl,t.onImageChange),e(document).on("click",t.selectors.uploadButton,t.onButtonClick),e(document).on("click",t.selectors.resetButton,t.onResetClick))}};t.initOnce();var i={selectors:{gallery:".yith-plugin-fw-image-gallery",notInitGallery:".yith-plugin-fw-image-gallery:not(.yith-plugin-fw-image-gallery--initialized)",button:".yith-plugin-fw-image-gallery .image-gallery-button",slideWrapper:"ul.slides-wrapper"},initOnce:function(){"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&e(document).on("click",i.selectors.button,function(t){var n=e(this),a=n.closest(i.selectors.gallery),l=a.find(".image_gallery_ids"),o=l.val(),s=a.find("ul.slides-wrapper"),r=wp.media.frames.image_gallery=wp.media({title:n.data("choose"),button:{text:n.data("update")},states:[new wp.media.controller.Library({title:n.data("choose"),filterable:"all",multiple:!0})]});r.on("select",function(){r.state().get("selection").map(function(e){(e=e.toJSON()).id&&(o=o?o+","+e.id:e.id,s.append('<li class="image" data-attachment_id="'+e.id+'"><img src="'+e.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+n.data("delete")+'">x</a></li></ul></li>'))}),l.val(o),l.trigger("change")}),r.open()})},init:function(){"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&e(i.selectors.notInitGallery).each(function(){e(this).addClass("yith-plugin-fw-image-gallery--initialized");var t=e(this).find(i.selectors.slideWrapper);t.each(function(){var t=e(this);t.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,start:function(e,t){t.item.css("background-color","#f6f6f6")},stop:function(e,t){t.item.removeAttr("style")},update:function(n,a){var l="";t.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");l=l+t+","}),t.closest(i.selectors.gallery).find(".image_gallery_ids").val(l)}})}),t.on("click","a.delete",function(t){t.preventDefault();var n=e(this).closest(i.selectors.gallery),a=n.find("ul.slides-wrapper"),l=n.find(".image_gallery_ids"),o="";e(this).closest("li.image").remove(),a.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");o=o+t+","}),l.val(o)})})}};i.initOnce(),e(function(){e(document).on("yith-plugin-fw-codemirror-init",function(){"undefined"!=typeof wp&&"undefined"!=typeof wp.codeEditor&&e(".codemirror:not(.codemirror--initialized)").each(function(){var t=e(this).data("settings"),i=wp.codeEditor.initialize(e(this),t);e(this).addClass("codemirror--initialized"),e(this).data("codemirrorInstance",i)})}).trigger("yith-plugin-fw-codemirror-init")});e(document).on("yith_fields_init",function(){var n=e(".yith-plugin-fw-datepicker:not(.yith-plugin-fw-datepicker--initialized)"),a=e(".yith-plugin-fw-colorpicker:not(.yith-plugin-fw-colorpicker--initialized)"),l=e(".yith-plugin-fw-sidebar-layout:not(.yith-plugin-fw-sidebar-layout--initialized)"),o=e(".yith-plugin-fw-slider-container:not(.yith-plugin-fw-slider-container--initialized)"),s=e(".yit-icons-manager-wrapper:not(.yit-icons-manager-wrapper--initialized)");n.each(function(){e(this).addClass("yith-plugin-fw-datepicker--initialized");var t=e(this),i=t.data(),n=t.next(".yith-icon-calendar");i.showAnim=!1,i.beforeShow=function(e,t){t.dpDiv.addClass("yith-plugin-fw-datepicker-div")},i.onClose=function(e,t){t.dpDiv.removeClass("yith-plugin-fw-datepicker-div")},t.datepicker(i),n&&n.on("click",function(){t.datepicker("show")})}),a.each(function(){e(this).addClass("yith-plugin-fw-colorpicker--initialized"),e(this).wpColorPicker({palettes:!1,width:200,mode:"hsl",clear:function(){var t=e(this);t.val(t.data("default-color")),t.trigger("change")}});var t=e(this).data("variations-label"),i=e(this).closest(".yith-plugin-fw-colorpicker-field-wrapper"),n=e(this).closest(".yith-single-colorpicker"),a=i.find(".wp-picker-input-wrap"),l=n.find(".wp-picker-input-wrap");if(a.length&&i.find("a.wp-color-result").attr("title",t),n.length&&n.find("a.wp-color-result").attr("title",t),!a.find(".wp-picker-default-custom").length){var o=e("<span/>").attr({"class":"wp-picker-default-custom"});a.find(".wp-picker-default").wrap(o)}l.find(".wp-picker-default-custom").length||(o=e("<span/>").attr({"class":"wp-picker-default-custom"}),l.find(".wp-picker-default").wrap(o))}),l.each(function(){e(this).addClass("yith-plugin-fw-sidebar-layout--initialized"),e(this).find("img").on("click",function(){var t=e(this).closest(".yith-plugin-fw-sidebar-layout"),i=t.find(".yith-plugin-fw-sidebar-layout-sidebar-left-container"),n=t.find(".yith-plugin-fw-sidebar-layout-sidebar-right-container"),a=e(this).data("type");if(e(this).parent().children(":radio").attr("checked",!1),e(this).prev(":radio").attr("checked",!0),void 0!==a)switch(a){case"left":i.show(),n.hide();break;case"right":n.show(),i.hide();break;case"double":i.show(),n.show();break;default:i.hide(),n.hide()}})}),o.each(function(){e(this).addClass("yith-plugin-fw-slider-container--initialized");var t=e(this).find(".ui-slider-horizontal"),i=t.data("val"),n=t.data("min"),a=t.data("max"),l=t.data("step"),o=t.data("labels");t.slider({value:i,min:n,max:a,range:"min",step:l,create:function(){e(this).find(".ui-slider-handle").text(e(this).slider("value"))},slide:function(t,i){e(this).find("input").val(i.value).trigger("change"),e(this).find(".ui-slider-handle").text(i.value),e(this).siblings(".feedback").find("strong").text(i.value+o)}})}),s.each(function(){e(this).addClass("yit-icons-manager-wrapper--initialized");var t=e(this),i=t.find(".yit-icons-manager-icon-preview").first(),n=t.find(".yit-icons-manager-icon-text");t.on("click",".yit-icons-manager-list li",function(a){var l=e(a.target).closest("li"),o=l.data("font"),s=l.data("icon"),r=l.data("key"),c=l.data("name");i.attr("data-font",o),i.attr("data-icon",s),i.attr("data-key",r),i.attr("data-name",c),n.val(o+":"+c),t.find(".yit-icons-manager-list li").removeClass("active"),l.addClass("active")}),t.on("click",".yit-icons-manager-action-set-default",function(){t.find(".yit-icons-manager-list li.default").trigger("click")})}),e(document).find(".ui-sortable .yith-toggle-elements").sortable({cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",stop:function(t,i){var n=jQuery(".ui-sortable-handle"),a=0,l=new Array;for(a=0;a<n.length;a++)l[a]=e(n[a]).data("item_key");l.length>0&&e(this).closest(".toggle-element").saveToggleElement(null,l)}}),e(document.body).trigger("wc-enhanced-select-init"),e(document.body).trigger("yith-framework-enhanced-select-init"),e(document).trigger("yith-plugin-fw-codemirror-init"),t.triggerImageChange(),i.init()}).trigger("yith_fields_init"),e(document).on("click",".yith-plugin-fw-select-images__item",function(){var t=e(this),i=t.data("key"),n=t.closest(".yith-plugin-fw-select-images__wrapper"),a=n.find(".yith-plugin-fw-select-images__item"),l=n.find("select").first();l.length&&(l.val(i).trigger("yith_select_images_value_changed").trigger("change"),a.removeClass("yith-plugin-fw-select-images__item--selected"),t.addClass("yith-plugin-fw-select-images__item--selected"))}),e(document).on("click",".yith-plugin-fw-select-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!0).trigger("change")}),e(document).on("click",".yith-plugin-fw-deselect-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!1).trigger("change")}),e(document).on("click",".yith-plugin-fw-onoff-container span",function(){var t=e(this).prev("input");t.prop("disabled")||t.trigger("click")}),e(document).on("click",".yith-plugin-fw-onoff-container input",function(t){e(this).is(":checked")?e(this).attr("value","yes").addClass("onoffchecked"):e(this).attr("value","no").removeClass("onoffchecked"),e(this).trigger("change")}),e.fn.saveToggleElement=function(t,i){var n=e(this),a="yith_plugin_fw_save_toggle_element",l=n.serializeToggleElement(),o=n.find(".yith-toggle_wrapper"),s=o.attr("id"),r=e.urlParam("tab");l.append("security",o.data("nonce")),void 0!==i&&i.length>0&&l.append("yith_toggle_elements_order_keys",i),n.closest(".metaboxes-tab.yith-plugin-ui").length?(a="yith_plugin_fw_save_toggle_element_metabox",post_id=e(this).closest("form#post").find("#post_ID").val(),yit_metaboxes_nonce=e(this).closest("form#post").find("#yit_metaboxes_nonce").val(),metabox_tab=e(this).closest(".tabs-panel").attr("id"),url=yith_framework_fw_fields.ajax_url+"?action="+a+"&post_ID="+post_id+"&yit_metaboxes_nonce="+yit_metaboxes_nonce+"&toggle_id="+s+"&metabox_tab="+metabox_tab):url=yith_framework_fw_fields.admin_url+"?action="+a+"&tab="+r+"&toggle_id="+s,e.ajax({type:"POST",url:url,data:l,contentType:!1,processData:!1,success:function(i){t&&t.removeClass("show"),e(document).trigger("yith_save_toggle_element_done",[i,n])}})},e.fn.serializeToggleElement=function(){var t=e(this),i=new FormData,n=e(t).find(":input").serializeArray();return e.each(n,function(e,t){el_name=t.name,i.append(t.name,t.value)}),i},e.fn.formatToggleTitle=function(){var t=e(this),i=t.find(":input"),n=t.find("span.title").data("title_format"),a=t.find(".subtitle").data("subtitle_format"),l=new RegExp("[^%%]+(?=[%%])","g");if(void 0!==n)var o=n.match(l);if(void 0!==a)var s=a.match(l);e.each(i,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_array=$field_id.split("_"),$field_array.pop(),$field_id=$field_array.join("_"),$field_val=e(i).val(),null!=o&&void 0!==o&&-1!==o.indexOf($field_id)&&(n=n.replace("%%"+$field_id+"%%",$field_val)),null!=s&&void 0!==s&&-1!==s.indexOf($field_id)&&(a=a.replace("%%"+$field_id+"%%",$field_val)))}),""!==n&&t.find("span.title").html(n),""!==a&&t.find(".subtitle").html(a),e(document).trigger("yith-toggle-element-item-title",[t])},e.urlParam=function(e){var t=new RegExp("[?&]"+e+"=([^&#]*)").exec(window.location.search);return null!==t&&(t[1]||0)},e(document).on("click",".yith-toggle-title",function(t){var i=e(t.target),n=i.closest(".yith-toggle-row"),a=n.find(".yith-toggle-content");if(i.hasClass("yith-plugin-fw-onoff")||i.hasClass("yith-icon-drag"))return!1;n.is(".yith-toggle-row-opened")?a.slideUp(400):a.slideDown(400),n.toggleClass("yith-toggle-row-opened")}),e(document).on("click",".yith-add-box-button",function(t){t.preventDefault();var i=e(this),n=i.data("box_id"),a=i.data("closed_label"),l=i.data("opened_label"),o=i.closest(".yith-toggle_wrapper").attr("id"),s=wp.template("yith-toggle-element-add-box-content-"+o);""!==n&&(e("#"+n).html(s({index:"box_id"})).slideToggle(),""!==a&&(i.html()===a?i.html(l).removeClass("closed"):i.html(a).addClass("closed")),e(document).trigger("yith_fields_init"),e(document).trigger("yith-add-box-button-toggle",[i]))}),e(document).on("click",".yith-add-box-buttons .yith-save-button",function(t){t.preventDefault();var i=e(this).parents(".yith-add-box"),n=e(this).closest(".yith-toggle_wrapper").attr("id"),a=i.find(".spinner"),l=e(this).parents(".toggle-element"),o=i.find(":input"),s=0,r=e('<input type="hidden">');l.find(".yith-toggle-row").each(function(){var t=parseInt(e(this).data("item_key"));s<=t&&(s=t+1)}),r.val(s),e(document).trigger("yith-toggle-change-counter",[r,i]),s=r.val();var c=wp.template("yith-toggle-element-item-"+n),d=e(c({index:s}));a.addClass("show"),e.each(o,function(t,i){if(void 0!==e(i).attr("id")){var n=e(i).attr("id"),a=e(i).val();n="radio"===e(i).attr("type")?(n=(n=e(i).closest(".yith-plugin-fw-radio").attr("id")).replace("new_","")+"_"+s)+"-"+a:n.replace("new_","")+"_"+s,e(i).is(":checked")&&e(d).find("#"+n).prop("checked",!0),(e(i).hasClass("yith-post-search")||e(i).hasClass("yith-term-search"))&&e(d).find("#"+n).html(e("#"+e(i).attr("id")).html()),e(d).find("#"+n).val(a)}}),e(d).formatToggleTitle();var u=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-add",[i,d,u]);setTimeout(function(){if("yes"===u.val()){e(l).find(".yith-toggle-elements").append(d),e(i).find(".yith-plugin-fw-datepicker").datepicker("destroy"),e(i).html(""),e(i).prev(".yith-add-box-button").trigger("click"),l.saveToggleElement();setTimeout(function(){e(l).find(".highlight").removeClass("highlight")},2e3),e(document).trigger("yith_fields_init")}},1e3)}),e(document).on("click",".yith-toggle-row .yith-save-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element"),n=e(this).closest(".yith-toggle-row"),a=n.find(".spinner");n.formatToggleTitle();var l=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-update",[i,n,l]),"yes"===l.val()&&(a.addClass("show"),i.saveToggleElement(a))}),e(document).on("click",".yith-toggle-row .yith-delete-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element");e(this).closest(".yith-toggle-row").remove(),i.saveToggleElement()}),e(document).on("click",".yith-toggle-onoff",function(t){t.preventDefault(),e(this).closest(".toggle-element").saveToggleElement()}),e(document).on("click",".yith-plugin-fw-radio input[type=radio]",function(){var t=e(this).closest(".yith-plugin-fw-radio"),i=e(this).val();t.val(i).data("value",i).trigger("change")}),e(document.body).on("yith-plugin-fw-init-radio",function(){e(".yith-plugin-fw-radio:not(.yith-plugin-fw-radio--initialized)").each(function(){e(this).find('input[type="radio"]').filter('[value="'+e(this).data("value")+'"]').click(),e(this).addClass("yith-plugin-fw-radio--initialized")})}).trigger("yith-plugin-fw-init-radio"),e(document).on("click",".yith-password-eye",function(){var t=e(this),i=e(this).closest(".yith-password-wrapper").find("input");"password"===i.attr("type")?(i.attr("type","text"),t.addClass("yith-password-eye-closed")):(i.attr("type","password"),t.removeClass("yith-password-eye-closed"))}),e(document).on("select2:open",function(t){e(t.target).closest(".yith-plugin-ui").length&&e(".select2-results").closest(".select2-container").addClass("yith-plugin-fw-select2-container")});var n={selectors:{wrapper:".yith-plugin-fw-dimensions",units:{wrapper:".yith-plugin-fw-dimensions__units",single:".yith-plugin-fw-dimensions__unit",value:".yith-plugin-fw-dimensions__unit__value",selectedClass:"yith-plugin-fw-dimensions__unit--selected"},linked:{button:".yith-plugin-fw-dimensions__linked",value:".yith-plugin-fw-dimensions__linked__value",wrapperActiveClass:"yith-plugin-fw-dimensions--linked-active"},dimensions:{number:".yith-plugin-fw-dimensions__dimension__number"}},init:function(){var t=n;e(document).on("click",t.selectors.units.single,t.unitChange),e(document).on("click",t.selectors.linked.button,t.linkedChange),e(document).on("change keyup",t.selectors.dimensions.number,t.numberChange)},unitChange:function(t){var i=e(this).closest(n.selectors.units.single),a=i.closest(n.selectors.units.wrapper),l=a.find(n.selectors.units.single),o=a.find(n.selectors.units.value).first(),s=i.data("value");l.removeClass(n.selectors.units.selectedClass),i.addClass(n.selectors.units.selectedClass),o.val(s).trigger("change")},linkedChange:function(){var t=e(this).closest(n.selectors.linked.button),i=t.closest(n.selectors.wrapper),a=t.find(n.selectors.linked.value);"yes"===a.val()?(i.removeClass(n.selectors.linked.wrapperActiveClass),a.val("no")):(i.addClass(n.selectors.linked.wrapperActiveClass),a.val("yes"),i.find(n.selectors.dimensions.number).first().trigger("change"))},numberChange:function(t){var i=e(this).closest(n.selectors.dimensions.number),a=i.closest(n.selectors.wrapper);a.hasClass(n.selectors.linked.wrapperActiveClass)&&a.find(n.selectors.dimensions.number).val(i.val())}};n.init();e(document).on("click",".yith-plugin-fw-copy-to-clipboard__copy",function(){var t,i=e(this).closest(".yith-plugin-fw-copy-to-clipboard"),n=i.find(".yith-plugin-fw-copy-to-clipboard__field"),a=i.find(".yith-plugin-fw-copy-to-clipboard__tip"),l=i.data("tip-timeout");l&&clearTimeout(l),n.select(),document.execCommand("copy"),(t="getSelection"in window&&window.getSelection())?"empty"in t?t.empty():"removeAllRanges"in t&&t.removeAllRanges():"selection"in document&&document.selection.empty(),a.fadeIn(400),l=setTimeout(function(){a.fadeOut(400)},1500),i.data("tip-timeout",l)});var a={init:function(){e(document).on("click",".yith-plugin-fw__action-button--has-menu",a.open),e(document).on("click",".yith-plugin-fw__action-button__menu",a.stopPropagation),e(document).on("click",a.closeAll)},closeAll:function(){e(".yith-plugin-fw__action-button--opened").removeClass("yith-plugin-fw__action-button--opened")},open:function(t){var i=e(this).closest(".yith-plugin-fw__action-button"),n=i.hasClass("yith-plugin-fw__action-button--opened");t.preventDefault(),t.stopPropagation(),a.closeAll(),n||i.addClass("yith-plugin-fw__action-button--opened")},stopPropagation:function(e){e.stopPropagation()}};a.init(),e(document).on("click","a.yith-plugin-fw__require-confirmation-link",function(t){var i=e(this).closest("a.yith-plugin-fw__require-confirmation-link"),n=i.attr("href");if(n&&"#"!==n&&(t.preventDefault(),t.stopPropagation(),"yith"in window&&"ui"in yith)){var a,l=["title","message","confirmButtonType","cancelButton","confirmButton"],o={};for(a in l){var s=l[a],r=i.data(s);void 0!==r&&(o[s]=r)}o.onConfirm=function(){window.location.href=n},o.closeAfterConfirm=!1,yith.ui.confirm(o)}}),e(document).on("yith-plugin-fw-tips-init",function(){e(".yith-plugin-fw__tips").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200})}).trigger("yith-plugin-fw-tips-init")}(jQuery);
1
+ !function(e){var t={selectors:{imgPreview:".yith-plugin-fw-upload-img-preview",uploadButton:".yith-plugin-fw-upload-button",imgUrl:".yith-plugin-fw-upload-img-url",resetButton:".yith-plugin-fw-upload-button-reset"},onImageChange:function(){var i=e(this).val(),n=new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico|svg)"),a=e(this).parent().find(t.selectors.imgPreview).first();a.length<1&&(a=e(this).parent().parent().find(t.selectors.imgPreview).first()),n.test(i)?a.html('<img src="'+i+'" style="max-width:100px; max-height:100px;" />'):a.html("")},onButtonClick:function(i){i.preventDefault();var n,a=e(this).attr("id").replace(/-button$/,"").replace(/(\[|\])/g,"\\$1");if(n)n.open();else{var l=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];(n=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:l})).on("select",function(){var i=n.state().get("selection").first().toJSON(),l=e("#"+a+"-yith-attachment-id");e("#"+a).val(i.url),l.length&&l.val(i.id),t.triggerImageChange()}),n.open()}},onResetClick:function(){var i=e(this),n=i.attr("id").replace(/(\[|\])/g,"\\$1"),a=i.attr("id").replace(/-button-reset$/,"").replace(/(\[|\])/g,"\\$1"),l=e("#"+n).data("default");e("#"+a).val(l),t.triggerImageChange()},triggerImageChange:function(){e(t.selectors.imgUrl).trigger("change")},initOnce:function(){"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&(e(document).on("change",t.selectors.imgUrl,t.onImageChange),e(document).on("click",t.selectors.uploadButton,t.onButtonClick),e(document).on("click",t.selectors.resetButton,t.onResetClick))}};t.initOnce();var i={selectors:{gallery:".yith-plugin-fw-image-gallery",notInitGallery:".yith-plugin-fw-image-gallery:not(.yith-plugin-fw-image-gallery--initialized)",button:".yith-plugin-fw-image-gallery .image-gallery-button",slideWrapper:"ul.slides-wrapper"},initOnce:function(){"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&e(document).on("click",i.selectors.button,function(t){var n=e(this),a=n.closest(i.selectors.gallery),l=a.find(".image_gallery_ids"),o=l.val(),s=a.find("ul.slides-wrapper"),r=wp.media.frames.image_gallery=wp.media({title:n.data("choose"),button:{text:n.data("update")},states:[new wp.media.controller.Library({title:n.data("choose"),filterable:"all",multiple:!0})]});r.on("select",function(){r.state().get("selection").map(function(e){(e=e.toJSON()).id&&(o=o?o+","+e.id:e.id,s.append('<li class="image" data-attachment_id="'+e.id+'"><img src="'+e.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+n.data("delete")+'">x</a></li></ul></li>'))}),l.val(o),l.trigger("change")}),r.open()})},init:function(){"undefined"!=typeof wp&&"undefined"!=typeof wp.media&&e(i.selectors.notInitGallery).each(function(){e(this).addClass("yith-plugin-fw-image-gallery--initialized");var t=e(this).find(i.selectors.slideWrapper);t.each(function(){var t=e(this);t.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,start:function(e,t){t.item.css("background-color","#f6f6f6")},stop:function(e,t){t.item.removeAttr("style")},update:function(n,a){var l="";t.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");l=l+t+","}),t.closest(i.selectors.gallery).find(".image_gallery_ids").val(l)}})}),t.on("click","a.delete",function(t){t.preventDefault();var n=e(this).closest(i.selectors.gallery),a=n.find("ul.slides-wrapper"),l=n.find(".image_gallery_ids"),o="";e(this).closest("li.image").remove(),a.find("li.image").css("cursor","default").each(function(){var t=e(this).attr("data-attachment_id");o=o+t+","}),l.val(o)})})}};i.initOnce(),e(function(){e(document).on("yith-plugin-fw-codemirror-init",function(){"undefined"!=typeof wp&&"undefined"!=typeof wp.codeEditor&&e(".codemirror:not(.codemirror--initialized)").each(function(){var t=e(this).data("settings"),i=wp.codeEditor.initialize(e(this),t);e(this).addClass("codemirror--initialized"),e(this).data("codemirrorInstance",i)})}).trigger("yith-plugin-fw-codemirror-init")});e(document).on("yith_fields_init",function(){var n=e(".yith-plugin-fw-datepicker:not(.yith-plugin-fw-datepicker--initialized)"),a=e(".yith-plugin-fw-colorpicker:not(.yith-plugin-fw-colorpicker--initialized)"),l=e(".yith-plugin-fw-sidebar-layout:not(.yith-plugin-fw-sidebar-layout--initialized)"),o=e(".yith-plugin-fw-slider-container:not(.yith-plugin-fw-slider-container--initialized)"),s=e(".yit-icons-manager-wrapper:not(.yit-icons-manager-wrapper--initialized)");n.each(function(){e(this).addClass("yith-plugin-fw-datepicker--initialized");var t=e(this),i=t.data(),n=t.next(".yith-icon-calendar");i.showAnim=!1,i.beforeShow=function(e,t){t.dpDiv.addClass("yith-plugin-fw-datepicker-div")},i.onClose=function(e,t){t.dpDiv.removeClass("yith-plugin-fw-datepicker-div")},t.datepicker(i),n&&n.on("click",function(){t.datepicker("show")})}),a.each(function(){e(this).addClass("yith-plugin-fw-colorpicker--initialized"),e(this).wpColorPicker({palettes:!1,width:200,mode:"hsl",clear:function(){var t=e(this);t.val(t.data("default-color")),t.trigger("change")}});var t=e(this).data("variations-label"),i=e(this).closest(".yith-plugin-fw-colorpicker-field-wrapper"),n=e(this).closest(".yith-single-colorpicker"),a=i.find(".wp-picker-input-wrap"),l=n.find(".wp-picker-input-wrap");if(a.length&&i.find("a.wp-color-result").attr("title",t),n.length&&n.find("a.wp-color-result").attr("title",t),!a.find(".wp-picker-default-custom").length){var o=e("<span/>").attr({"class":"wp-picker-default-custom"});a.find(".wp-picker-default").wrap(o)}l.find(".wp-picker-default-custom").length||(o=e("<span/>").attr({"class":"wp-picker-default-custom"}),l.find(".wp-picker-default").wrap(o))}),l.each(function(){e(this).addClass("yith-plugin-fw-sidebar-layout--initialized"),e(this).find("img").on("click",function(){var t=e(this).closest(".yith-plugin-fw-sidebar-layout"),i=t.find(".yith-plugin-fw-sidebar-layout-sidebar-left-container"),n=t.find(".yith-plugin-fw-sidebar-layout-sidebar-right-container"),a=e(this).data("type");if(e(this).parent().children(":radio").attr("checked",!1),e(this).prev(":radio").attr("checked",!0),void 0!==a)switch(a){case"left":i.show(),n.hide();break;case"right":n.show(),i.hide();break;case"double":i.show(),n.show();break;default:i.hide(),n.hide()}})}),o.each(function(){e(this).addClass("yith-plugin-fw-slider-container--initialized");var t=e(this).find(".ui-slider-horizontal"),i=t.data("val"),n=t.data("min"),a=t.data("max"),l=t.data("step"),o=t.data("labels");t.slider({value:i,min:n,max:a,range:"min",step:l,create:function(){e(this).find(".ui-slider-handle").text(e(this).slider("value"))},slide:function(t,i){e(this).find("input").val(i.value).trigger("change"),e(this).find(".ui-slider-handle").text(i.value),e(this).siblings(".feedback").find("strong").text(i.value+o)}})}),s.each(function(){e(this).addClass("yit-icons-manager-wrapper--initialized");var t=e(this),i=t.find(".yit-icons-manager-icon-preview").first(),n=t.find(".yit-icons-manager-icon-text");t.on("click",".yit-icons-manager-list li",function(a){var l=e(a.target).closest("li"),o=l.data("font"),s=l.data("icon"),r=l.data("key"),c=l.data("name");i.attr("data-font",o),i.attr("data-icon",s),i.attr("data-key",r),i.attr("data-name",c),n.val(o+":"+c),t.find(".yit-icons-manager-list li").removeClass("active"),l.addClass("active")}),t.on("click",".yit-icons-manager-action-set-default",function(){t.find(".yit-icons-manager-list li.default").trigger("click")})}),e(document).find(".ui-sortable .yith-toggle-elements").sortable({cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",stop:function(t,i){var n=jQuery(".ui-sortable-handle"),a=0,l=new Array;for(a=0;a<n.length;a++)l[a]=e(n[a]).data("item_key");l.length>0&&e(this).closest(".toggle-element").saveToggleElement(null,l)}}),e(document.body).trigger("wc-enhanced-select-init"),e(document.body).trigger("yith-framework-enhanced-select-init"),e(document).trigger("yith-plugin-fw-codemirror-init"),t.triggerImageChange(),i.init()}).trigger("yith_fields_init"),e(document).on("click",".yith-plugin-fw-select-images__item",function(){var t=e(this),i=t.data("key"),n=t.closest(".yith-plugin-fw-select-images__wrapper"),a=n.find(".yith-plugin-fw-select-images__item"),l=n.find("select").first();l.length&&(l.val(i).trigger("yith_select_images_value_changed").trigger("change"),a.removeClass("yith-plugin-fw-select-images__item--selected"),t.addClass("yith-plugin-fw-select-images__item--selected"))}),e(document).on("click",".yith-plugin-fw-select-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!0).trigger("change")}),e(document).on("click",".yith-plugin-fw-deselect-all",function(){e("#"+e(this).data("select-id")).find("option").prop("selected",!1).trigger("change")}),e(document).on("click",".yith-plugin-fw-onoff-container span",function(){var t=e(this).prev("input");t.prop("disabled")||t.trigger("click")}),e(document).on("click",".yith-plugin-fw-onoff-container input",function(t){e(this).is(":checked")?e(this).attr("value","yes").addClass("onoffchecked"):e(this).attr("value","no").removeClass("onoffchecked")}),e.fn.saveToggleElement=function(t,i){var n=e(this),a="yith_plugin_fw_save_toggle_element",l=n.serializeToggleElement(),o=n.find(".yith-toggle_wrapper"),s=o.attr("id"),r=e.urlParam("tab");l.append("security",o.data("nonce")),void 0!==i&&i.length>0&&l.append("yith_toggle_elements_order_keys",i),n.closest(".metaboxes-tab.yith-plugin-ui").length?(a="yith_plugin_fw_save_toggle_element_metabox",post_id=e(this).closest("form#post").find("#post_ID").val(),yit_metaboxes_nonce=e(this).closest("form#post").find("#yit_metaboxes_nonce").val(),metabox_tab=e(this).closest(".tabs-panel").attr("id"),url=yith_framework_fw_fields.ajax_url+"?action="+a+"&post_ID="+post_id+"&yit_metaboxes_nonce="+yit_metaboxes_nonce+"&toggle_id="+s+"&metabox_tab="+metabox_tab):url=yith_framework_fw_fields.admin_url+"?action="+a+"&tab="+r+"&toggle_id="+s,e.ajax({type:"POST",url:url,data:l,contentType:!1,processData:!1,success:function(i){t&&t.removeClass("show"),e(document).trigger("yith_save_toggle_element_done",[i,n])}})},e.fn.serializeToggleElement=function(){var t=e(this),i=new FormData,n=e(t).find(":input").serializeArray();return e.each(n,function(e,t){el_name=t.name,i.append(t.name,t.value)}),i},e.fn.formatToggleTitle=function(){var t=e(this),i=t.find(":input"),n=t.find("span.title").data("title_format"),a=t.find(".subtitle").data("subtitle_format"),l=new RegExp("[^%%]+(?=[%%])","g");if(void 0!==n)var o=n.match(l);if(void 0!==a)var s=a.match(l);e.each(i,function(t,i){void 0!==e(i).attr("id")&&($field_id=e(i).attr("id"),$field_array=$field_id.split("_"),$field_array.pop(),$field_id=$field_array.join("_"),$field_val=e(i).val(),null!=o&&void 0!==o&&-1!==o.indexOf($field_id)&&(n=n.replace("%%"+$field_id+"%%",$field_val)),null!=s&&void 0!==s&&-1!==s.indexOf($field_id)&&(a=a.replace("%%"+$field_id+"%%",$field_val)))}),""!==n&&t.find("span.title").html(n),""!==a&&t.find(".subtitle").html(a),e(document).trigger("yith-toggle-element-item-title",[t])},e.urlParam=function(e){var t=new RegExp("[?&]"+e+"=([^&#]*)").exec(window.location.search);return null!==t&&(t[1]||0)},e(document).on("click",".yith-toggle-title",function(t){var i=e(t.target),n=i.closest(".yith-toggle-row"),a=n.find(".yith-toggle-content");if(i.hasClass("yith-plugin-fw-onoff")||i.hasClass("yith-icon-drag"))return!1;n.is(".yith-toggle-row-opened")?a.slideUp(400):a.slideDown(400),n.toggleClass("yith-toggle-row-opened")}),e(document).on("click",".yith-add-box-button",function(t){t.preventDefault();var i=e(this),n=i.data("box_id"),a=i.data("closed_label"),l=i.data("opened_label"),o=i.closest(".yith-toggle_wrapper").attr("id"),s=wp.template("yith-toggle-element-add-box-content-"+o);""!==n&&(e("#"+n).html(s({index:"box_id"})).slideToggle(),""!==a&&(i.html()===a?i.html(l).removeClass("closed"):i.html(a).addClass("closed")),e(document).trigger("yith_fields_init"),e(document).trigger("yith-add-box-button-toggle",[i]))}),e(document).on("click",".yith-add-box-buttons .yith-save-button",function(t){t.preventDefault();var i=e(this).parents(".yith-add-box"),n=e(this).closest(".yith-toggle_wrapper").attr("id"),a=i.find(".spinner"),l=e(this).parents(".toggle-element"),o=i.find(":input"),s=0,r=e('<input type="hidden">');l.find(".yith-toggle-row").each(function(){var t=parseInt(e(this).data("item_key"));s<=t&&(s=t+1)}),r.val(s),e(document).trigger("yith-toggle-change-counter",[r,i]),s=r.val();var c=wp.template("yith-toggle-element-item-"+n),d=e(c({index:s}));a.addClass("show"),e.each(o,function(t,i){if(void 0!==e(i).attr("id")){var n=e(i).attr("id"),a=e(i).val();n="radio"===e(i).attr("type")?(n=(n=e(i).closest(".yith-plugin-fw-radio").attr("id")).replace("new_","")+"_"+s)+"-"+a:n.replace("new_","")+"_"+s,e(i).is(":checked")&&e(d).find("#"+n).prop("checked",!0),(e(i).hasClass("yith-post-search")||e(i).hasClass("yith-term-search"))&&e(d).find("#"+n).html(e("#"+e(i).attr("id")).html()),e(d).find("#"+n).val(a)}}),e(d).formatToggleTitle();var u=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-add",[i,d,u]);setTimeout(function(){if("yes"===u.val()){e(l).find(".yith-toggle-elements").append(d),e(i).find(".yith-plugin-fw-datepicker").datepicker("destroy"),e(i).html(""),e(i).prev(".yith-add-box-button").trigger("click"),l.saveToggleElement();setTimeout(function(){e(l).find(".highlight").removeClass("highlight")},2e3),e(document).trigger("yith_fields_init")}},1e3)}),e(document).on("click",".yith-toggle-row .yith-save-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element"),n=e(this).closest(".yith-toggle-row"),a=n.find(".spinner");n.formatToggleTitle();var l=e('<input type="hidden">').val("yes");e(document).trigger("yith-toggle-element-item-before-update",[i,n,l]),"yes"===l.val()&&(a.addClass("show"),i.saveToggleElement(a))}),e(document).on("click",".yith-toggle-row .yith-delete-button",function(t){t.preventDefault();var i=e(this).closest(".toggle-element");e(this).closest(".yith-toggle-row").remove(),i.saveToggleElement()}),e(document).on("click",".yith-toggle-onoff",function(t){t.preventDefault(),e(this).closest(".toggle-element").saveToggleElement()}),e(document).on("click",".yith-plugin-fw-radio input[type=radio]",function(){var t=e(this).closest(".yith-plugin-fw-radio"),i=e(this).val();t.val(i).data("value",i).trigger("change")}),e(document.body).on("yith-plugin-fw-init-radio",function(){e(".yith-plugin-fw-radio:not(.yith-plugin-fw-radio--initialized)").each(function(){e(this).find('input[type="radio"]').filter('[value="'+e(this).data("value")+'"]').click(),e(this).addClass("yith-plugin-fw-radio--initialized")})}).trigger("yith-plugin-fw-init-radio"),e(document).on("click",".yith-password-eye",function(){var t=e(this),i=e(this).closest(".yith-password-wrapper").find("input");"password"===i.attr("type")?(i.attr("type","text"),t.addClass("yith-password-eye-closed")):(i.attr("type","password"),t.removeClass("yith-password-eye-closed"))}),e(document).on("select2:open",function(t){e(t.target).closest(".yith-plugin-ui").length&&e(".select2-results").closest(".select2-container").addClass("yith-plugin-fw-select2-container")});var n={selectors:{wrapper:".yith-plugin-fw-dimensions",units:{wrapper:".yith-plugin-fw-dimensions__units",single:".yith-plugin-fw-dimensions__unit",value:".yith-plugin-fw-dimensions__unit__value",selectedClass:"yith-plugin-fw-dimensions__unit--selected"},linked:{button:".yith-plugin-fw-dimensions__linked",value:".yith-plugin-fw-dimensions__linked__value",wrapperActiveClass:"yith-plugin-fw-dimensions--linked-active"},dimensions:{number:".yith-plugin-fw-dimensions__dimension__number"}},init:function(){var t=n;e(document).on("click",t.selectors.units.single,t.unitChange),e(document).on("click",t.selectors.linked.button,t.linkedChange),e(document).on("change keyup",t.selectors.dimensions.number,t.numberChange)},unitChange:function(t){var i=e(this).closest(n.selectors.units.single),a=i.closest(n.selectors.units.wrapper),l=a.find(n.selectors.units.single),o=a.find(n.selectors.units.value).first(),s=i.data("value");l.removeClass(n.selectors.units.selectedClass),i.addClass(n.selectors.units.selectedClass),o.val(s).trigger("change")},linkedChange:function(){var t=e(this).closest(n.selectors.linked.button),i=t.closest(n.selectors.wrapper),a=t.find(n.selectors.linked.value);"yes"===a.val()?(i.removeClass(n.selectors.linked.wrapperActiveClass),a.val("no")):(i.addClass(n.selectors.linked.wrapperActiveClass),a.val("yes"),i.find(n.selectors.dimensions.number).first().trigger("change"))},numberChange:function(t){var i=e(this).closest(n.selectors.dimensions.number),a=i.closest(n.selectors.wrapper);a.hasClass(n.selectors.linked.wrapperActiveClass)&&a.find(n.selectors.dimensions.number).val(i.val())}};n.init();e(document).on("click",".yith-plugin-fw-copy-to-clipboard__copy",function(){var t,i=e(this).closest(".yith-plugin-fw-copy-to-clipboard"),n=i.find(".yith-plugin-fw-copy-to-clipboard__field"),a=i.find(".yith-plugin-fw-copy-to-clipboard__tip"),l=i.data("tip-timeout");l&&clearTimeout(l),n.select(),document.execCommand("copy"),(t="getSelection"in window&&window.getSelection())?"empty"in t?t.empty():"removeAllRanges"in t&&t.removeAllRanges():"selection"in document&&document.selection.empty(),a.fadeIn(400),l=setTimeout(function(){a.fadeOut(400)},1500),i.data("tip-timeout",l)});var a={init:function(){e(document).on("click",".yith-plugin-fw__action-button--has-menu",a.open),e(document).on("click",".yith-plugin-fw__action-button__menu",a.stopPropagation),e(document).on("click",a.closeAll)},closeAll:function(){e(".yith-plugin-fw__action-button--opened").removeClass("yith-plugin-fw__action-button--opened")},open:function(t){var i=e(this).closest(".yith-plugin-fw__action-button"),n=i.hasClass("yith-plugin-fw__action-button--opened");t.preventDefault(),t.stopPropagation(),a.closeAll(),n||i.addClass("yith-plugin-fw__action-button--opened")},stopPropagation:function(e){e.stopPropagation()}};a.init(),e(document).on("click","a.yith-plugin-fw__require-confirmation-link",function(t){var i=e(this).closest("a.yith-plugin-fw__require-confirmation-link"),n=i.attr("href");if(n&&"#"!==n&&(t.preventDefault(),t.stopPropagation(),"yith"in window&&"ui"in yith)){var a,l=["title","message","confirmButtonType","cancelButton","confirmButton"],o={};for(a in l){var s=l[a],r=i.data(s);void 0!==r&&(o[s]=r)}o.onConfirm=function(){window.location.href=n},o.closeAfterConfirm=!1,yith.ui.confirm(o)}}),e(document).on("yith-plugin-fw-tips-init",function(){e(".yith-plugin-fw__tips").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200})}).trigger("yith-plugin-fw-tips-init")}(jQuery);
plugin-fw/includes/class-yit-metabox.php CHANGED
@@ -301,8 +301,9 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
301
  $this->reorder_tabs();
302
 
303
  $args = array(
304
- 'tabs' => $this->tabs,
305
- 'class' => isset( $this->options['class'] ) ? $this->options['class'] : '',
 
306
  );
307
 
308
  if ( isset( $meta_box, $meta_box['id'] ) ) {
301
  $this->reorder_tabs();
302
 
303
  $args = array(
304
+ 'tabs' => $this->tabs,
305
+ 'class' => isset( $this->options['class'] ) ? $this->options['class'] : '',
306
+ 'meta_box_id' => $this->id,
307
  );
308
 
309
  if ( isset( $meta_box, $meta_box['id'] ) ) {
plugin-fw/includes/class-yit-plugin-panel.php CHANGED
@@ -491,7 +491,10 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
491
  $tabs .= '</ul>';
492
  ?>
493
  <h2 class="<?php echo esc_attr( $wrapper_class ); ?>">
494
- <?php echo $tabs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
 
 
 
495
  </h2>
496
  <?php
497
  $this->print_sub_tabs_nav( $args );
491
  $tabs .= '</ul>';
492
  ?>
493
  <h2 class="<?php echo esc_attr( $wrapper_class ); ?>">
494
+ <?php
495
+ // $tabs is already escaped, since its content is created via YIT_Plugin_Panel::get_tab_nav.
496
+ echo $tabs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
497
+ ?>
498
  </h2>
499
  <?php
500
  $this->print_sub_tabs_nav( $args );
plugin-fw/init.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 3.7.4
5
  * Author: YITH
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author YITH
10
- * @version 3.7.4
11
  * @package YITH\PluginFramework
12
  */
13
 
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
+ * Version: 3.7.5
5
  * Author: YITH
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author YITH
10
+ * @version 3.7.5
11
  * @package YITH\PluginFramework
12
  */
13
 
plugin-fw/phpcs.xml CHANGED
@@ -1,5 +1,5 @@
1
  <?xml version="1.0"?>
2
- <ruleset name="WordPress Coding Standards">
3
  <description>YITH Plugin Framework - PHP_CodeSniffer ruleset.</description>
4
 
5
  <file>.</file>
@@ -27,7 +27,7 @@
27
  <!-- Configs -->
28
  <config name="minimum_supported_wp_version" value="5.2"/>
29
  <!-- Check for cross-version support for PHP 5.6 and higher. -->
30
- <config name="testVersion" value="5.6-"/>
31
 
32
  <!-- Rules -->
33
 
1
  <?xml version="1.0"?>
2
+ <ruleset name="YITH Plugin Framework Coding Standards">
3
  <description>YITH Plugin Framework - PHP_CodeSniffer ruleset.</description>
4
 
5
  <file>.</file>
27
  <!-- Configs -->
28
  <config name="minimum_supported_wp_version" value="5.2"/>
29
  <!-- Check for cross-version support for PHP 5.6 and higher. -->
30
+ <config name="testVersion" value="7.0-"/>
31
 
32
  <!-- Rules -->
33
 
plugin-fw/templates/metaboxes/tab.php CHANGED
@@ -2,8 +2,10 @@
2
  /**
3
  * The Template for displaying meta-box tabs.
4
  *
5
- * @var array $tabs The tabs.
6
- * @var string $class The CSS Class.
 
 
7
  * @package YITH\PluginFramework\Templates
8
  */
9
 
@@ -84,7 +86,23 @@ do_action( 'yit_before_metaboxes_tab' );
84
  if ( $pos ) {
85
  $field_name = substr_replace( $field_name, '', $pos, 1 );
86
  }
87
- $value = yit_get_post_meta( $post->ID, $field_name );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  $field['value'] = false === $value ? ( isset( $field['std'] ) ? $field['std'] : '' ) : $value;
89
  $field['checkboxgroup'] = ( 'checkbox' === $field['type'] && isset( $field['checkboxgroup'] ) ) ? ' ' . $field['checkboxgroup'] : '';
90
  $container_classes = 'the-metabox ' . $field['type'] . $field['checkboxgroup'] . ' clearfix ';
2
  /**
3
  * The Template for displaying meta-box tabs.
4
  *
5
+ * @var array $tabs The tabs.
6
+ * @var string $class The CSS Class.
7
+ * @var string $meta_box_id The ID of the meta-box.
8
+ *
9
  * @package YITH\PluginFramework\Templates
10
  */
11
 
86
  if ( $pos ) {
87
  $field_name = substr_replace( $field_name, '', $pos, 1 );
88
  }
89
+
90
+ /**
91
+ * APPLY_FILTER: yith_plugin_fw_metabox_{meta_box_id}_field_pre_get_value
92
+ * Allow filtering values for meta-box fields instead of retrieving them by post_meta(s).
93
+ *
94
+ * @param mixed|null $value The value to be filtered. Set 'null' to retrieve it by the related post_meta (Default: null).
95
+ * @param int $post_id The post ID.
96
+ * @param string $field_name The field name.
97
+ * @param array $field The field.
98
+ *
99
+ * @since 3.7.6
100
+ */
101
+ $value = apply_filters( "yith_plugin_fw_metabox_{$meta_box_id}_field_pre_get_value", null, $post->ID, $field_name, $field );
102
+ if ( is_null( $value ) ) {
103
+ $value = yit_get_post_meta( $post->ID, $field_name );
104
+ }
105
+
106
  $field['value'] = false === $value ? ( isset( $field['std'] ) ? $field['std'] : '' ) : $value;
107
  $field['checkboxgroup'] = ( 'checkbox' === $field['type'] && isset( $field['checkboxgroup'] ) ) ? ' ' . $field['checkboxgroup'] : '';
108
  $container_classes = 'the-metabox ' . $field['type'] . $field['checkboxgroup'] . ' clearfix ';
plugin-fw/yit-plugin.php CHANGED
@@ -114,6 +114,8 @@ if ( ! function_exists( 'yit_plugin_fw_row_meta' ) ) {
114
  $fields = isset( $new_row_meta_args['to_show'] ) ? $new_row_meta_args['to_show'] : array();
115
  $slug = isset( $new_row_meta_args['slug'] ) ? $new_row_meta_args['slug'] : '';
116
  $is_premium = isset( $new_row_meta_args['is_premium'] ) ? $new_row_meta_args['is_premium'] : '';
 
 
117
 
118
  if ( ! ! $is_premium ) {
119
  $to_remove = array_search( 'premium_version', $fields, true );
@@ -162,18 +164,18 @@ if ( ! function_exists( 'yit_plugin_fw_row_meta' ) ) {
162
  }
163
 
164
  if ( ! empty( $url ) && ! empty( $label ) ) {
165
- $url = yith_plugin_fw_add_utm_data( $url, $slug, 'plugin-version-author-uri', 'wp-dashboard' );
166
  $plugin_meta[] = sprintf( '<a href="%s" target="_blank"><span class="%s"></span>%s</a>', $url, $icon, $label );
167
  }
168
  }
169
 
170
  if ( isset( $plugin_meta[1] ) ) {
171
- $utm_author_uri = yith_plugin_fw_add_utm_data( $plugin_data['AuthorURI'], $slug, 'plugin-version-author-uri', 'wp-dashboard' );
172
  $plugin_meta[1] = str_replace( $plugin_data['AuthorURI'], $utm_author_uri, $plugin_meta[1] );
173
  }
174
 
175
  if ( isset( $plugin_meta[2] ) ) {
176
- $utm_plugin_uri = yith_plugin_fw_add_utm_data( $plugin_data['PluginURI'], $slug, 'plugin-version-author-uri', 'wp-dashboard' );
177
  $plugin_meta[2] = str_replace( $plugin_data['PluginURI'], $utm_plugin_uri, $plugin_meta[2] );
178
  }
179
 
114
  $fields = isset( $new_row_meta_args['to_show'] ) ? $new_row_meta_args['to_show'] : array();
115
  $slug = isset( $new_row_meta_args['slug'] ) ? $new_row_meta_args['slug'] : '';
116
  $is_premium = isset( $new_row_meta_args['is_premium'] ) ? $new_row_meta_args['is_premium'] : '';
117
+ $utm_campaign = 'plugin-version-author-uri';
118
+ $utm_source = $is_premium ? 'wp-premium-dashboard' : 'wp-free-dashboard';
119
 
120
  if ( ! ! $is_premium ) {
121
  $to_remove = array_search( 'premium_version', $fields, true );
164
  }
165
 
166
  if ( ! empty( $url ) && ! empty( $label ) ) {
167
+ $url = yith_plugin_fw_add_utm_data( $url, $slug, $utm_campaign, $utm_source );
168
  $plugin_meta[] = sprintf( '<a href="%s" target="_blank"><span class="%s"></span>%s</a>', $url, $icon, $label );
169
  }
170
  }
171
 
172
  if ( isset( $plugin_meta[1] ) ) {
173
+ $utm_author_uri = yith_plugin_fw_add_utm_data( $plugin_data['AuthorURI'], $slug, $utm_campaign, $utm_source );
174
  $plugin_meta[1] = str_replace( $plugin_data['AuthorURI'], $utm_author_uri, $plugin_meta[1] );
175
  }
176
 
177
  if ( isset( $plugin_meta[2] ) ) {
178
+ $utm_plugin_uri = yith_plugin_fw_add_utm_data( $plugin_data['PluginURI'], $slug, $utm_campaign, $utm_source );
179
  $plugin_meta[2] = str_replace( $plugin_data['PluginURI'], $utm_plugin_uri, $plugin_meta[2] );
180
  }
181
 
plugin-options/settings-options.php CHANGED
@@ -1,18 +1,13 @@
1
  <?php
2
  /**
3
- * This file belongs to the YITH Plugin Framework.
4
  *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- *
10
- * @package YITH WooCommerce Catalog Mode
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
14
- exit;
15
- } // Exit if accessed directly
16
 
17
  return array(
18
  'settings' => array(
@@ -24,7 +19,7 @@ return array(
24
  'name' => esc_html__( 'Catalog mode for administrators', 'yith-woocommerce-catalog-mode' ),
25
  'type' => 'yith-field',
26
  'yith-type' => 'onoff',
27
- 'desc' => esc_html__( 'Choose to enable the Catalog Mode for admins.', 'yith-woocommerce-catalog-mode' ),
28
  'id' => 'ywctm_admin_view',
29
  'default' => 'yes',
30
  ),
@@ -38,8 +33,8 @@ return array(
38
  ),
39
  'hide_add_to_cart' => array(
40
  'type' => 'yith-field',
41
- 'yith-type' => 'yith-multiple-field',
42
- 'name' => esc_html__( 'Hide "Add to Cart" in:', 'yith-woocommerce-catalog-mode' ),
43
  'desc' => esc_html__( 'Choose where to hide "Add to Cart".', 'yith-woocommerce-catalog-mode' ),
44
  'id' => 'ywctm_hide_add_to_cart_settings',
45
  'fields' => array(
@@ -72,7 +67,7 @@ return array(
72
  'name' => esc_html__( 'Hide product variations', 'yith-woocommerce-catalog-mode' ),
73
  'type' => 'yith-field',
74
  'yith-type' => 'onoff',
75
- 'desc' => esc_html__( 'Use this option to hide product variations where "add to cart" is hidden.', 'yith-woocommerce-catalog-mode' ),
76
  'id' => 'ywctm_hide_variations',
77
  'default' => 'no',
78
  ),
1
  <?php
2
  /**
3
+ * Base settings options tab
4
  *
5
+ * @package YITH\CatalogMode
 
 
 
 
 
6
  */
7
 
8
  if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
 
12
  return array(
13
  'settings' => array(
19
  'name' => esc_html__( 'Catalog mode for administrators', 'yith-woocommerce-catalog-mode' ),
20
  'type' => 'yith-field',
21
  'yith-type' => 'onoff',
22
+ 'desc' => esc_html__( 'If enabled, the Catalog Mode rules will also work for admin users.', 'yith-woocommerce-catalog-mode' ),
23
  'id' => 'ywctm_admin_view',
24
  'default' => 'yes',
25
  ),
33
  ),
34
  'hide_add_to_cart' => array(
35
  'type' => 'yith-field',
36
+ 'yith-type' => 'inline-fields',
37
+ 'name' => esc_html__( '"Add to Cart" settings in Catalog Mode', 'yith-woocommerce-catalog-mode' ),
38
  'desc' => esc_html__( 'Choose where to hide "Add to Cart".', 'yith-woocommerce-catalog-mode' ),
39
  'id' => 'ywctm_hide_add_to_cart_settings',
40
  'fields' => array(
67
  'name' => esc_html__( 'Hide product variations', 'yith-woocommerce-catalog-mode' ),
68
  'type' => 'yith-field',
69
  'yith-type' => 'onoff',
70
+ 'desc' => esc_html__( 'Use this option to hide product variations where "Add to cart" is hidden.', 'yith-woocommerce-catalog-mode' ),
71
  'id' => 'ywctm_hide_variations',
72
  'default' => 'no',
73
  ),
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: woocommerce catalog mode plugin, woocommerce catalog only, woocommerce, products, themes, yit, yith, yithemes, e-commerce, shop, catalog mode, catalogue mode, remove add to cart, ask for price, ask price, asking for price, asking price, button remove, call, call for price, call me, call us, contact, email, hide add to cart, hide price
5
  Requires at least: 5.6
6
  Tested up to: 5.8
7
- Stable tag: 2.0.16
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -131,6 +131,11 @@ yith-woocommerce-catalog-mode-<WORDPRESS LOCALE >.mo
131
 
132
  == Changelog ==
133
 
 
 
 
 
 
134
  = Version 2.0.16 - Released: 19 August 2021 =
135
 
136
  * New: support for WooCommerce 5.6
@@ -435,7 +440,7 @@ yith-woocommerce-catalog-mode-<WORDPRESS LOCALE >.mo
435
 
436
  == Upgrade Notice ==
437
 
438
- Last Stable Tag 2.0.16
439
 
440
  == Suggestions ==
441
 
4
  Tags: woocommerce catalog mode plugin, woocommerce catalog only, woocommerce, products, themes, yit, yith, yithemes, e-commerce, shop, catalog mode, catalogue mode, remove add to cart, ask for price, ask price, asking for price, asking price, button remove, call, call for price, call me, call us, contact, email, hide add to cart, hide price
5
  Requires at least: 5.6
6
  Tested up to: 5.8
7
+ Stable tag: 2.1.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
131
 
132
  == Changelog ==
133
 
134
+ = Version 2.1.0 - Released: 16 September 2021 =
135
+
136
+ * New: support for WooCommerce 5.7
137
+ * Update: YITH plugin framework
138
+
139
  = Version 2.0.16 - Released: 19 August 2021 =
140
 
141
  * New: support for WooCommerce 5.6
440
 
441
  == Upgrade Notice ==
442
 
443
+ Last Stable Tag 2.1.0
444
 
445
  == Suggestions ==
446