Version Description
Download this release
Release Info
Developer | yithemes |
Plugin | YITH WooCommerce Zoom Magnifier |
Version | 1.2.6 |
Comparing to | |
See all releases |
Code changes from version 1.2.5 to 1.2.6
- README.txt +6 -2
- init.php +3 -3
- plugin-fw/assets/css/yit-plugin-panel.css +5 -0
- plugin-fw/languages/yith-plugin-fw-it_IT.mo +0 -0
- plugin-fw/languages/yith-plugin-fw-it_IT.po +3 -3
- plugin-fw/lib/yit-plugin-panel-wc.php +72 -1
- plugin-fw/yit-functions.php +62 -0
- templates/single-product/product-image-magnifier.php +1 -1
README.txt
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
Contributors: yithemes
|
4 |
Tags: zoom, magnifier, woocommerce, product image, themes, yit, e-commerce, shop, thumbnail, thumbnail slider, zoom image, carousel, image carousel
|
5 |
Requires at least: 3.5.1
|
6 |
-
Tested up to: 4.2.
|
7 |
-
Stable tag: 1.2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -59,6 +59,10 @@ The size of the Zoom Image is automatically setted. If you want to change these
|
|
59 |
|
60 |
== Changelog ==
|
61 |
|
|
|
|
|
|
|
|
|
62 |
= Version 1.2.5 - RELEASED: JUL 23, 2015 =
|
63 |
|
64 |
* Added: italian language.
|
3 |
Contributors: yithemes
|
4 |
Tags: zoom, magnifier, woocommerce, product image, themes, yit, e-commerce, shop, thumbnail, thumbnail slider, zoom image, carousel, image carousel
|
5 |
Requires at least: 3.5.1
|
6 |
+
Tested up to: 4.2.4
|
7 |
+
Stable tag: 1.2.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
59 |
|
60 |
== Changelog ==
|
61 |
|
62 |
+
= Version 1.2.6 - RELEASED: AUG 12, 2015 =
|
63 |
+
|
64 |
+
* Tweak: update YITH Plugin framework.
|
65 |
+
|
66 |
= Version 1.2.5 - RELEASED: JUL 23, 2015 =
|
67 |
|
68 |
* Added: italian language.
|
init.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: YITH WooCommerce Zoom Magnifier
|
4 |
* Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
|
5 |
* Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
|
6 |
-
* Version: 1.2.
|
7 |
* Author: Yithemes
|
8 |
* Author URI: http://yithemes.com/
|
9 |
* Text Domain: ywzm
|
@@ -11,7 +11,7 @@
|
|
11 |
*
|
12 |
* @author Your Inspiration Themes
|
13 |
* @package YITH WooCommerce Magnifier
|
14 |
-
* @version 1.2.
|
15 |
*/
|
16 |
/* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
|
17 |
|
@@ -65,7 +65,7 @@ if ( ! defined( 'YITH_YWZM_FREE_INIT' ) ) {
|
|
65 |
}
|
66 |
|
67 |
if ( ! defined( 'YITH_YWZM_VERSION' ) ) {
|
68 |
-
define( 'YITH_YWZM_VERSION', '1.2.
|
69 |
}
|
70 |
|
71 |
if ( ! defined( 'YITH_YWZM_FILE' ) ) {
|
3 |
* Plugin Name: YITH WooCommerce Zoom Magnifier
|
4 |
* Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
|
5 |
* Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
|
6 |
+
* Version: 1.2.6
|
7 |
* Author: Yithemes
|
8 |
* Author URI: http://yithemes.com/
|
9 |
* Text Domain: ywzm
|
11 |
*
|
12 |
* @author Your Inspiration Themes
|
13 |
* @package YITH WooCommerce Magnifier
|
14 |
+
* @version 1.2.6
|
15 |
*/
|
16 |
/* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
|
17 |
|
65 |
}
|
66 |
|
67 |
if ( ! defined( 'YITH_YWZM_VERSION' ) ) {
|
68 |
+
define( 'YITH_YWZM_VERSION', '1.2.6' );
|
69 |
}
|
70 |
|
71 |
if ( ! defined( 'YITH_YWZM_FILE' ) ) {
|
plugin-fw/assets/css/yit-plugin-panel.css
CHANGED
@@ -626,6 +626,11 @@
|
|
626 |
color: #45bbe6;
|
627 |
}
|
628 |
|
|
|
|
|
|
|
|
|
|
|
629 |
/* === Responsive === */
|
630 |
|
631 |
@media (max-width: 767px) {}
|
626 |
color: #45bbe6;
|
627 |
}
|
628 |
|
629 |
+
/* WooCommerce 2.4 Support */
|
630 |
+
.woocommerce table.form-table .colorpick{
|
631 |
+
width: 6em;
|
632 |
+
}
|
633 |
+
|
634 |
/* === Responsive === */
|
635 |
|
636 |
@media (max-width: 767px) {}
|
plugin-fw/languages/yith-plugin-fw-it_IT.mo
CHANGED
Binary file
|
plugin-fw/languages/yith-plugin-fw-it_IT.po
CHANGED
@@ -5,14 +5,14 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH Plugin Starter 1.0.0 Plugin FW\n"
|
6 |
"Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
|
7 |
"POT-Creation-Date: 2015-05-11 17:13+0100\n"
|
8 |
-
"PO-Revision-Date: 2015-
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <info@yithemes.com>\n"
|
11 |
"Language: en\n"
|
12 |
"MIME-Version: 1.0\n"
|
13 |
"Content-Type: text/plain; charset=utf-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
15 |
-
"X-Generator: Poedit 1.
|
16 |
"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
|
17 |
"_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
|
18 |
"esc_html_x:1,2c\n"
|
@@ -233,7 +233,7 @@ msgstr "Impostazioni plugin"
|
|
233 |
|
234 |
#: lib/yit-plugin-panel.php:95 lib/yit-plugin-subpanel.php:101
|
235 |
msgid "YIT Plugins"
|
236 |
-
msgstr "
|
237 |
|
238 |
#: lib/yit-plugin-panel.php:292 lib/yit-plugin-subpanel.php:142
|
239 |
#: templates/panel/woocommerce/woocommerce-form.php:5
|
5 |
"Project-Id-Version: YITH Plugin Starter 1.0.0 Plugin FW\n"
|
6 |
"Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
|
7 |
"POT-Creation-Date: 2015-05-11 17:13+0100\n"
|
8 |
+
"PO-Revision-Date: 2015-07-24 16:13+0100\n"
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <info@yithemes.com>\n"
|
11 |
"Language: en\n"
|
12 |
"MIME-Version: 1.0\n"
|
13 |
"Content-Type: text/plain; charset=utf-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
15 |
+
"X-Generator: Poedit 1.8\n"
|
16 |
"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
|
17 |
"_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
|
18 |
"esc_html_x:1,2c\n"
|
233 |
|
234 |
#: lib/yit-plugin-panel.php:95 lib/yit-plugin-subpanel.php:101
|
235 |
msgid "YIT Plugins"
|
236 |
+
msgstr "YIT Plugins"
|
237 |
|
238 |
#: lib/yit-plugin-panel.php:292 lib/yit-plugin-subpanel.php:142
|
239 |
#: templates/panel/woocommerce/woocommerce-form.php:5
|
plugin-fw/lib/yit-plugin-panel-wc.php
CHANGED
@@ -37,6 +37,11 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
37 |
*/
|
38 |
public $settings = array();
|
39 |
|
|
|
|
|
|
|
|
|
|
|
40 |
/**
|
41 |
* @var array
|
42 |
*/
|
@@ -51,6 +56,14 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
51 |
*/
|
52 |
public function __construct( $args = array() ) {
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
if ( ! empty( $args ) ) {
|
55 |
$this->settings = $args;
|
56 |
$this->_tabs_path_files = $this->get_tabs_path_files();
|
@@ -64,10 +77,14 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
64 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
65 |
add_action( 'admin_init', array( $this, 'woocommerce_update_options' ) );
|
66 |
add_filter( 'woocommerce_screen_ids', array( $this, 'add_allowed_screen_id' ) );
|
|
|
67 |
|
68 |
/* Add VideoBox and InfoBox */
|
69 |
add_action( 'woocommerce_admin_field_boxinfo', array( $this, 'add_infobox' ), 10, 1 );
|
70 |
add_action( 'woocommerce_admin_field_videobox', array( $this, 'add_videobox' ), 10, 1 );
|
|
|
|
|
|
|
71 |
}
|
72 |
}
|
73 |
|
@@ -251,6 +268,16 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
251 |
$yit_options = $this->get_main_array_options();
|
252 |
$current_tab = $this->get_current_tab();
|
253 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
woocommerce_update_options( $yit_options[ $current_tab ] );
|
255 |
|
256 |
do_action( 'yit_panel_wc_after_update' );
|
@@ -320,7 +347,6 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
320 |
} else {
|
321 |
add_option($value['id'], $default_value);
|
322 |
}
|
323 |
-
|
324 |
}
|
325 |
|
326 |
}
|
@@ -328,6 +354,51 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
328 |
|
329 |
}
|
330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
|
332 |
}
|
333 |
}
|
37 |
*/
|
38 |
public $settings = array();
|
39 |
|
40 |
+
/**
|
41 |
+
* @var array a setting list of parameters
|
42 |
+
*/
|
43 |
+
public $wc_type = array();
|
44 |
+
|
45 |
/**
|
46 |
* @var array
|
47 |
*/
|
56 |
*/
|
57 |
public function __construct( $args = array() ) {
|
58 |
|
59 |
+
$this->wc_type = array(
|
60 |
+
'checkbox',
|
61 |
+
'textarea',
|
62 |
+
'multiselect',
|
63 |
+
'multi_select_countries',
|
64 |
+
'image_width'
|
65 |
+
);
|
66 |
+
|
67 |
if ( ! empty( $args ) ) {
|
68 |
$this->settings = $args;
|
69 |
$this->_tabs_path_files = $this->get_tabs_path_files();
|
77 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
78 |
add_action( 'admin_init', array( $this, 'woocommerce_update_options' ) );
|
79 |
add_filter( 'woocommerce_screen_ids', array( $this, 'add_allowed_screen_id' ) );
|
80 |
+
add_filter( 'woocommerce_admin_settings_sanitize_option', array( $this, 'maybe_unserialize_panel_data' ), 10, 3 );
|
81 |
|
82 |
/* Add VideoBox and InfoBox */
|
83 |
add_action( 'woocommerce_admin_field_boxinfo', array( $this, 'add_infobox' ), 10, 1 );
|
84 |
add_action( 'woocommerce_admin_field_videobox', array( $this, 'add_videobox' ), 10, 1 );
|
85 |
+
|
86 |
+
/* WooCommerce 2.4 Support */
|
87 |
+
add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );
|
88 |
}
|
89 |
}
|
90 |
|
268 |
$yit_options = $this->get_main_array_options();
|
269 |
$current_tab = $this->get_current_tab();
|
270 |
|
271 |
+
if( version_compare( WC()->version, '2.4.0', '>=' ) ) {
|
272 |
+
if ( ! empty( $yit_options[ $current_tab ] ) ) {
|
273 |
+
foreach ( $yit_options[ $current_tab ] as $option ) {
|
274 |
+
if ( isset( $option['id'] ) && isset( $_POST[ $option['id'] ] ) && isset( $option['type' ] ) && ! in_array( $option['type'], $this->wc_type ) ) {
|
275 |
+
$_POST[ $option['id'] ] = maybe_serialize( $_POST[ $option['id'] ] );
|
276 |
+
}
|
277 |
+
}
|
278 |
+
}
|
279 |
+
}
|
280 |
+
|
281 |
woocommerce_update_options( $yit_options[ $current_tab ] );
|
282 |
|
283 |
do_action( 'yit_panel_wc_after_update' );
|
347 |
} else {
|
348 |
add_option($value['id'], $default_value);
|
349 |
}
|
|
|
350 |
}
|
351 |
|
352 |
}
|
354 |
|
355 |
}
|
356 |
|
357 |
+
/**
|
358 |
+
* Add the woocommerce body class in plugin panel page
|
359 |
+
*
|
360 |
+
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
361 |
+
* @since 2.0
|
362 |
+
* @param $classes The body classes
|
363 |
+
*
|
364 |
+
* @return array Filtered body classes
|
365 |
+
*/
|
366 |
+
public function admin_body_class( $admin_body_classes ){
|
367 |
+
$admin_body_classes .= ' woocommerce ';
|
368 |
+
return $admin_body_classes;
|
369 |
+
}
|
370 |
+
|
371 |
+
/**
|
372 |
+
* Maybe unserialize panel data
|
373 |
+
*
|
374 |
+
* @param $value mixed Option value
|
375 |
+
* @param $option mixed Option settings array
|
376 |
+
* @param $raw_value string Raw option value
|
377 |
+
*
|
378 |
+
* @return mixed Filtered return value
|
379 |
+
* @author Antonio La Rocca <antonio.larocca@yithemes.com>
|
380 |
+
* @since 2.0
|
381 |
+
*/
|
382 |
+
public function maybe_unserialize_panel_data( $value, $option, $raw_value ) {
|
383 |
+
|
384 |
+
|
385 |
+
if( ! version_compare( WC()->version, '2.4.0', '>=' ) || ! isset( $option['type' ] ) || in_array( $option['type'], $this->wc_type ) ) {
|
386 |
+
return $value;
|
387 |
+
}
|
388 |
+
|
389 |
+
$yit_options = $this->get_main_array_options();
|
390 |
+
$current_tab = $this->get_current_tab();
|
391 |
+
|
392 |
+
if( ! empty( $yit_options[ $current_tab ] ) ){
|
393 |
+
foreach( $yit_options[ $current_tab ] as $option_array ){
|
394 |
+
if( isset( $option_array['id'] ) && isset( $option['id'] ) && $option_array['id'] == $option['id'] ){
|
395 |
+
return maybe_unserialize( $value );
|
396 |
+
}
|
397 |
+
}
|
398 |
+
}
|
399 |
+
|
400 |
+
return $value;
|
401 |
+
}
|
402 |
|
403 |
}
|
404 |
}
|
plugin-fw/yit-functions.php
CHANGED
@@ -818,4 +818,66 @@ if ( ! function_exists( 'yit_load_js_file' ) ) {
|
|
818 |
|
819 |
return $filename;
|
820 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
821 |
}
|
818 |
|
819 |
return $filename;
|
820 |
}
|
821 |
+
}
|
822 |
+
|
823 |
+
if ( ! function_exists( 'yit_wpml_register_string' ) ) {
|
824 |
+
/**
|
825 |
+
* Register a string in wpml trnslation
|
826 |
+
*
|
827 |
+
* @param $contenxt context name
|
828 |
+
* @param $name string name
|
829 |
+
* @param $value value to translate
|
830 |
+
*
|
831 |
+
* @since 2.0.0
|
832 |
+
* @author Andrea Frascaspata <andrea.frascaspata@yithemes.com>
|
833 |
+
*/
|
834 |
+
function yit_wpml_register_string( $contenxt , $name , $value ) {
|
835 |
+
// wpml string translation
|
836 |
+
do_action( 'wpml_register_single_string', $contenxt, $name, $value );
|
837 |
+
}
|
838 |
+
}
|
839 |
+
|
840 |
+
if ( ! function_exists( 'yit_wpml_string_translate' ) ) {
|
841 |
+
/**
|
842 |
+
* Get a string translation
|
843 |
+
*
|
844 |
+
* @param $contenxt context name
|
845 |
+
* @param $name string name
|
846 |
+
* @param $default_value value to translate
|
847 |
+
*
|
848 |
+
* @return string the string translated
|
849 |
+
* @since 2.0.0
|
850 |
+
* @author Andrea Frascaspata <andrea.frascaspata@yithemes.com>
|
851 |
+
*/
|
852 |
+
function yit_wpml_string_translate( $contenxt, $name, $default_value ) {
|
853 |
+
return apply_filters( 'wpml_translate_single_string', $default_value, $contenxt, $name );
|
854 |
+
}
|
855 |
+
|
856 |
+
}
|
857 |
+
|
858 |
+
if ( ! function_exists( 'yit_wpml_object_id' ) ) {
|
859 |
+
/**
|
860 |
+
* Get id of post translation in current language
|
861 |
+
*
|
862 |
+
* @param int $element_id
|
863 |
+
* @param string $element_type
|
864 |
+
* @param bool $return_original_if_missing
|
865 |
+
* @param null|string $ulanguage_code
|
866 |
+
*
|
867 |
+
* @return int the translation id
|
868 |
+
* @since 2.0.0
|
869 |
+
* @author Antonio La Rocca <antonio.larocca@yithemes.com>
|
870 |
+
*/
|
871 |
+
function yit_wpml_object_id( $element_id, $element_type = 'post', $return_original_if_missing = false, $ulanguage_code = null ) {
|
872 |
+
if( function_exists( 'wpml_object_id' ) ){
|
873 |
+
return wpml_object_id( $element_id, $element_type, $return_original_if_missing, $ulanguage_code );
|
874 |
+
}
|
875 |
+
elseif( function_exists( 'icl_object_id' ) ){
|
876 |
+
return icl_object_id( $element_id, $element_type, $return_original_if_missing, $ulanguage_code );
|
877 |
+
}
|
878 |
+
else{
|
879 |
+
return $element_id;
|
880 |
+
}
|
881 |
+
}
|
882 |
+
|
883 |
}
|
templates/single-product/product-image-magnifier.php
CHANGED
@@ -93,4 +93,4 @@ if ( ! isset( $slider_items ) || ( $slider_items == null ) ) {
|
|
93 |
phoneBehavior: '<?php echo get_option('yith_wcmg_zoom_mobile_position') ?>',
|
94 |
loadingLabel: '<?php echo stripslashes(get_option('yith_wcmg_loading_label')) ?>'
|
95 |
};
|
96 |
-
</script>
|
93 |
phoneBehavior: '<?php echo get_option('yith_wcmg_zoom_mobile_position') ?>',
|
94 |
loadingLabel: '<?php echo stripslashes(get_option('yith_wcmg_loading_label')) ?>'
|
95 |
};
|
96 |
+
</script>
|