Version Description
Download this release
Release Info
Developer | yithemes |
Plugin | YITH WooCommerce Zoom Magnifier |
Version | 1.2.10 |
Comparing to | |
See all releases |
Code changes from version 1.2.9 to 1.2.10
- README.txt +5 -1
- assets/js/frontend.js +3 -3
- assets/js/yith_magnifier.js +6 -5
- class.yith-wcmg-admin.php +2 -2
- class.yith-wcmg.php +1 -1
- init.php +7 -7
- languages/{ywzm-it_IT.mo → yith-woocommerce-zoom-magnifier-it_IT.mo} +0 -0
- languages/{ywzm-it_IT.po → yith-woocommerce-zoom-magnifier-it_IT.po} +0 -0
- languages/{ywzm.pot → yith-woocommerce-zoom-magnifier.pot} +0 -0
- lib/class.yith-woocommerce-zoom-magnifier.php +1 -1
- lib/class.yith-ywzm-plugin-fw-loader.php +10 -10
- plugin-fw/lib/yit-cpt-unlimited.php +1 -1
- plugin-fw/lib/yit-metabox.php +135 -121
- plugin-fw/lib/yit-plugin-panel-wc.php +3 -3
- plugin-fw/lib/yit-plugin-panel.php +2 -1
- plugin-fw/lib/yit-upgrade.php +5 -4
- plugin-fw/templates/metaboxes/types/categories.php +1 -1
- plugin-fw/templates/panel/woocommerce/woocommerce-form.php +1 -0
- plugin-options/general-options.php +47 -47
- templates/admin/premium.php +11 -11
README.txt
CHANGED
@@ -4,7 +4,7 @@ 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.3
|
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.9 - RELEASED: SEP 04, 2015 =
|
63 |
|
64 |
* Updated: Languages file
|
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.3
|
7 |
+
Stable tag: 1.2.10
|
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.10 - RELEASED: SEP 24, 2015 =
|
63 |
+
|
64 |
+
* Updated: changed text domain as translate.wordpress.org requisite.
|
65 |
+
|
66 |
= Version 1.2.9 - RELEASED: SEP 04, 2015 =
|
67 |
|
68 |
* Updated: Languages file
|
assets/js/frontend.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
*
|
4 |
* @author Your Inspiration Themes
|
5 |
* @package YITH WooCommerce Zoom Magnifier
|
6 |
-
* @version 1.2.
|
7 |
*/
|
8 |
jQuery(document).ready(function ($) {
|
9 |
|
@@ -14,7 +14,7 @@ jQuery(document).ready(function ($) {
|
|
14 |
var yith_wcmg_default_zoom = yith_wcmg.find('.yith_magnifier_zoom').attr('href');
|
15 |
var yith_wcmg_default_image = yith_wcmg.find('.yith_magnifier_zoom img').attr('src');
|
16 |
|
17 |
-
yith_wcmg.yith_magnifier(yith_magnifier_options);
|
18 |
|
19 |
$(document).on('found_variation', 'form.variations_form', function (event, variation) {
|
20 |
var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
|
@@ -41,7 +41,7 @@ jQuery(document).ready(function ($) {
|
|
41 |
}
|
42 |
|
43 |
yith_wcmg.yith_magnifier(yith_magnifier_options);
|
44 |
-
})
|
45 |
|
46 |
$('form.variations_form .variations select').trigger('change');
|
47 |
});
|
3 |
*
|
4 |
* @author Your Inspiration Themes
|
5 |
* @package YITH WooCommerce Zoom Magnifier
|
6 |
+
* @version 1.2.10
|
7 |
*/
|
8 |
jQuery(document).ready(function ($) {
|
9 |
|
14 |
var yith_wcmg_default_zoom = yith_wcmg.find('.yith_magnifier_zoom').attr('href');
|
15 |
var yith_wcmg_default_image = yith_wcmg.find('.yith_magnifier_zoom img').attr('src');
|
16 |
|
17 |
+
//yith_wcmg.yith_magnifier(yith_magnifier_options);
|
18 |
|
19 |
$(document).on('found_variation', 'form.variations_form', function (event, variation) {
|
20 |
var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
|
41 |
}
|
42 |
|
43 |
yith_wcmg.yith_magnifier(yith_magnifier_options);
|
44 |
+
});
|
45 |
|
46 |
$('form.variations_form .variations select').trigger('change');
|
47 |
});
|
assets/js/yith_magnifier.js
CHANGED
@@ -190,7 +190,6 @@
|
|
190 |
};
|
191 |
|
192 |
$.yith_magnifier.prototype = {
|
193 |
-
|
194 |
/**
|
195 |
* Let's start the magnifier
|
196 |
*
|
@@ -285,10 +284,10 @@
|
|
285 |
|
286 |
if (this.options.loadingLabel) {
|
287 |
$('<div class="yith_magnifier_loading">' + this.options.loadingLabel + '</div>').css({
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
}
|
293 |
}
|
294 |
},
|
@@ -327,6 +326,8 @@
|
|
327 |
self._initTrap();
|
328 |
});
|
329 |
}
|
|
|
|
|
330 |
},
|
331 |
|
332 |
/**
|
190 |
};
|
191 |
|
192 |
$.yith_magnifier.prototype = {
|
|
|
193 |
/**
|
194 |
* Let's start the magnifier
|
195 |
*
|
284 |
|
285 |
if (this.options.loadingLabel) {
|
286 |
$('<div class="yith_magnifier_loading">' + this.options.loadingLabel + '</div>').css({
|
287 |
+
'width': w,
|
288 |
+
'text-align': 'center',
|
289 |
+
opacity: .5
|
290 |
+
}).appendTo(this.options.elements.zoom.parent());
|
291 |
}
|
292 |
}
|
293 |
},
|
326 |
self._initTrap();
|
327 |
});
|
328 |
}
|
329 |
+
|
330 |
+
$(document).trigger('yith_magnifier_after_init_zoom')
|
331 |
},
|
332 |
|
333 |
/**
|
class.yith-wcmg-admin.php
CHANGED
@@ -87,8 +87,8 @@ if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
|
|
87 |
unset( $settings[count( $settings ) - 1] );
|
88 |
|
89 |
$settings[] = array(
|
90 |
-
'name' => __( 'Image Size', '
|
91 |
-
'desc' => __( 'The size of the images used within the magnifier box', '
|
92 |
'id' => 'woocommerce_magnifier_image',
|
93 |
'css' => '',
|
94 |
'type' => 'image_width',
|
87 |
unset( $settings[count( $settings ) - 1] );
|
88 |
|
89 |
$settings[] = array(
|
90 |
+
'name' => __( 'Image Size', 'yith-woocommerce-zoom-magnifier' ),
|
91 |
+
'desc' => __( 'The size of the images used within the magnifier box', 'yith-woocommerce-zoom-magnifier' ),
|
92 |
'id' => 'woocommerce_magnifier_image',
|
93 |
'css' => '',
|
94 |
'type' => 'image_width',
|
class.yith-wcmg.php
CHANGED
@@ -22,7 +22,7 @@ if( !class_exists( 'YITH_WCMG' ) ) {
|
|
22 |
* @var string
|
23 |
* @since 1.0.0
|
24 |
*/
|
25 |
-
public $version = '1.2.
|
26 |
|
27 |
/**
|
28 |
* Plugin object
|
22 |
* @var string
|
23 |
* @since 1.0.0
|
24 |
*/
|
25 |
+
public $version = '1.2.10';
|
26 |
|
27 |
/**
|
28 |
* Plugin object
|
init.php
CHANGED
@@ -3,15 +3,15 @@
|
|
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:
|
10 |
* Domain Path: /languages/
|
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 |
|
@@ -40,7 +40,7 @@ if ( ! function_exists( 'is_plugin_active' ) ) {
|
|
40 |
function yith_ywzm_install_woocommerce_admin_notice() {
|
41 |
?>
|
42 |
<div class="error">
|
43 |
-
<p><?php _e( 'YITH WooCommerce Zoom Magnifier is enabled but not effective. It requires WooCommerce in order to work.', '
|
44 |
</div>
|
45 |
<?php
|
46 |
}
|
@@ -49,7 +49,7 @@ function yith_ywzm_install_woocommerce_admin_notice() {
|
|
49 |
function yith_ywzm_install_free_admin_notice() {
|
50 |
?>
|
51 |
<div class="error">
|
52 |
-
<p><?php _e( 'You can\'t activate the free version of YITH WooCommerce Zoom Magnifier while you are using the premium one.', '
|
53 |
</div>
|
54 |
<?php
|
55 |
}
|
@@ -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' ) ) {
|
@@ -110,7 +110,7 @@ function yith_ywzm_init() {
|
|
110 |
/**
|
111 |
* Load text domain and start plugin
|
112 |
*/
|
113 |
-
load_plugin_textdomain( '
|
114 |
|
115 |
add_option( 'yith_wcmg_slider_direction', apply_filters( 'yith_wcmg_slider_direction', 'left' ) );
|
116 |
|
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.10
|
7 |
* Author: Yithemes
|
8 |
* Author URI: http://yithemes.com/
|
9 |
+
* Text Domain: yith-woocommerce-zoom-magnifier
|
10 |
* Domain Path: /languages/
|
11 |
*
|
12 |
* @author Your Inspiration Themes
|
13 |
* @package YITH WooCommerce Magnifier
|
14 |
+
* @version 1.2.10
|
15 |
*/
|
16 |
/* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
|
17 |
|
40 |
function yith_ywzm_install_woocommerce_admin_notice() {
|
41 |
?>
|
42 |
<div class="error">
|
43 |
+
<p><?php _e( 'YITH WooCommerce Zoom Magnifier is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-zoom-magnifier' ); ?></p>
|
44 |
</div>
|
45 |
<?php
|
46 |
}
|
49 |
function yith_ywzm_install_free_admin_notice() {
|
50 |
?>
|
51 |
<div class="error">
|
52 |
+
<p><?php _e( 'You can\'t activate the free version of YITH WooCommerce Zoom Magnifier while you are using the premium one.', 'yith-woocommerce-zoom-magnifier' ); ?></p>
|
53 |
</div>
|
54 |
<?php
|
55 |
}
|
65 |
}
|
66 |
|
67 |
if ( ! defined( 'YITH_YWZM_VERSION' ) ) {
|
68 |
+
define( 'YITH_YWZM_VERSION', '1.2.10' );
|
69 |
}
|
70 |
|
71 |
if ( ! defined( 'YITH_YWZM_FILE' ) ) {
|
110 |
/**
|
111 |
* Load text domain and start plugin
|
112 |
*/
|
113 |
+
load_plugin_textdomain( 'yith-woocommerce-zoom-magnifier', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
114 |
|
115 |
add_option( 'yith_wcmg_slider_direction', apply_filters( 'yith_wcmg_slider_direction', 'left' ) );
|
116 |
|
languages/{ywzm-it_IT.mo → yith-woocommerce-zoom-magnifier-it_IT.mo}
RENAMED
File without changes
|
languages/{ywzm-it_IT.po → yith-woocommerce-zoom-magnifier-it_IT.po}
RENAMED
File without changes
|
languages/{ywzm.pot → yith-woocommerce-zoom-magnifier.pot}
RENAMED
File without changes
|
lib/class.yith-woocommerce-zoom-magnifier.php
CHANGED
@@ -25,7 +25,7 @@ if ( ! class_exists( 'YITH_WooCommerce_Zoom_Magnifier' ) ) {
|
|
25 |
* @var string
|
26 |
* @since 1.0.0
|
27 |
*/
|
28 |
-
public $version = '1.2.
|
29 |
|
30 |
/**
|
31 |
* Plugin object
|
25 |
* @var string
|
26 |
* @since 1.0.0
|
27 |
*/
|
28 |
+
public $version = '1.2.10';
|
29 |
|
30 |
/**
|
31 |
* Plugin object
|
lib/class.yith-ywzm-plugin-fw-loader.php
CHANGED
@@ -121,12 +121,12 @@ if ( ! class_exists( 'YITH_YWZM_Plugin_FW_Loader' ) ) {
|
|
121 |
return;
|
122 |
}
|
123 |
|
124 |
-
$admin_tabs['general'] = __( 'General', '
|
125 |
|
126 |
if ( ! defined( 'YITH_YWZM_PREMIUM' ) ) {
|
127 |
-
$admin_tabs['premium-landing'] = __( 'Premium Version', '
|
128 |
} else {
|
129 |
-
$admin_tabs['exclusions'] = __( 'Product exclusion list', '
|
130 |
}
|
131 |
|
132 |
$args = array(
|
@@ -185,10 +185,10 @@ if ( ! class_exists( 'YITH_YWZM_Plugin_FW_Loader' ) ) {
|
|
185 |
* @use plugin_action_links_{$plugin_file_name}
|
186 |
*/
|
187 |
public function action_links( $links ) {
|
188 |
-
$links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', '
|
189 |
|
190 |
if ( defined( 'YITH_YWZM_FREE_INIT' ) ) {
|
191 |
-
$links[] = '<a href="' . $this->_premium_landing . '" target="_blank">' . __( 'Premium Version', '
|
192 |
}
|
193 |
|
194 |
return $links;
|
@@ -213,7 +213,7 @@ if ( ! class_exists( 'YITH_YWZM_Plugin_FW_Loader' ) ) {
|
|
213 |
if ( ( defined( 'YITH_YWZM_INIT' ) && ( YITH_YWZM_INIT == $plugin_file ) ) ||
|
214 |
( defined( 'YITH_YWZM_FREE_INIT' ) && ( YITH_YWZM_FREE_INIT == $plugin_file ) )
|
215 |
) {
|
216 |
-
$plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', '
|
217 |
}
|
218 |
|
219 |
return $plugin_meta;
|
@@ -226,16 +226,16 @@ if ( ! class_exists( 'YITH_YWZM_Plugin_FW_Loader' ) ) {
|
|
226 |
|
227 |
$premium_message = defined( 'YITH_YWZM_PREMIUM' )
|
228 |
? ''
|
229 |
-
: __( 'YITH WooCommerce Zoom Magnifier is available in an outstanding PREMIUM version with many new options, discover it now.', '
|
230 |
-
' <a href="' . $this->_premium_landing . '">' . __( 'Premium version', '
|
231 |
|
232 |
$args[] = array(
|
233 |
'screen_id' => 'plugins',
|
234 |
'pointer_id' => 'yith_woocommerce_zoom-magnifier',
|
235 |
'target' => '#toplevel_page_yit_plugin_panel',
|
236 |
'content' => sprintf( '<h3> %s </h3> <p> %s </p>',
|
237 |
-
__( 'YITH WooCommerce Zoom Magnifier', '
|
238 |
-
__( 'In YIT Plugins tab you can find YITH WooCommerce Zoom Magnifier options.<br> From this menu you can access all settings of the YITH plugins activated.', '
|
239 |
),
|
240 |
'position' => array( 'edge' => 'left', 'align' => 'center' ),
|
241 |
'init' => defined( 'YITH_YWZM_PREMIUM' ) ? YITH_YWZM_INIT : YITH_YWZM_FREE_INIT
|
121 |
return;
|
122 |
}
|
123 |
|
124 |
+
$admin_tabs['general'] = __( 'General', 'yith-woocommerce-zoom-magnifier' );
|
125 |
|
126 |
if ( ! defined( 'YITH_YWZM_PREMIUM' ) ) {
|
127 |
+
$admin_tabs['premium-landing'] = __( 'Premium Version', 'yith-woocommerce-zoom-magnifier' );
|
128 |
} else {
|
129 |
+
$admin_tabs['exclusions'] = __( 'Product exclusion list', 'yith-woocommerce-zoom-magnifier' );
|
130 |
}
|
131 |
|
132 |
$args = array(
|
185 |
* @use plugin_action_links_{$plugin_file_name}
|
186 |
*/
|
187 |
public function action_links( $links ) {
|
188 |
+
$links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'yith-woocommerce-zoom-magnifier' ) . '</a>';
|
189 |
|
190 |
if ( defined( 'YITH_YWZM_FREE_INIT' ) ) {
|
191 |
+
$links[] = '<a href="' . $this->_premium_landing . '" target="_blank">' . __( 'Premium Version', 'yith-woocommerce-zoom-magnifier' ) . '</a>';
|
192 |
}
|
193 |
|
194 |
return $links;
|
213 |
if ( ( defined( 'YITH_YWZM_INIT' ) && ( YITH_YWZM_INIT == $plugin_file ) ) ||
|
214 |
( defined( 'YITH_YWZM_FREE_INIT' ) && ( YITH_YWZM_FREE_INIT == $plugin_file ) )
|
215 |
) {
|
216 |
+
$plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith-woocommerce-zoom-magnifier' ) . '</a>';
|
217 |
}
|
218 |
|
219 |
return $plugin_meta;
|
226 |
|
227 |
$premium_message = defined( 'YITH_YWZM_PREMIUM' )
|
228 |
? ''
|
229 |
+
: __( 'YITH WooCommerce Zoom Magnifier is available in an outstanding PREMIUM version with many new options, discover it now.', 'yith-woocommerce-zoom-magnifier' ) .
|
230 |
+
' <a href="' . $this->_premium_landing . '">' . __( 'Premium version', 'yith-woocommerce-zoom-magnifier' ) . '</a>';
|
231 |
|
232 |
$args[] = array(
|
233 |
'screen_id' => 'plugins',
|
234 |
'pointer_id' => 'yith_woocommerce_zoom-magnifier',
|
235 |
'target' => '#toplevel_page_yit_plugin_panel',
|
236 |
'content' => sprintf( '<h3> %s </h3> <p> %s </p>',
|
237 |
+
__( 'YITH WooCommerce Zoom Magnifier', 'yith-woocommerce-zoom-magnifier' ),
|
238 |
+
__( 'In YIT Plugins tab you can find YITH WooCommerce Zoom Magnifier options.<br> From this menu you can access all settings of the YITH plugins activated.', 'yith-woocommerce-zoom-magnifier' ) . '<br>' . $premium_message
|
239 |
),
|
240 |
'position' => array( 'edge' => 'left', 'align' => 'center' ),
|
241 |
'init' => defined( 'YITH_YWZM_PREMIUM' ) ? YITH_YWZM_INIT : YITH_YWZM_FREE_INIT
|
plugin-fw/lib/yit-cpt-unlimited.php
CHANGED
@@ -1049,7 +1049,7 @@ class YIT_CPT_Unlimited {
|
|
1049 |
'fields' => apply_filters( 'yit_cptu_fields', array(
|
1050 |
'type' => array(
|
1051 |
'label' => __( 'Type', 'yith-plugin-fw' ),
|
1052 |
-
'desc' => __( 'Layout for this '
|
1053 |
'type' => 'select',
|
1054 |
'options' => isset( $layouts ) ? $layouts : array(),
|
1055 |
'std' => '' ),
|
1049 |
'fields' => apply_filters( 'yit_cptu_fields', array(
|
1050 |
'type' => array(
|
1051 |
'label' => __( 'Type', 'yith-plugin-fw' ),
|
1052 |
+
'desc' => sprintf( __( 'Layout for this %s' , 'yith-plugin-fw' ), strtolower( $this->_labels['singular'] ) ),
|
1053 |
'type' => 'select',
|
1054 |
'options' => isset( $layouts ) ? $layouts : array(),
|
1055 |
'std' => '' ),
|
plugin-fw/lib/yit-metabox.php
CHANGED
@@ -9,11 +9,11 @@
|
|
9 |
*/
|
10 |
|
11 |
|
12 |
-
if (
|
13 |
exit;
|
14 |
} // Exit if accessed directly
|
15 |
|
16 |
-
if (
|
17 |
/**
|
18 |
* YIT Metabox
|
19 |
*
|
@@ -48,8 +48,8 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
48 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.com>
|
49 |
*
|
50 |
*/
|
51 |
-
|
52 |
-
|
53 |
|
54 |
/**
|
55 |
* @var string the id of metabox
|
@@ -91,9 +91,10 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
91 |
* @since 1.0
|
92 |
* @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
|
93 |
*/
|
94 |
-
public static function instance(
|
95 |
-
|
96 |
-
|
|
|
97 |
}
|
98 |
return self::$_instance[$id];
|
99 |
}
|
@@ -107,7 +108,8 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
107 |
* @since 1.0
|
108 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
109 |
*/
|
110 |
-
function __construct(
|
|
|
111 |
$this->id = $id;
|
112 |
|
113 |
}
|
@@ -124,15 +126,16 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
124 |
* @since 1.0
|
125 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
126 |
*/
|
127 |
-
public function init(
|
|
|
128 |
|
129 |
-
$this->set_options(
|
130 |
$this->set_tabs();
|
131 |
|
132 |
|
133 |
-
add_action(
|
134 |
-
add_action(
|
135 |
-
add_action(
|
136 |
|
137 |
}
|
138 |
|
@@ -145,18 +148,19 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
145 |
* @since 1.0
|
146 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
147 |
*/
|
148 |
-
public function enqueue()
|
|
|
149 |
|
150 |
wp_enqueue_media();
|
151 |
-
wp_enqueue_style(
|
152 |
-
wp_enqueue_style(
|
153 |
-
wp_enqueue_style(
|
154 |
-
wp_enqueue_script(
|
155 |
-
wp_enqueue_script(
|
156 |
-
wp_enqueue_script(
|
157 |
-
wp_enqueue_script(
|
158 |
-
wp_enqueue_script(
|
159 |
-
wp_enqueue_style(
|
160 |
|
161 |
|
162 |
}
|
@@ -172,7 +176,8 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
172 |
* @since 1.0
|
173 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
174 |
*/
|
175 |
-
public function set_options(
|
|
|
176 |
$this->options = $options;
|
177 |
|
178 |
}
|
@@ -188,13 +193,14 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
188 |
* @since 1.0
|
189 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
190 |
*/
|
191 |
-
public function set_tabs()
|
192 |
-
|
|
|
193 |
return;
|
194 |
}
|
195 |
-
$this->tabs = $this->options['tabs']
|
196 |
-
if(
|
197 |
-
$this->tabs['settings']['fields'] = array_filter(
|
198 |
}
|
199 |
}
|
200 |
|
@@ -206,32 +212,31 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
206 |
*
|
207 |
* @internal param array $tabs
|
208 |
*
|
209 |
-
* @param array
|
210 |
-
* @param string $where
|
211 |
-
* @param null
|
212 |
*
|
213 |
* @return void
|
214 |
* @since 1.0
|
215 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
216 |
*/
|
217 |
-
public function add_tab(
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
|
|
223 |
$tab +
|
224 |
-
array_slice(
|
225 |
-
}
|
226 |
-
|
227 |
-
$this->tabs = array_slice( $this->tabs, 0, $ref_pos, true ) +
|
228 |
$tab +
|
229 |
-
array_slice(
|
230 |
}
|
231 |
}
|
232 |
-
}
|
233 |
-
|
234 |
-
$this->tabs = array_merge( $tab, $this->tabs );
|
235 |
}
|
236 |
|
237 |
}
|
@@ -249,9 +254,10 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
249 |
* @since 1.0
|
250 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
251 |
*/
|
252 |
-
public function remove_tab(
|
253 |
-
|
254 |
-
|
|
|
255 |
}
|
256 |
}
|
257 |
|
@@ -264,40 +270,40 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
264 |
* @internal param array $tabs
|
265 |
*
|
266 |
* @param string $tab_id the id of the tabs where add the field
|
267 |
-
* @param array
|
268 |
-
* @param string $where
|
269 |
-
* @param null
|
270 |
*
|
271 |
* @return void
|
272 |
* @since 1.0
|
273 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
274 |
*/
|
275 |
-
public function add_field(
|
276 |
-
|
|
|
277 |
|
278 |
$cf = $this->tabs[$tab_id]['fields'];
|
279 |
-
if (
|
280 |
-
$ref_pos = array_search(
|
281 |
-
if (
|
282 |
-
if (
|
283 |
-
$this->tabs[$tab_id]['fields'] = array_slice(
|
284 |
$args +
|
285 |
-
array_slice(
|
286 |
|
287 |
-
} elseif (
|
288 |
-
$this->tabs[$tab_id]['fields'] = array_slice(
|
289 |
$args +
|
290 |
-
array_slice(
|
291 |
|
292 |
}
|
293 |
}
|
294 |
-
}
|
295 |
-
|
296 |
-
if ( $where == 'first' ) {
|
297 |
$this->tabs[$tab_id]['fields'] = $args + $cf;
|
298 |
|
299 |
} else {
|
300 |
-
$this->tabs[$tab_id]['fields'] = array_merge(
|
301 |
}
|
302 |
}
|
303 |
|
@@ -317,10 +323,11 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
317 |
* @since 1.0
|
318 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
319 |
*/
|
320 |
-
public function remove_field(
|
321 |
-
|
322 |
-
|
323 |
-
|
|
|
324 |
}
|
325 |
}
|
326 |
}
|
@@ -336,12 +343,13 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
336 |
* @since 1.0
|
337 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
338 |
*/
|
339 |
-
public function reorder_tabs()
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
$this->tabs[$tab_name]['fields'][$id_field]['
|
344 |
-
$this->tabs[$tab_name]['fields'][$id_field]['
|
|
|
345 |
}
|
346 |
}
|
347 |
|
@@ -360,11 +368,11 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
360 |
* @since 1.0
|
361 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
362 |
*/
|
363 |
-
public function get_option_metabox_id(
|
364 |
-
|
|
|
365 |
return '_' . $id_field;
|
366 |
-
}
|
367 |
-
else {
|
368 |
return $id_field;
|
369 |
}
|
370 |
}
|
@@ -381,16 +389,17 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
381 |
* @since 1.0
|
382 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
383 |
*/
|
384 |
-
public function get_option_metabox_name(
|
385 |
-
|
386 |
-
$
|
|
|
387 |
|
388 |
-
if (
|
389 |
return $return . $id_field . ']';
|
390 |
}
|
391 |
-
$return .= substr(
|
392 |
$return .= ']';
|
393 |
-
$return .= substr(
|
394 |
|
395 |
return $return;
|
396 |
}
|
@@ -405,9 +414,10 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
405 |
* @since 1.0
|
406 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
407 |
*/
|
408 |
-
public function register_metabox(
|
409 |
-
|
410 |
-
|
|
|
411 |
}
|
412 |
}
|
413 |
|
@@ -421,10 +431,11 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
421 |
* @since 1.0
|
422 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
423 |
*/
|
424 |
-
public function show()
|
|
|
425 |
$this->reorder_tabs();
|
426 |
|
427 |
-
yit_plugin_get_template(
|
428 |
}
|
429 |
|
430 |
/**
|
@@ -438,61 +449,62 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
438 |
* @since 1.0
|
439 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
440 |
*/
|
441 |
-
public function save_postdata(
|
|
|
442 |
|
443 |
|
444 |
-
|
445 |
-
if ( ! isset( $_POST['yit_metaboxes_nonce'] ) || ! wp_verify_nonce( $_POST['yit_metaboxes_nonce'], 'metaboxes-fields-nonce' ) ) {
|
446 |
return $post_id;
|
447 |
}
|
448 |
|
449 |
|
450 |
-
if (
|
451 |
return $post_id;
|
452 |
}
|
453 |
|
454 |
-
if (
|
455 |
$post_type = $_POST['post_type'];
|
456 |
-
}
|
457 |
-
else {
|
458 |
return $post_id;
|
459 |
}
|
460 |
|
461 |
-
if (
|
462 |
-
if (
|
463 |
return $post_id;
|
464 |
}
|
465 |
-
}
|
466 |
-
|
467 |
-
if ( ! current_user_can( 'edit_post', $post_id ) ) {
|
468 |
return $post_id;
|
469 |
}
|
470 |
}
|
471 |
|
|
|
|
|
|
|
|
|
472 |
$this->reorder_tabs();
|
473 |
|
474 |
|
475 |
-
foreach (
|
476 |
|
477 |
-
foreach (
|
478 |
|
479 |
-
if (
|
480 |
continue;
|
481 |
}
|
482 |
|
483 |
-
if (
|
484 |
|
485 |
-
add_post_meta(
|
486 |
-
}
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
else {
|
491 |
-
delete_post_meta( $post_id, $field['id'] );
|
492 |
}
|
493 |
}
|
494 |
}
|
495 |
|
|
|
496 |
}
|
497 |
|
498 |
/**
|
@@ -506,15 +518,16 @@ if ( ! class_exists( 'YIT_Metabox' ) ) {
|
|
506 |
* @since 2.0.0
|
507 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
508 |
*/
|
509 |
-
public function remove_fields(
|
510 |
-
|
511 |
-
|
|
|
512 |
}
|
513 |
}
|
514 |
}
|
515 |
}
|
516 |
|
517 |
-
if (
|
518 |
|
519 |
/**
|
520 |
* Main instance of plugin
|
@@ -527,8 +540,9 @@ if ( ! function_exists( 'YIT_Metabox' ) ) {
|
|
527 |
*/
|
528 |
|
529 |
|
530 |
-
function YIT_Metabox(
|
531 |
-
|
|
|
532 |
}
|
533 |
}
|
534 |
|
9 |
*/
|
10 |
|
11 |
|
12 |
+
if (!defined('ABSPATH')) {
|
13 |
exit;
|
14 |
} // Exit if accessed directly
|
15 |
|
16 |
+
if (!class_exists('YIT_Metabox')) {
|
17 |
/**
|
18 |
* YIT Metabox
|
19 |
*
|
48 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.com>
|
49 |
*
|
50 |
*/
|
51 |
+
class YIT_Metabox
|
52 |
+
{
|
53 |
|
54 |
/**
|
55 |
* @var string the id of metabox
|
91 |
* @since 1.0
|
92 |
* @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
|
93 |
*/
|
94 |
+
public static function instance($id)
|
95 |
+
{
|
96 |
+
if (!isset(self::$_instance[$id])) {
|
97 |
+
self::$_instance[$id] = new self($id);
|
98 |
}
|
99 |
return self::$_instance[$id];
|
100 |
}
|
108 |
* @since 1.0
|
109 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
110 |
*/
|
111 |
+
function __construct($id = '')
|
112 |
+
{
|
113 |
$this->id = $id;
|
114 |
|
115 |
}
|
126 |
* @since 1.0
|
127 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
128 |
*/
|
129 |
+
public function init($options = array())
|
130 |
+
{
|
131 |
|
132 |
+
$this->set_options($options);
|
133 |
$this->set_tabs();
|
134 |
|
135 |
|
136 |
+
add_action('add_meta_boxes', array($this, 'register_metabox'));
|
137 |
+
add_action('save_post', array($this, 'save_postdata'));
|
138 |
+
add_action('admin_enqueue_scripts', array($this, 'enqueue'), 15);
|
139 |
|
140 |
}
|
141 |
|
148 |
* @since 1.0
|
149 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
150 |
*/
|
151 |
+
public function enqueue()
|
152 |
+
{
|
153 |
|
154 |
wp_enqueue_media();
|
155 |
+
wp_enqueue_style('wp-color-picker');
|
156 |
+
wp_enqueue_style('yit-plugin-metaboxes', YIT_CORE_PLUGIN_URL . '/assets/css/metaboxes.css');
|
157 |
+
wp_enqueue_style('jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css');
|
158 |
+
wp_enqueue_script('jquery-ui-datepicker');
|
159 |
+
wp_enqueue_script('yit-spinner', YIT_CORE_PLUGIN_URL . '/assets/js/panel.spinner.js', array('jquery'), '0.0.1', true);
|
160 |
+
wp_enqueue_script('jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array('jquery'), '1.1.0', true);
|
161 |
+
wp_enqueue_script('ajax-chosen', yit_load_js_file(YIT_CORE_PLUGIN_URL . '/assets/js/chosen/ajax-chosen.jquery.js'), array('jquery'), '1.1.0', true);
|
162 |
+
wp_enqueue_script('yit-metabox', YIT_CORE_PLUGIN_URL . '/assets/js/metabox.js', array('jquery', 'wp-color-picker'), '1.0.0', true);
|
163 |
+
wp_enqueue_style('jquery-ui-overcast', YIT_CORE_PLUGIN_URL . '/assets/css/overcast/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all');
|
164 |
|
165 |
|
166 |
}
|
176 |
* @since 1.0
|
177 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
178 |
*/
|
179 |
+
public function set_options($options = array())
|
180 |
+
{
|
181 |
$this->options = $options;
|
182 |
|
183 |
}
|
193 |
* @since 1.0
|
194 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
195 |
*/
|
196 |
+
public function set_tabs()
|
197 |
+
{
|
198 |
+
if (!isset($this->options['tabs'])) {
|
199 |
return;
|
200 |
}
|
201 |
+
$this->tabs = $this->options['tabs'];
|
202 |
+
if (isset($this->tabs['settings']['fields'])) {
|
203 |
+
$this->tabs['settings']['fields'] = array_filter($this->tabs['settings']['fields']);
|
204 |
}
|
205 |
}
|
206 |
|
212 |
*
|
213 |
* @internal param array $tabs
|
214 |
*
|
215 |
+
* @param array $tab the new tab to add to the metabox
|
216 |
+
* @param string $where tell where insert the tab if after or before a $refer
|
217 |
+
* @param null $refer an existent tab inside metabox
|
218 |
*
|
219 |
* @return void
|
220 |
* @since 1.0
|
221 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
222 |
*/
|
223 |
+
public function add_tab($tab, $where = 'after', $refer = null)
|
224 |
+
{
|
225 |
+
if (!is_null($refer)) {
|
226 |
+
$ref_pos = array_search($refer, array_keys($this->tabs));
|
227 |
+
if ($ref_pos !== false) {
|
228 |
+
if ($where == 'after') {
|
229 |
+
$this->tabs = array_slice($this->tabs, 0, $ref_pos + 1, true) +
|
230 |
$tab +
|
231 |
+
array_slice($this->tabs, $ref_pos + 1, count($this->tabs) - 1, true);
|
232 |
+
} else {
|
233 |
+
$this->tabs = array_slice($this->tabs, 0, $ref_pos, true) +
|
|
|
234 |
$tab +
|
235 |
+
array_slice($this->tabs, $ref_pos, count($this->tabs), true);
|
236 |
}
|
237 |
}
|
238 |
+
} else {
|
239 |
+
$this->tabs = array_merge($tab, $this->tabs);
|
|
|
240 |
}
|
241 |
|
242 |
}
|
254 |
* @since 1.0
|
255 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
256 |
*/
|
257 |
+
public function remove_tab($id_tab)
|
258 |
+
{
|
259 |
+
if (isset($this->tabs[$id_tab])) {
|
260 |
+
unset ($this->tabs[$id_tab]);
|
261 |
}
|
262 |
}
|
263 |
|
270 |
* @internal param array $tabs
|
271 |
*
|
272 |
* @param string $tab_id the id of the tabs where add the field
|
273 |
+
* @param array $args the field to add
|
274 |
+
* @param string $where tell where insert the field if after or before a $refer
|
275 |
+
* @param null $refer an existent field inside tab
|
276 |
*
|
277 |
* @return void
|
278 |
* @since 1.0
|
279 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
280 |
*/
|
281 |
+
public function add_field($tab_id, $args, $where = 'after', $refer = null)
|
282 |
+
{
|
283 |
+
if (isset($this->tabs[$tab_id])) {
|
284 |
|
285 |
$cf = $this->tabs[$tab_id]['fields'];
|
286 |
+
if (!is_null($refer)) {
|
287 |
+
$ref_pos = array_search($refer, array_keys($cf));
|
288 |
+
if ($ref_pos !== false) {
|
289 |
+
if ($where == 'after') {
|
290 |
+
$this->tabs[$tab_id]['fields'] = array_slice($cf, 0, $ref_pos + 1, true) +
|
291 |
$args +
|
292 |
+
array_slice($cf, $ref_pos, count($cf) - 1, true);
|
293 |
|
294 |
+
} elseif ($where == 'before') {
|
295 |
+
$this->tabs[$tab_id]['fields'] = array_slice($cf, 0, $ref_pos, true) +
|
296 |
$args +
|
297 |
+
array_slice($cf, $ref_pos, count($cf), true);
|
298 |
|
299 |
}
|
300 |
}
|
301 |
+
} else {
|
302 |
+
if ($where == 'first') {
|
|
|
303 |
$this->tabs[$tab_id]['fields'] = $args + $cf;
|
304 |
|
305 |
} else {
|
306 |
+
$this->tabs[$tab_id]['fields'] = array_merge($this->tabs[$tab_id]['fields'], $args);
|
307 |
}
|
308 |
}
|
309 |
|
323 |
* @since 1.0
|
324 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
325 |
*/
|
326 |
+
public function remove_field($id_field)
|
327 |
+
{
|
328 |
+
foreach ($this->tabs as $tab_name => $tab) {
|
329 |
+
if (isset($tab['fields'][$id_field])) {
|
330 |
+
unset ($this->tabs[$tab_name]['fields'][$id_field]);
|
331 |
}
|
332 |
}
|
333 |
}
|
343 |
* @since 1.0
|
344 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
345 |
*/
|
346 |
+
public function reorder_tabs()
|
347 |
+
{
|
348 |
+
foreach ($this->tabs as $tab_name => $tab) {
|
349 |
+
foreach ($tab['fields'] as $id_field => $field) {
|
350 |
+
$this->tabs[$tab_name]['fields'][$id_field]['private'] = (isset($field['private'])) ? $field['private'] : true;
|
351 |
+
$this->tabs[$tab_name]['fields'][$id_field]['id'] = $this->get_option_metabox_id($id_field, $this->tabs[$tab_name]['fields'][$id_field]['private']);
|
352 |
+
$this->tabs[$tab_name]['fields'][$id_field]['name'] = $this->get_option_metabox_name($this->tabs[$tab_name]['fields'][$id_field]['id']);
|
353 |
}
|
354 |
}
|
355 |
|
368 |
* @since 1.0
|
369 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
370 |
*/
|
371 |
+
public function get_option_metabox_id($id_field, $private = true)
|
372 |
+
{
|
373 |
+
if ($private) {
|
374 |
return '_' . $id_field;
|
375 |
+
} else {
|
|
|
376 |
return $id_field;
|
377 |
}
|
378 |
}
|
389 |
* @since 1.0
|
390 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
391 |
*/
|
392 |
+
public function get_option_metabox_name($id_field, $private = true)
|
393 |
+
{
|
394 |
+
$db_name = apply_filters('yit_metaboxes_option_main_name', 'yit_metaboxes');
|
395 |
+
$return = $db_name . '[';
|
396 |
|
397 |
+
if (!strpos($id_field, '[')) {
|
398 |
return $return . $id_field . ']';
|
399 |
}
|
400 |
+
$return .= substr($id_field, 0, strpos($id_field, '['));
|
401 |
$return .= ']';
|
402 |
+
$return .= substr($id_field, strpos($id_field, '['));
|
403 |
|
404 |
return $return;
|
405 |
}
|
414 |
* @since 1.0
|
415 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
416 |
*/
|
417 |
+
public function register_metabox($post_type)
|
418 |
+
{
|
419 |
+
if (in_array($post_type, (array)$this->options['pages'])) {
|
420 |
+
add_meta_box($this->id, $this->options['label'], array($this, 'show'), $post_type, $this->options['context'], $this->options['priority']);
|
421 |
}
|
422 |
}
|
423 |
|
431 |
* @since 1.0
|
432 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
433 |
*/
|
434 |
+
public function show()
|
435 |
+
{
|
436 |
$this->reorder_tabs();
|
437 |
|
438 |
+
yit_plugin_get_template(YIT_CORE_PLUGIN_PATH, 'metaboxes/tab.php', array('tabs' => $this->tabs));
|
439 |
}
|
440 |
|
441 |
/**
|
449 |
* @since 1.0
|
450 |
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
|
451 |
*/
|
452 |
+
public function save_postdata($post_id)
|
453 |
+
{
|
454 |
|
455 |
|
456 |
+
if (!isset($_POST['yit_metaboxes_nonce']) || !wp_verify_nonce($_POST['yit_metaboxes_nonce'], 'metaboxes-fields-nonce')) {
|
|
|
457 |
return $post_id;
|
458 |
}
|
459 |
|
460 |
|
461 |
+
if ((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || (defined('DOING_AJAX') && DOING_AJAX)) {
|
462 |
return $post_id;
|
463 |
}
|
464 |
|
465 |
+
if (isset($_POST['post_type'])) {
|
466 |
$post_type = $_POST['post_type'];
|
467 |
+
} else {
|
|
|
468 |
return $post_id;
|
469 |
}
|
470 |
|
471 |
+
if ('page' == $post_type) {
|
472 |
+
if (!current_user_can('edit_page', $post_id)) {
|
473 |
return $post_id;
|
474 |
}
|
475 |
+
} else {
|
476 |
+
if (!current_user_can('edit_post', $post_id)) {
|
|
|
477 |
return $post_id;
|
478 |
}
|
479 |
}
|
480 |
|
481 |
+
if (!in_array($post_type, (array)$this->options['pages'])) {
|
482 |
+
return $post_id;
|
483 |
+
}
|
484 |
+
|
485 |
$this->reorder_tabs();
|
486 |
|
487 |
|
488 |
+
foreach ($this->tabs as $tab) {
|
489 |
|
490 |
+
foreach ($tab['fields'] as $field) {
|
491 |
|
492 |
+
if (in_array($field['type'], array('title'))) {
|
493 |
continue;
|
494 |
}
|
495 |
|
496 |
+
if (isset($_POST['yit_metaboxes'][$field['id']])) {
|
497 |
|
498 |
+
add_post_meta($post_id, $field['id'], $_POST['yit_metaboxes'][$field['id']], true) || update_post_meta($post_id, $field['id'], $_POST['yit_metaboxes'][$field['id']]);
|
499 |
+
} elseif (in_array($field['type'], array('onoff', 'checkbox'))) {
|
500 |
+
update_post_meta($post_id, $field['id'], '0');
|
501 |
+
} else {
|
502 |
+
delete_post_meta($post_id, $field['id']);
|
|
|
|
|
503 |
}
|
504 |
}
|
505 |
}
|
506 |
|
507 |
+
|
508 |
}
|
509 |
|
510 |
/**
|
518 |
* @since 2.0.0
|
519 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
520 |
*/
|
521 |
+
public function remove_fields($id_fields)
|
522 |
+
{
|
523 |
+
foreach ($id_fields as $k => $field) {
|
524 |
+
$this->remove_field($field);
|
525 |
}
|
526 |
}
|
527 |
}
|
528 |
}
|
529 |
|
530 |
+
if (!function_exists('YIT_Metabox')) {
|
531 |
|
532 |
/**
|
533 |
* Main instance of plugin
|
540 |
*/
|
541 |
|
542 |
|
543 |
+
function YIT_Metabox($id)
|
544 |
+
{
|
545 |
+
return YIT_Metabox::instance($id);
|
546 |
}
|
547 |
}
|
548 |
|
plugin-fw/lib/yit-plugin-panel-wc.php
CHANGED
@@ -282,7 +282,8 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
282 |
|
283 |
do_action( 'yit_panel_wc_after_update' );
|
284 |
|
285 |
-
} elseif( isset( $_REQUEST['yit-action'] ) && $_REQUEST['yit-action'] == 'wc-options-reset'
|
|
|
286 |
|
287 |
$yit_options = $this->get_main_array_options();
|
288 |
$current_tab = $this->get_current_tab();
|
@@ -364,8 +365,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
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 |
/**
|
282 |
|
283 |
do_action( 'yit_panel_wc_after_update' );
|
284 |
|
285 |
+
} elseif( isset( $_REQUEST['yit-action'] ) && $_REQUEST['yit-action'] == 'wc-options-reset'
|
286 |
+
&& isset( $_POST['yith_wc_reset_options_nonce'] ) && wp_verify_nonce( $_POST['yith_wc_reset_options_nonce'], 'yith_wc_reset_options_'.$this->settings['page'] )){
|
287 |
|
288 |
$yit_options = $this->get_main_array_options();
|
289 |
$current_tab = $this->get_current_tab();
|
365 |
* @return array Filtered body classes
|
366 |
*/
|
367 |
public function admin_body_class( $admin_body_classes ){
|
368 |
+
return substr_count( $admin_body_classes, 'woocommerce' ) == 0 ? $admin_body_classes .= ' woocommerce ' : $admin_body_classes;
|
|
|
369 |
}
|
370 |
|
371 |
/**
|
plugin-fw/lib/yit-plugin-panel.php
CHANGED
@@ -708,8 +708,9 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
708 |
}
|
709 |
|
710 |
$custom_attributes = implode( ' ', $custom_attributes );
|
|
|
|
|
711 |
|
712 |
-
$db_value = ( isset( $db_options[$option['id']] ) ) ? $db_options[$option['id']] : '';
|
713 |
if ( isset( $option['deps'] ) ) {
|
714 |
$deps = $option['deps'];
|
715 |
}
|
708 |
}
|
709 |
|
710 |
$custom_attributes = implode( ' ', $custom_attributes );
|
711 |
+
$std = isset( $option['std'] ) ? $option['std'] : '';
|
712 |
+
$db_value = ( isset( $db_options[$option['id']] ) ) ? $db_options[$option['id']] : $std;
|
713 |
|
|
|
714 |
if ( isset( $option['deps'] ) ) {
|
715 |
$deps = $option['deps'];
|
716 |
}
|
plugin-fw/lib/yit-upgrade.php
CHANGED
@@ -134,7 +134,8 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
|
|
134 |
$update_url[ $init ] = wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin-multisite&plugin=') . $init, 'upgrade-plugin-multisite_' . $init );
|
135 |
$changelog_id = str_replace( array( '/', '.php', '.' ), array( '-', '', '-' ), $init );
|
136 |
$details_url[ $init ] = '#TB_inline' . esc_url( add_query_arg( array( 'width' => 722, 'height' => 914, 'inlineId' => $changelog_id ) , '' ) );
|
137 |
-
$
|
|
|
138 |
}
|
139 |
|
140 |
$localize_script_args = array(
|
@@ -261,7 +262,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
|
|
261 |
|
262 |
//WARNING: The file is not automatically deleted, The script must unlink() the file.
|
263 |
if ( ! $url ) {
|
264 |
-
return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.' ) );
|
265 |
}
|
266 |
|
267 |
$tmpfname = wp_tempnam( $url );
|
@@ -274,7 +275,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
|
|
274 |
);
|
275 |
|
276 |
if ( ! $tmpfname ) {
|
277 |
-
return new WP_Error( 'http_no_file', __( 'Could not create Temporary file.' ) );
|
278 |
}
|
279 |
|
280 |
$response = wp_safe_remote_post( $url, $args );
|
@@ -506,7 +507,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
|
|
506 |
|
507 |
check_admin_referer( 'upgrade-plugin-multisite_' . $plugin );
|
508 |
|
509 |
-
$title = __( 'Update Plugin' );
|
510 |
$parent_file = 'plugins.php';
|
511 |
$submenu_file = 'plugins.php';
|
512 |
|
134 |
$update_url[ $init ] = wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin-multisite&plugin=') . $init, 'upgrade-plugin-multisite_' . $init );
|
135 |
$changelog_id = str_replace( array( '/', '.php', '.' ), array( '-', '', '-' ), $init );
|
136 |
$details_url[ $init ] = '#TB_inline' . esc_url( add_query_arg( array( 'width' => 722, 'height' => 914, 'inlineId' => $changelog_id ) , '' ) );
|
137 |
+
$plugin_changelog = isset( $this->_plugins[ $init ]['info']['changelog'] ) ? $this->_plugins[ $init ]['info']['changelog'] : '';
|
138 |
+
$changelogs[ $init ] = $this->in_theme_update_message( $this->_plugins[ $init ], $plugin_changelog, $changelog_id, false );
|
139 |
}
|
140 |
|
141 |
$localize_script_args = array(
|
262 |
|
263 |
//WARNING: The file is not automatically deleted, The script must unlink() the file.
|
264 |
if ( ! $url ) {
|
265 |
+
return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.', 'yit' ) );
|
266 |
}
|
267 |
|
268 |
$tmpfname = wp_tempnam( $url );
|
275 |
);
|
276 |
|
277 |
if ( ! $tmpfname ) {
|
278 |
+
return new WP_Error( 'http_no_file', __( 'Could not create Temporary file.', 'yit' ) );
|
279 |
}
|
280 |
|
281 |
$response = wp_safe_remote_post( $url, $args );
|
507 |
|
508 |
check_admin_referer( 'upgrade-plugin-multisite_' . $plugin );
|
509 |
|
510 |
+
$title = __( 'Update Plugin', 'yith-plugin-fw' );
|
511 |
$parent_file = 'plugins.php';
|
512 |
$submenu_file = 'plugins.php';
|
513 |
|
plugin-fw/templates/metaboxes/types/categories.php
CHANGED
@@ -43,7 +43,7 @@ $categories = yit_get_model('cpt_unlimited')->get_setting( 'categories', $post->
|
|
43 |
</h4>
|
44 |
<p class="category-add-field" id="<?php echo $id ?>-category-field">
|
45 |
<input type="text" class="newcategory" name="newcategory" style="width:100%;" id="<?php echo $id ?>-new-category" />
|
46 |
-
<input type="button" value="<?php esc_attr_e( 'Add' ); ?>" class="add:categorychecklist:category-add button category-add-submit" id="<?php echo $id ?>-category-add-submit" />
|
47 |
</p>
|
48 |
</div>
|
49 |
</div>
|
43 |
</h4>
|
44 |
<p class="category-add-field" id="<?php echo $id ?>-category-field">
|
45 |
<input type="text" class="newcategory" name="newcategory" style="width:100%;" id="<?php echo $id ?>-new-category" />
|
46 |
+
<input type="button" value="<?php esc_attr_e( 'Add', 'yit' ); ?>" class="add:categorychecklist:category-add button category-add-submit" id="<?php echo $id ?>-category-add-submit" />
|
47 |
</p>
|
48 |
</div>
|
49 |
</div>
|
plugin-fw/templates/panel/woocommerce/woocommerce-form.php
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
<form id="plugin-fw-wc-reset" method="post">
|
8 |
<?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
|
9 |
<input type="hidden" name="yit-action" value="wc-options-reset" />
|
|
|
10 |
<input type="submit" name="yit-reset" class="button-secondary" value="<?php _e( 'Reset Defaults', 'yith-plugin-fw' ) ?>" onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');" />
|
11 |
</form>
|
12 |
</div>
|
7 |
<form id="plugin-fw-wc-reset" method="post">
|
8 |
<?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
|
9 |
<input type="hidden" name="yit-action" value="wc-options-reset" />
|
10 |
+
<?php wp_nonce_field( 'yith_wc_reset_options_'.$this->settings['page'], 'yith_wc_reset_options_nonce' ); ?>
|
11 |
<input type="submit" name="yit-reset" class="button-secondary" value="<?php _e( 'Reset Defaults', 'yith-plugin-fw' ) ?>" onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');" />
|
12 |
</form>
|
13 |
</div>
|
plugin-options/general-options.php
CHANGED
@@ -13,8 +13,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
13 |
} // Exit if accessed directly
|
14 |
|
15 |
$image_size = array(
|
16 |
-
'name' => __( 'Image size', '
|
17 |
-
'desc' => __( 'The size of the images used within the magnifier box', '
|
18 |
'id' => 'woocommerce_magnifier_image',
|
19 |
'css' => '',
|
20 |
'type' => 'yith_ywzm_image_width',
|
@@ -33,22 +33,22 @@ $image_size = array(
|
|
33 |
|
34 |
$general_settings = array(
|
35 |
array(
|
36 |
-
'name' => __( 'General Settings', '
|
37 |
'type' => 'title',
|
38 |
'desc' => '',
|
39 |
'id' => 'yith_wcmg_general'
|
40 |
),
|
41 |
array(
|
42 |
-
'name' => __( 'Activate YITH WooCommerce Zoom Magnifier', '
|
43 |
-
'desc' => __( 'Activate the plugin or use the WooCommerce default product image.', '
|
44 |
'id' => 'yith_wcmg_enable_plugin',
|
45 |
'std' => 'yes',
|
46 |
'default' => 'yes',
|
47 |
'type' => 'checkbox'
|
48 |
),
|
49 |
array(
|
50 |
-
'name' => __( 'Activate on mobile device', '
|
51 |
-
'desc' => __( 'Set if zoom and slider functionalities should be shown also on mobile devices.', '
|
52 |
|
53 |
'id' => 'yith_wcmg_enable_mobile',
|
54 |
'std' => 'yes',
|
@@ -56,8 +56,8 @@ $general_settings = array(
|
|
56 |
'type' => 'checkbox'
|
57 |
),
|
58 |
array(
|
59 |
-
'name' => __( 'Forced Image Size', '
|
60 |
-
'desc' => __( 'If disabled, you will able to customize the sizes of the zoomed images. Disable it at your own risk; the magnifier could not properly work with images out of proportion.', '
|
61 |
'id' => 'yith_wcmg_force_sizes',
|
62 |
'std' => 'yes',
|
63 |
'default' => 'yes',
|
@@ -71,22 +71,22 @@ $general_settings = array(
|
|
71 |
|
72 |
$magnifier_settings = array(
|
73 |
array(
|
74 |
-
'name' => __( 'Magnifier Settings', '
|
75 |
'type' => 'title',
|
76 |
'desc' => '',
|
77 |
'id' => 'yith_wcmg_magnifier'
|
78 |
),
|
79 |
'zoom_box_width' => array(
|
80 |
-
'name' => __( 'Zoom Box Width', '
|
81 |
-
'desc' => __( 'The width of the magnifier box (default: auto)', '
|
82 |
'id' => 'yith_wcmg_zoom_width',
|
83 |
'std' => 'auto',
|
84 |
'default' => 'auto',
|
85 |
'type' => 'text',
|
86 |
),
|
87 |
array(
|
88 |
-
'name' => __( 'Zoom Box Height', '
|
89 |
-
'desc' => __( 'The height of the magnifier box (default: auto)', '
|
90 |
'id' => 'yith_wcmg_zoom_height',
|
91 |
'std' => 'auto',
|
92 |
'default' => 'auto',
|
@@ -94,40 +94,40 @@ $magnifier_settings = array(
|
|
94 |
),
|
95 |
$image_size,
|
96 |
'zoom_box_position' => array(
|
97 |
-
'name' => __( 'Zoom Box Position', '
|
98 |
-
'desc' => __( 'The magnifier position', '
|
99 |
'id' => 'yith_wcmg_zoom_position',
|
100 |
'std' => 'right',
|
101 |
'default' => 'right',
|
102 |
'type' => 'select',
|
103 |
'options' => array(
|
104 |
-
'right' => __( 'Right', '
|
105 |
-
'inside' => __( 'Inside', '
|
106 |
)
|
107 |
),
|
108 |
array(
|
109 |
-
'name' => __( 'Zoom Box Position for mobile devices', '
|
110 |
-
'desc' => __( 'The magnifier position for the mobile devices (iPhone, Android, etc.)', '
|
111 |
'id' => 'yith_wcmg_zoom_mobile_position',
|
112 |
'std' => 'default',
|
113 |
'default' => 'inside',
|
114 |
'type' => 'select',
|
115 |
'options' => array(
|
116 |
-
'default' => __( 'Default', '
|
117 |
-
'inside' => __( 'Inside', '
|
118 |
-
'disable' => __( 'Disable', '
|
119 |
)
|
120 |
),
|
121 |
array(
|
122 |
-
'name' => __( 'Loading label', '
|
123 |
'desc' => '',
|
124 |
'id' => 'yith_wcmg_loading_label',
|
125 |
-
'std' => __( 'Loading...', '
|
126 |
-
'default' => __( 'Loading...', '
|
127 |
'type' => 'text',
|
128 |
),
|
129 |
array(
|
130 |
-
'name' => __( 'Lens Opacity', '
|
131 |
'desc' => '',
|
132 |
'id' => 'yith_wcmg_lens_opacity',
|
133 |
'std' => 0.5,
|
@@ -138,8 +138,8 @@ $magnifier_settings = array(
|
|
138 |
'step' => .1
|
139 |
),
|
140 |
array(
|
141 |
-
'name' => __( 'Blur', '
|
142 |
-
'desc' => __( 'Add a blur effect to the small image on mouse hover.', '
|
143 |
'id' => 'yith_wcmg_softfocus',
|
144 |
'std' => 'no',
|
145 |
'default' => 'no',
|
@@ -150,30 +150,30 @@ $magnifier_settings = array(
|
|
150 |
|
151 |
$slider_settings = array(
|
152 |
array(
|
153 |
-
'name' => __( 'Slider Settings', '
|
154 |
'type' => 'title',
|
155 |
'desc' => '',
|
156 |
'id' => 'yith_wcmg_slider'
|
157 |
),
|
158 |
array(
|
159 |
-
'name' => __( 'Activate Slider', '
|
160 |
-
'desc' => __( 'Activate Thumbnail Slider.', '
|
161 |
'id' => 'yith_wcmg_enableslider',
|
162 |
'std' => 'yes',
|
163 |
'default' => 'yes',
|
164 |
'type' => 'checkbox'
|
165 |
),
|
166 |
array(
|
167 |
-
'name' => __( 'Activate Responsive Slider', '
|
168 |
-
'desc' => __( 'This option fits the thumbnails within the available space. Disable it if you want to manage freely the thumbnails (eg. add margins, paddings, etc.)', '
|
169 |
'id' => 'yith_wcmg_slider_responsive',
|
170 |
'std' => 'yes',
|
171 |
'default' => 'yes',
|
172 |
'type' => 'checkbox'
|
173 |
),
|
174 |
array(
|
175 |
-
'name' => __( 'Items', '
|
176 |
-
'desc' => __( 'Number of items to show', '
|
177 |
'id' => 'yith_wcmg_slider_items',
|
178 |
'std' => 3,
|
179 |
'default' => 3,
|
@@ -183,16 +183,16 @@ $slider_settings = array(
|
|
183 |
'step' => 1
|
184 |
),
|
185 |
array(
|
186 |
-
'name' => __( 'Circular carousel', '
|
187 |
-
'desc' => __( 'It defines whether the carousel should be circular.', '
|
188 |
'id' => 'yith_wcmg_slider_circular',
|
189 |
'std' => 'yes',
|
190 |
'default' => 'yes',
|
191 |
'type' => 'checkbox'
|
192 |
),
|
193 |
array(
|
194 |
-
'name' => __( 'Infinite carousel', '
|
195 |
-
'desc' => __( 'It defines whether the carousel should be infinite. Note: It is possible to create a non-circular, infinite carousel, but it is not possible to create a circular, non-infinite carousel.', '
|
196 |
'id' => 'yith_wcmg_slider_infinite',
|
197 |
'std' => 'yes',
|
198 |
'default' => 'yes',
|
@@ -210,19 +210,19 @@ $options['general'] = array();
|
|
210 |
if ( ! defined( 'YITH_YWZM_PREMIUM' ) ) {
|
211 |
$intro_tab = array(
|
212 |
'section_general_settings_videobox' => array(
|
213 |
-
'name' => __( 'Upgrade to the PREMIUM VERSION', '
|
214 |
'type' => 'videobox',
|
215 |
'default' => array(
|
216 |
-
'plugin_name' => __( 'YITH WooCommerce Zoom Magnifier', '
|
217 |
-
'title_first_column' => __( 'Discover The Advanced Features', '
|
218 |
-
'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WOOCOMMERCE ZOOM MAGNIFIER to benefit from all features!', '
|
219 |
'video' => array(
|
220 |
'video_id' => '122436840',
|
221 |
'video_image_url' => YITH_YWZM_ASSETS_IMAGES_URL . 'yith-woocommerce-zoom-magnifier-video.jpg',
|
222 |
-
'video_description' => __( 'See YITH WooCommerce Zoom Magnifier plugin with full premium features in action', '
|
223 |
),
|
224 |
-
'title_second_column' => __( 'Get Support and Pro Features', '
|
225 |
-
'description_second_column' => __( 'Purchasing the premium version of the plugin, you will take advantage of the advanced features of the product, and you will get one year of free updates and support through our platform available 24h/24.', '
|
226 |
'button' => array(
|
227 |
'href' => YITH_YWZM_Plugin_FW_Loader::get_instance()->get_premium_landing_uri(),
|
228 |
'title' => 'Get Support and Pro Features'
|
13 |
} // Exit if accessed directly
|
14 |
|
15 |
$image_size = array(
|
16 |
+
'name' => __( 'Image size', 'yith-woocommerce-zoom-magnifier' ),
|
17 |
+
'desc' => __( 'The size of the images used within the magnifier box', 'yith-woocommerce-zoom-magnifier' ),
|
18 |
'id' => 'woocommerce_magnifier_image',
|
19 |
'css' => '',
|
20 |
'type' => 'yith_ywzm_image_width',
|
33 |
|
34 |
$general_settings = array(
|
35 |
array(
|
36 |
+
'name' => __( 'General Settings', 'yith-woocommerce-zoom-magnifier' ),
|
37 |
'type' => 'title',
|
38 |
'desc' => '',
|
39 |
'id' => 'yith_wcmg_general'
|
40 |
),
|
41 |
array(
|
42 |
+
'name' => __( 'Activate YITH WooCommerce Zoom Magnifier', 'yith-woocommerce-zoom-magnifier' ),
|
43 |
+
'desc' => __( 'Activate the plugin or use the WooCommerce default product image.', 'yith-woocommerce-zoom-magnifier' ),
|
44 |
'id' => 'yith_wcmg_enable_plugin',
|
45 |
'std' => 'yes',
|
46 |
'default' => 'yes',
|
47 |
'type' => 'checkbox'
|
48 |
),
|
49 |
array(
|
50 |
+
'name' => __( 'Activate on mobile device', 'yith-woocommerce-zoom-magnifier' ),
|
51 |
+
'desc' => __( 'Set if zoom and slider functionalities should be shown also on mobile devices.', 'yith-woocommerce-zoom-magnifier' ),
|
52 |
|
53 |
'id' => 'yith_wcmg_enable_mobile',
|
54 |
'std' => 'yes',
|
56 |
'type' => 'checkbox'
|
57 |
),
|
58 |
array(
|
59 |
+
'name' => __( 'Forced Image Size', 'yith-woocommerce-zoom-magnifier' ),
|
60 |
+
'desc' => __( 'If disabled, you will able to customize the sizes of the zoomed images. Disable it at your own risk; the magnifier could not properly work with images out of proportion.', 'yith-woocommerce-zoom-magnifier' ),
|
61 |
'id' => 'yith_wcmg_force_sizes',
|
62 |
'std' => 'yes',
|
63 |
'default' => 'yes',
|
71 |
|
72 |
$magnifier_settings = array(
|
73 |
array(
|
74 |
+
'name' => __( 'Magnifier Settings', 'yith-woocommerce-zoom-magnifier' ),
|
75 |
'type' => 'title',
|
76 |
'desc' => '',
|
77 |
'id' => 'yith_wcmg_magnifier'
|
78 |
),
|
79 |
'zoom_box_width' => array(
|
80 |
+
'name' => __( 'Zoom Box Width', 'yith-woocommerce-zoom-magnifier' ),
|
81 |
+
'desc' => __( 'The width of the magnifier box (default: auto)', 'yith-woocommerce-zoom-magnifier' ),
|
82 |
'id' => 'yith_wcmg_zoom_width',
|
83 |
'std' => 'auto',
|
84 |
'default' => 'auto',
|
85 |
'type' => 'text',
|
86 |
),
|
87 |
array(
|
88 |
+
'name' => __( 'Zoom Box Height', 'yith-woocommerce-zoom-magnifier' ),
|
89 |
+
'desc' => __( 'The height of the magnifier box (default: auto)', 'yith-woocommerce-zoom-magnifier' ),
|
90 |
'id' => 'yith_wcmg_zoom_height',
|
91 |
'std' => 'auto',
|
92 |
'default' => 'auto',
|
94 |
),
|
95 |
$image_size,
|
96 |
'zoom_box_position' => array(
|
97 |
+
'name' => __( 'Zoom Box Position', 'yith-woocommerce-zoom-magnifier' ),
|
98 |
+
'desc' => __( 'The magnifier position', 'yith-woocommerce-zoom-magnifier' ),
|
99 |
'id' => 'yith_wcmg_zoom_position',
|
100 |
'std' => 'right',
|
101 |
'default' => 'right',
|
102 |
'type' => 'select',
|
103 |
'options' => array(
|
104 |
+
'right' => __( 'Right', 'yith-woocommerce-zoom-magnifier' ),
|
105 |
+
'inside' => __( 'Inside', 'yith-woocommerce-zoom-magnifier' )
|
106 |
)
|
107 |
),
|
108 |
array(
|
109 |
+
'name' => __( 'Zoom Box Position for mobile devices', 'yith-woocommerce-zoom-magnifier' ),
|
110 |
+
'desc' => __( 'The magnifier position for the mobile devices (iPhone, Android, etc.)', 'yith-woocommerce-zoom-magnifier' ),
|
111 |
'id' => 'yith_wcmg_zoom_mobile_position',
|
112 |
'std' => 'default',
|
113 |
'default' => 'inside',
|
114 |
'type' => 'select',
|
115 |
'options' => array(
|
116 |
+
'default' => __( 'Default', 'yith-woocommerce-zoom-magnifier' ),
|
117 |
+
'inside' => __( 'Inside', 'yith-woocommerce-zoom-magnifier' ),
|
118 |
+
'disable' => __( 'Disable', 'yith-woocommerce-zoom-magnifier' )
|
119 |
)
|
120 |
),
|
121 |
array(
|
122 |
+
'name' => __( 'Loading label', 'yith-woocommerce-zoom-magnifier' ),
|
123 |
'desc' => '',
|
124 |
'id' => 'yith_wcmg_loading_label',
|
125 |
+
'std' => __( 'Loading...', 'yith-woocommerce-zoom-magnifier' ),
|
126 |
+
'default' => __( 'Loading...', 'yith-woocommerce-zoom-magnifier' ),
|
127 |
'type' => 'text',
|
128 |
),
|
129 |
array(
|
130 |
+
'name' => __( 'Lens Opacity', 'yith-woocommerce-zoom-magnifier' ),
|
131 |
'desc' => '',
|
132 |
'id' => 'yith_wcmg_lens_opacity',
|
133 |
'std' => 0.5,
|
138 |
'step' => .1
|
139 |
),
|
140 |
array(
|
141 |
+
'name' => __( 'Blur', 'yith-woocommerce-zoom-magnifier' ),
|
142 |
+
'desc' => __( 'Add a blur effect to the small image on mouse hover.', 'yith-woocommerce-zoom-magnifier' ),
|
143 |
'id' => 'yith_wcmg_softfocus',
|
144 |
'std' => 'no',
|
145 |
'default' => 'no',
|
150 |
|
151 |
$slider_settings = array(
|
152 |
array(
|
153 |
+
'name' => __( 'Slider Settings', 'yith-woocommerce-zoom-magnifier' ),
|
154 |
'type' => 'title',
|
155 |
'desc' => '',
|
156 |
'id' => 'yith_wcmg_slider'
|
157 |
),
|
158 |
array(
|
159 |
+
'name' => __( 'Activate Slider', 'yith-woocommerce-zoom-magnifier' ),
|
160 |
+
'desc' => __( 'Activate Thumbnail Slider.', 'yith-woocommerce-zoom-magnifier' ),
|
161 |
'id' => 'yith_wcmg_enableslider',
|
162 |
'std' => 'yes',
|
163 |
'default' => 'yes',
|
164 |
'type' => 'checkbox'
|
165 |
),
|
166 |
array(
|
167 |
+
'name' => __( 'Activate Responsive Slider', 'yith-woocommerce-zoom-magnifier' ),
|
168 |
+
'desc' => __( 'This option fits the thumbnails within the available space. Disable it if you want to manage freely the thumbnails (eg. add margins, paddings, etc.)', 'yith-woocommerce-zoom-magnifier' ),
|
169 |
'id' => 'yith_wcmg_slider_responsive',
|
170 |
'std' => 'yes',
|
171 |
'default' => 'yes',
|
172 |
'type' => 'checkbox'
|
173 |
),
|
174 |
array(
|
175 |
+
'name' => __( 'Items', 'yith-woocommerce-zoom-magnifier' ),
|
176 |
+
'desc' => __( 'Number of items to show', 'yith-woocommerce-zoom-magnifier' ),
|
177 |
'id' => 'yith_wcmg_slider_items',
|
178 |
'std' => 3,
|
179 |
'default' => 3,
|
183 |
'step' => 1
|
184 |
),
|
185 |
array(
|
186 |
+
'name' => __( 'Circular carousel', 'yith-woocommerce-zoom-magnifier' ),
|
187 |
+
'desc' => __( 'It defines whether the carousel should be circular.', 'yith-woocommerce-zoom-magnifier' ),
|
188 |
'id' => 'yith_wcmg_slider_circular',
|
189 |
'std' => 'yes',
|
190 |
'default' => 'yes',
|
191 |
'type' => 'checkbox'
|
192 |
),
|
193 |
array(
|
194 |
+
'name' => __( 'Infinite carousel', 'yith-woocommerce-zoom-magnifier' ),
|
195 |
+
'desc' => __( 'It defines whether the carousel should be infinite. Note: It is possible to create a non-circular, infinite carousel, but it is not possible to create a circular, non-infinite carousel.', 'yith-woocommerce-zoom-magnifier' ),
|
196 |
'id' => 'yith_wcmg_slider_infinite',
|
197 |
'std' => 'yes',
|
198 |
'default' => 'yes',
|
210 |
if ( ! defined( 'YITH_YWZM_PREMIUM' ) ) {
|
211 |
$intro_tab = array(
|
212 |
'section_general_settings_videobox' => array(
|
213 |
+
'name' => __( 'Upgrade to the PREMIUM VERSION', 'yith-woocommerce-zoom-magnifier' ),
|
214 |
'type' => 'videobox',
|
215 |
'default' => array(
|
216 |
+
'plugin_name' => __( 'YITH WooCommerce Zoom Magnifier', 'yith-woocommerce-zoom-magnifier' ),
|
217 |
+
'title_first_column' => __( 'Discover The Advanced Features', 'yith-woocommerce-zoom-magnifier' ),
|
218 |
+
'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WOOCOMMERCE ZOOM MAGNIFIER to benefit from all features!', 'yith-woocommerce-zoom-magnifier' ),
|
219 |
'video' => array(
|
220 |
'video_id' => '122436840',
|
221 |
'video_image_url' => YITH_YWZM_ASSETS_IMAGES_URL . 'yith-woocommerce-zoom-magnifier-video.jpg',
|
222 |
+
'video_description' => __( 'See YITH WooCommerce Zoom Magnifier plugin with full premium features in action', 'yith-woocommerce-zoom-magnifier' ),
|
223 |
),
|
224 |
+
'title_second_column' => __( 'Get Support and Pro Features', 'yith-woocommerce-zoom-magnifier' ),
|
225 |
+
'description_second_column' => __( 'Purchasing the premium version of the plugin, you will take advantage of the advanced features of the product, and you will get one year of free updates and support through our platform available 24h/24.', 'yith-woocommerce-zoom-magnifier' ),
|
226 |
'button' => array(
|
227 |
'href' => YITH_YWZM_Plugin_FW_Loader::get_instance()->get_premium_landing_uri(),
|
228 |
'title' => 'Get Support and Pro Features'
|
templates/admin/premium.php
CHANGED
@@ -190,16 +190,16 @@
|
|
190 |
<div class="landing-container">
|
191 |
<div class="premium-cta">
|
192 |
<p>
|
193 |
-
<?php echo sprintf(__('Upgrade to the %1$s premium version %2$s of %1$s YITH WooCommerce Zoom Magnifier %2$s to benefit from all features!','
|
194 |
</p>
|
195 |
<a href="<?php echo YITH_YWZM_Plugin_FW_Loader::get_instance()->get_premium_landing_uri(); ?>" target="_blank" class="premium-cta-button button btn">
|
196 |
-
<?php echo sprintf(__('%1$sUPGRADE%2$s%3$sto the premium version%2$s','
|
197 |
</a>
|
198 |
</div>
|
199 |
</div>
|
200 |
</div>
|
201 |
<div class="section section-even clear" style="background: url(<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>01-bg.png) no-repeat #fff; background-position: 85% 75%">
|
202 |
-
<?php echo sprintf(__('%1$sPremium Features%2$s','
|
203 |
<div class="landing-container">
|
204 |
<div class="col-1">
|
205 |
<img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>01.png" alt="Review Title" />
|
@@ -207,10 +207,10 @@
|
|
207 |
<div class="col-2">
|
208 |
<div class="section-title">
|
209 |
<img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>01-icon.png" alt="Review Title"/>
|
210 |
-
<h2><?php _e('ZOOM BOX POSITION','
|
211 |
</div>
|
212 |
<p>
|
213 |
-
<?php echo sprintf(__('Choose where you want to show the %1$szoomed version%2$s of the image of your products. Place it above or below the original image, on its left or its right, or you can even place it over it.$2$s','
|
214 |
</p>
|
215 |
</div>
|
216 |
</div>
|
@@ -220,9 +220,9 @@
|
|
220 |
<div class="col-2">
|
221 |
<div class="section-title">
|
222 |
<img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>02-icon.png" alt="Attachment List" />
|
223 |
-
<h2><?php _e('ENLARGE THE IMAGES','
|
224 |
</div>
|
225 |
-
<p><?php _e('Just one click and the product image will appear in a bigger size in a modal window. A further chance to let users analyze in a better way what you sell.','
|
226 |
</div>
|
227 |
<div class="col-1">
|
228 |
<img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>02.png" alt="Attachment List" />
|
@@ -237,9 +237,9 @@
|
|
237 |
<div class="col-2">
|
238 |
<div class="section-title">
|
239 |
<img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>03-icon.png" alt="Vote the review" />
|
240 |
-
<h2><?php _e('EXCLUDE PRODUCTS','
|
241 |
</div>
|
242 |
-
<p><?php _e('Tailored options to limit the plugin features only to certain products. Some of these could have too small images to be zoomed, or maybe being part of categories that do not imply zoomed images. Select the products and the categories to exclude and delete all your problems','
|
243 |
</div>
|
244 |
</div>
|
245 |
</div>
|
@@ -248,10 +248,10 @@
|
|
248 |
<div class="landing-container">
|
249 |
<div class="premium-cta">
|
250 |
<p>
|
251 |
-
<?php echo sprintf(__('Upgrade to the %1$spremium version%2$s of %1$sYITH WooCommerce Zoom Magnifier%2$s to benefit from all features!','
|
252 |
</p>
|
253 |
<a href="<?php echo YITH_YWZM_Plugin_FW_Loader::get_instance()->get_premium_landing_uri(); ?>" target="_blank" class="premium-cta-button button btn">
|
254 |
-
<?php echo sprintf(__('%1$sUPGRADE%2$s %3$sto the premium version%2$s','
|
255 |
</a>
|
256 |
</div>
|
257 |
</div>
|
190 |
<div class="landing-container">
|
191 |
<div class="premium-cta">
|
192 |
<p>
|
193 |
+
<?php echo sprintf(__('Upgrade to the %1$s premium version %2$s of %1$s YITH WooCommerce Zoom Magnifier %2$s to benefit from all features!','yith-woocommerce-zoom-magnifier'),'<span class="highlight">','</span>' );?>
|
194 |
</p>
|
195 |
<a href="<?php echo YITH_YWZM_Plugin_FW_Loader::get_instance()->get_premium_landing_uri(); ?>" target="_blank" class="premium-cta-button button btn">
|
196 |
+
<?php echo sprintf(__('%1$sUPGRADE%2$s%3$sto the premium version%2$s','yith-woocommerce-zoom-magnifier'),'<span class="highlight">','</span>','<span>');?>
|
197 |
</a>
|
198 |
</div>
|
199 |
</div>
|
200 |
</div>
|
201 |
<div class="section section-even clear" style="background: url(<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>01-bg.png) no-repeat #fff; background-position: 85% 75%">
|
202 |
+
<?php echo sprintf(__('%1$sPremium Features%2$s','yith-woocommerce-zoom-magnifier'),'<h1>','</h1>');?>
|
203 |
<div class="landing-container">
|
204 |
<div class="col-1">
|
205 |
<img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>01.png" alt="Review Title" />
|
207 |
<div class="col-2">
|
208 |
<div class="section-title">
|
209 |
<img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>01-icon.png" alt="Review Title"/>
|
210 |
+
<h2><?php _e('ZOOM BOX POSITION','yith-woocommerce-zoom-magnifier');?></h2>
|
211 |
</div>
|
212 |
<p>
|
213 |
+
<?php echo sprintf(__('Choose where you want to show the %1$szoomed version%2$s of the image of your products. Place it above or below the original image, on its left or its right, or you can even place it over it.$2$s','yith-woocommerce-zoom-magnifier'),'<b>','</b>');?>
|
214 |
</p>
|
215 |
</div>
|
216 |
</div>
|
220 |
<div class="col-2">
|
221 |
<div class="section-title">
|
222 |
<img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>02-icon.png" alt="Attachment List" />
|
223 |
+
<h2><?php _e('ENLARGE THE IMAGES','yith-woocommerce-zoom-magnifier');?></h2>
|
224 |
</div>
|
225 |
+
<p><?php _e('Just one click and the product image will appear in a bigger size in a modal window. A further chance to let users analyze in a better way what you sell.','yith-woocommerce-zoom-magnifier');?></p>
|
226 |
</div>
|
227 |
<div class="col-1">
|
228 |
<img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>02.png" alt="Attachment List" />
|
237 |
<div class="col-2">
|
238 |
<div class="section-title">
|
239 |
<img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>03-icon.png" alt="Vote the review" />
|
240 |
+
<h2><?php _e('EXCLUDE PRODUCTS','yith-woocommerce-zoom-magnifier');?></h2>
|
241 |
</div>
|
242 |
+
<p><?php _e('Tailored options to limit the plugin features only to certain products. Some of these could have too small images to be zoomed, or maybe being part of categories that do not imply zoomed images. Select the products and the categories to exclude and delete all your problems','yith-woocommerce-zoom-magnifier');?></p>
|
243 |
</div>
|
244 |
</div>
|
245 |
</div>
|
248 |
<div class="landing-container">
|
249 |
<div class="premium-cta">
|
250 |
<p>
|
251 |
+
<?php echo sprintf(__('Upgrade to the %1$spremium version%2$s of %1$sYITH WooCommerce Zoom Magnifier%2$s to benefit from all features!','yith-woocommerce-zoom-magnifier'),'<span class="highlight">','</span>');?>
|
252 |
</p>
|
253 |
<a href="<?php echo YITH_YWZM_Plugin_FW_Loader::get_instance()->get_premium_landing_uri(); ?>" target="_blank" class="premium-cta-button button btn">
|
254 |
+
<?php echo sprintf(__('%1$sUPGRADE%2$s %3$sto the premium version%2$s','yith-woocommerce-zoom-magnifier'),'<span class="highlight">','</span>','<span>');?>
|
255 |
</a>
|
256 |
</div>
|
257 |
</div>
|