Skip to content

Commit 83ae1ab

Browse files
v3.3.8
1 parent c6f5f8a commit 83ae1ab

13 files changed

+336
-232
lines changed

assets/js/frontend.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/modules/dev/src_js_modules_thumb-btn-positioner_js.js

Lines changed: 60 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/modules/dev/src_js_modules_thumb-btn-positioner_js.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/modules/src_js_modules_thumb-btn-positioner_js.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/admin/class-alg-wc-wish-list-settings-buttons.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Wish List for WooCommerce Pro - General Section Settings
44
*
5-
* @version 3.2.2
5+
* @version 3.3.8
66
* @since 1.5.0
77
* @author WPFactory.
88
*/
@@ -93,7 +93,7 @@ function get_section_priority() {
9393
/**
9494
* get_settings.
9595
*
96-
* @version 2.3.7
96+
* @version 3.3.8
9797
* @since 1.0.0
9898
* @todo translation via admin (is it recommended?)
9999
*/
@@ -250,6 +250,14 @@ function get_settings( $settings = array() ) {
250250
'desc_tip' => sprintf( __( 'Tooltip texts can be <a href="%s">edited</a>.', 'wish-list-for-woocommerce' ), admin_url( 'admin.php?page=wc-settings&tab=alg_wc_wish_list&section=texts' ) ),
251251
'id' => self::OPTION_TOOLTIP_ENABLE,
252252
),
253+
array(
254+
'title' => __( 'Guide image selector', 'wish-list-for-woocommerce' ),
255+
'desc' => __( 'DOM Selector for the guide image.', 'wish-list-for-woocommerce' ),
256+
'desc_tip' => sprintf( __( 'The default value is %s.', 'wish-list-for-woocommerce' ), '<code>img.wp-post-image</code>' ),
257+
'id' => 'alg_wc_wl_thumb_btn_guide_img_selector',
258+
'default' => 'img.wp-post-image',
259+
'type' => 'text',
260+
),
253261
array(
254262
'type' => 'sectionend',
255263
'id' => 'alg_wc_wl_thumb_btn_opt',

includes/class-alg-wc-wish-list-core.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class Alg_WC_Wish_List_Core {
2121
* @since 1.0.0
2222
* @var string
2323
*/
24-
public $version = '3.3.7';
24+
public $version = '3.3.8';
2525

2626
/**
2727
* @since 1.0.0
@@ -1202,13 +1202,15 @@ public function override_script_localization( $object, $object_name ) {
12021202
/**
12031203
* Localize scripts
12041204
*
1205-
* @version 3.3.7
1205+
* @version 3.3.8
12061206
* @since 1.0.0
12071207
*/
12081208
public function localize_scripts() {
1209+
$thumb_btn_params = Alg_WC_Wish_List_Customization_Thumb_Button::get_general_dynamic_params();
12091210
if ( true === filter_var( get_option( Alg_WC_Wish_List_Settings_Style::OPTION_STYLE_ENABLE, 'no' ), FILTER_VALIDATE_BOOLEAN ) ) {
1210-
Alg_WC_Wish_List_Customization_Thumb_Button::localize_script( 'alg-wc-wish-list' );
1211+
$thumb_btn_params = array_merge( $thumb_btn_params, Alg_WC_Wish_List_Customization_Thumb_Button::get_custom_style_dynamic_params() );
12111212
}
1213+
wp_localize_script( 'alg-wc-wish-list', 'alg_wc_wl_thumb', $thumb_btn_params );
12121214

12131215
$ajax_url = get_option( Alg_WC_Wish_List_Settings_Advanced::OPTION_ADMIN_AJAX_URL, admin_url( 'admin-ajax.php', 'relative' ) );
12141216
if ( empty( $ajax_url ) ) {

includes/free/class-alg-wc-wish-list-customization-thumb-button.php

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Wish List for WooCommerce Pro - Thumb button customization
44
*
5-
* @version 3.3.7
5+
* @version 3.3.8
66
* @since 1.0.0
77
* @author WPFactory.
88
*/
@@ -100,21 +100,37 @@ public static function get_thumb_button_custom_style() {
100100
}
101101

102102
/**
103-
* Load buttons vars on javascript
103+
* Localize custom style params.
104104
*
105-
* @version 3.3.7
105+
* @version 3.3.8
106106
* @since 1.0.0
107107
*
108-
* @param type $script
109108
*/
110-
public static function localize_script( $script ) {
109+
public static function get_custom_style_dynamic_params() {
111110
$params = array(
112111
'position' => sanitize_text_field( get_option( Alg_WC_Wish_List_Settings_Style::OPTION_STYLE_THUMB_BTN_POSITION, 'topLeft' ) ),
113112
'offset_loop' => filter_var( get_option( Alg_WC_Wish_List_Settings_Style::OPTION_STYLE_THUMB_BTN_OFFSET_LOOP, '17' ), FILTER_VALIDATE_INT ),
114113
'offset_single' => filter_var( get_option( Alg_WC_Wish_List_Settings_Style::OPTION_STYLE_THUMB_BTN_OFFSET_SINGLE, '17' ), FILTER_VALIDATE_INT ),
115114
'img_wrapper_guess_levels_single' => filter_var( get_option( Alg_WC_Wish_List_Settings_Buttons::IMAGE_WRAPPER_GUESSING_LEVELS_SINGLE, 2 ), FILTER_VALIDATE_INT ),
115+
'guide_img_selector' => sanitize_text_field( get_option( 'alg_wc_wl_thumb_btn_guide_img_selector', 'img.wp-post-image' ) ),
116+
);
117+
return $params;
118+
}
119+
120+
/**
121+
* Localize general params.
122+
*
123+
* @version 3.3.8
124+
* @since 3.3.8
125+
*
126+
* @return array
127+
*/
128+
public static function get_general_dynamic_params() {
129+
$params = array(
130+
'img_wrapper_guess_levels_single' => filter_var( get_option( Alg_WC_Wish_List_Settings_Buttons::IMAGE_WRAPPER_GUESSING_LEVELS_SINGLE, 2 ), FILTER_VALIDATE_INT ),
131+
'guide_img_selector' => sanitize_text_field( get_option( 'alg_wc_wl_thumb_btn_guide_img_selector', 'img.wp-post-image' ) ),
116132
);
117-
wp_localize_script( $script, 'alg_wc_wl_thumb', $params );
133+
return $params;
118134
}
119135

120136
/**

0 commit comments

Comments
 (0)