Version Description
- 2020-02-25 =
- Fixed attibute/value escaping in admin panel and on checkout page
- Added additional security hardenings
Download this release
Release Info
Developer | wpdesk |
Plugin | Flexible Checkout Fields for WooCommerce – WooCommerce Checkout Manager |
Version | 2.3.4 |
Comparing to | |
See all releases |
Code changes from version 2.3.3 to 2.3.4
- classes/class-flexible-checkout-fields-plugin.php +4 -4
- classes/display-options.php +1 -1
- classes/settings.php +15 -15
- classes/views/settings-fields.php +62 -62
- flexible-checkout-fields.php +3 -3
- readme.txt +5 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +4 -4
classes/class-flexible-checkout-fields-plugin.php
CHANGED
@@ -546,7 +546,7 @@ class Flexible_Checkout_Fields_Plugin extends \FcfVendor\WPDesk\PluginBuilder\Pl
|
|
546 |
$new[ $key ][ $field['name'] ]['placeholder'] = '';
|
547 |
}
|
548 |
if ( is_array( $field['class'] ) ) {
|
549 |
-
$new[ $key ][ $field['name'] ]['class'] = $field['class'];
|
550 |
} else {
|
551 |
$new[ $key ][ $field['name'] ]['class'] = explode( ' ', $field['class'] );
|
552 |
}
|
@@ -689,16 +689,16 @@ class Flexible_Checkout_Fields_Plugin extends \FcfVendor\WPDesk\PluginBuilder\Pl
|
|
689 |
}
|
690 |
|
691 |
if ( isset( $field['placeholder'] ) ) {
|
692 |
-
$new[ $key ]['placeholder'] = wpdesk__( $field['placeholder'], 'flexible-checkout-fields' );
|
693 |
} else {
|
694 |
$new[ $key ]['placeholder'] = '';
|
695 |
}
|
696 |
|
697 |
if ( isset( $field['class'] ) ) {
|
698 |
if ( is_array( $field['class'] ) ) {
|
699 |
-
$new[ $key ]['class'][0] = implode( ' ', $field['class'] );
|
700 |
} else {
|
701 |
-
$new[ $key ]['class'][0] = $field['class'];
|
702 |
}
|
703 |
}
|
704 |
|
546 |
$new[ $key ][ $field['name'] ]['placeholder'] = '';
|
547 |
}
|
548 |
if ( is_array( $field['class'] ) ) {
|
549 |
+
$new[ $key ][ $field['name'] ]['class'] = esc_attr($field['class']);
|
550 |
} else {
|
551 |
$new[ $key ][ $field['name'] ]['class'] = explode( ' ', $field['class'] );
|
552 |
}
|
689 |
}
|
690 |
|
691 |
if ( isset( $field['placeholder'] ) ) {
|
692 |
+
$new[ $key ]['placeholder'] = wpdesk__( esc_attr($field['placeholder']), 'flexible-checkout-fields' );
|
693 |
} else {
|
694 |
$new[ $key ]['placeholder'] = '';
|
695 |
}
|
696 |
|
697 |
if ( isset( $field['class'] ) ) {
|
698 |
if ( is_array( $field['class'] ) ) {
|
699 |
+
$new[ $key ]['class'][0] = esc_attr(implode( ' ', $field['class'] ));
|
700 |
} else {
|
701 |
+
$new[ $key ]['class'][0] = esc_attr($field['class']);
|
702 |
}
|
703 |
}
|
704 |
|
classes/display-options.php
CHANGED
@@ -377,7 +377,7 @@ class Flexible_Checkout_Fields_Disaplay_Options {
|
|
377 |
|
378 |
$val = $this->flexible_invoices_ask_field_integration($val, $field, $field_key, $fields);
|
379 |
|
380 |
-
$fields[$field['name']] = $val;
|
381 |
$fields[$this->replace_only_first( $address_type . '_', '', $field['name'] )] = $val;
|
382 |
}
|
383 |
return $fields;
|
377 |
|
378 |
$val = $this->flexible_invoices_ask_field_integration($val, $field, $field_key, $fields);
|
379 |
|
380 |
+
$fields[$field['name']] = esc_html($val);
|
381 |
$fields[$this->replace_only_first( $address_type . '_', '', $field['name'] )] = $val;
|
382 |
}
|
383 |
return $fields;
|
classes/settings.php
CHANGED
@@ -27,9 +27,9 @@
|
|
27 |
|
28 |
$this->fields_requirement_controlled_by_woocommerce = $fields_requirement_controlled_by_woocommerce;
|
29 |
|
30 |
-
add_action( 'admin_init', array($this, 'updateSettingsAction') );
|
31 |
add_action( 'admin_menu', array($this, 'initAdminMenuAction'), 80);
|
32 |
-
|
33 |
add_action( 'init', array($this, 'init_polylang') );
|
34 |
add_action( 'admin_init', array($this, 'init_wpml') );
|
35 |
}
|
@@ -37,7 +37,7 @@
|
|
37 |
public function getSettingValue( $name, $default = null ) {
|
38 |
return $this->plugin->get_setting_value( $name, $default );
|
39 |
}
|
40 |
-
|
41 |
function init_polylang() {
|
42 |
if ( function_exists( 'pll_register_string' ) ) {
|
43 |
$settings = get_option('inspire_checkout_fields_settings', array() );
|
@@ -60,14 +60,14 @@
|
|
60 |
pll_register_string( $option_label, $option_label, __('Flexible Checkout Fields', 'flexible-checkout-fields' ) );
|
61 |
unset($tmp);
|
62 |
}
|
63 |
-
}
|
64 |
}
|
65 |
}
|
66 |
}
|
67 |
}
|
68 |
}
|
69 |
}
|
70 |
-
|
71 |
function init_wpml() {
|
72 |
if ( function_exists( 'icl_register_string' ) ) {
|
73 |
$icl_language_code = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : get_bloginfo('language');
|
@@ -76,7 +76,7 @@
|
|
76 |
foreach ( $settings as $section ) {
|
77 |
if ( is_array( $section ) ) {
|
78 |
foreach ( $section as $field ) {
|
79 |
-
if ( isset( $field['label'] ) && $field['label'] != '' ) {
|
80 |
icl_register_string( 'flexible-checkout-fields', $field['label'], $field['label'], false, $icl_language_code );
|
81 |
}
|
82 |
if ( isset( $field['placeholder'] ) && $field['placeholder'] != '' ) {
|
@@ -91,14 +91,14 @@
|
|
91 |
icl_register_string( 'flexible-checkout-fields', $option_label, $option_label, false, $icl_language_code );
|
92 |
unset($tmp);
|
93 |
}
|
94 |
-
}
|
95 |
}
|
96 |
}
|
97 |
}
|
98 |
-
}
|
99 |
}
|
100 |
}
|
101 |
-
|
102 |
/**
|
103 |
* add new menu to woocommerce function.
|
104 |
*
|
@@ -124,8 +124,8 @@
|
|
124 |
$countries = new WC_Countries();
|
125 |
$billing = $countries->get_address_fields($countries->get_base_country(), 'billing_');
|
126 |
$shipping = $countries->get_address_fields($countries->get_base_country(), 'shipping_');
|
127 |
-
|
128 |
-
if( empty( $settings ) || empty( $settings['order'] ) ) {
|
129 |
$order = array(
|
130 |
'order_comments' => array(
|
131 |
'type' => 'textarea',
|
@@ -133,7 +133,7 @@
|
|
133 |
'label' => __( 'Order Notes', 'flexible-checkout-fields' ),
|
134 |
'placeholder' => _x( 'Notes about your order, e.g. special notes for delivery.', 'placeholder', 'flexible-checkout-fields')
|
135 |
)
|
136 |
-
);
|
137 |
}
|
138 |
else {
|
139 |
$order = $settings['order'];
|
@@ -221,7 +221,7 @@
|
|
221 |
}
|
222 |
|
223 |
private function is_active_more_than_week() {
|
224 |
-
|
225 |
}
|
226 |
|
227 |
|
@@ -273,12 +273,12 @@
|
|
273 |
|
274 |
if ( current_user_can( 'manage_options' ) && ! empty( $_POST ) ) {
|
275 |
if ( !empty($_POST['option_page']) && in_array( $_POST['option_page'], array('inspire_checkout_fields_settings', 'inspire_checkout_fields_checkboxes') ) ) {
|
276 |
-
|
277 |
$nonce = $_REQUEST[self::SECURITY_NONCE_FIELD];
|
278 |
if ( ! wp_verify_nonce( $nonce, Flexible_Checkout_Fields_Settings::SECURITY_NONCE_NAME ) ) {
|
279 |
wp_die( __( 'Flexible Checkout Fields: security check error. Fields not saved!', 'flexible-checkout-fields' ) );
|
280 |
}
|
281 |
-
|
282 |
if ( !empty( $_POST[$this->plugin->get_namespace()] ) ) {
|
283 |
|
284 |
foreach ( $_POST[$this->plugin->get_namespace()] as $name => $value ) {
|
27 |
|
28 |
$this->fields_requirement_controlled_by_woocommerce = $fields_requirement_controlled_by_woocommerce;
|
29 |
|
30 |
+
add_action( 'admin_init', array($this, 'updateSettingsAction') );
|
31 |
add_action( 'admin_menu', array($this, 'initAdminMenuAction'), 80);
|
32 |
+
|
33 |
add_action( 'init', array($this, 'init_polylang') );
|
34 |
add_action( 'admin_init', array($this, 'init_wpml') );
|
35 |
}
|
37 |
public function getSettingValue( $name, $default = null ) {
|
38 |
return $this->plugin->get_setting_value( $name, $default );
|
39 |
}
|
40 |
+
|
41 |
function init_polylang() {
|
42 |
if ( function_exists( 'pll_register_string' ) ) {
|
43 |
$settings = get_option('inspire_checkout_fields_settings', array() );
|
60 |
pll_register_string( $option_label, $option_label, __('Flexible Checkout Fields', 'flexible-checkout-fields' ) );
|
61 |
unset($tmp);
|
62 |
}
|
63 |
+
}
|
64 |
}
|
65 |
}
|
66 |
}
|
67 |
}
|
68 |
}
|
69 |
}
|
70 |
+
|
71 |
function init_wpml() {
|
72 |
if ( function_exists( 'icl_register_string' ) ) {
|
73 |
$icl_language_code = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : get_bloginfo('language');
|
76 |
foreach ( $settings as $section ) {
|
77 |
if ( is_array( $section ) ) {
|
78 |
foreach ( $section as $field ) {
|
79 |
+
if ( isset( $field['label'] ) && $field['label'] != '' ) {
|
80 |
icl_register_string( 'flexible-checkout-fields', $field['label'], $field['label'], false, $icl_language_code );
|
81 |
}
|
82 |
if ( isset( $field['placeholder'] ) && $field['placeholder'] != '' ) {
|
91 |
icl_register_string( 'flexible-checkout-fields', $option_label, $option_label, false, $icl_language_code );
|
92 |
unset($tmp);
|
93 |
}
|
94 |
+
}
|
95 |
}
|
96 |
}
|
97 |
}
|
98 |
+
}
|
99 |
}
|
100 |
}
|
101 |
+
|
102 |
/**
|
103 |
* add new menu to woocommerce function.
|
104 |
*
|
124 |
$countries = new WC_Countries();
|
125 |
$billing = $countries->get_address_fields($countries->get_base_country(), 'billing_');
|
126 |
$shipping = $countries->get_address_fields($countries->get_base_country(), 'shipping_');
|
127 |
+
|
128 |
+
if( empty( $settings ) || empty( $settings['order'] ) ) {
|
129 |
$order = array(
|
130 |
'order_comments' => array(
|
131 |
'type' => 'textarea',
|
133 |
'label' => __( 'Order Notes', 'flexible-checkout-fields' ),
|
134 |
'placeholder' => _x( 'Notes about your order, e.g. special notes for delivery.', 'placeholder', 'flexible-checkout-fields')
|
135 |
)
|
136 |
+
);
|
137 |
}
|
138 |
else {
|
139 |
$order = $settings['order'];
|
221 |
}
|
222 |
|
223 |
private function is_active_more_than_week() {
|
224 |
+
|
225 |
}
|
226 |
|
227 |
|
273 |
|
274 |
if ( current_user_can( 'manage_options' ) && ! empty( $_POST ) ) {
|
275 |
if ( !empty($_POST['option_page']) && in_array( $_POST['option_page'], array('inspire_checkout_fields_settings', 'inspire_checkout_fields_checkboxes') ) ) {
|
276 |
+
|
277 |
$nonce = $_REQUEST[self::SECURITY_NONCE_FIELD];
|
278 |
if ( ! wp_verify_nonce( $nonce, Flexible_Checkout_Fields_Settings::SECURITY_NONCE_NAME ) ) {
|
279 |
wp_die( __( 'Flexible Checkout Fields: security check error. Fields not saved!', 'flexible-checkout-fields' ) );
|
280 |
}
|
281 |
+
|
282 |
if ( !empty( $_POST[$this->plugin->get_namespace()] ) ) {
|
283 |
|
284 |
foreach ( $_POST[$this->plugin->get_namespace()] as $name => $value ) {
|
classes/views/settings-fields.php
CHANGED
@@ -53,7 +53,7 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
53 |
name="woocommerce_checkout_fields_field_type">
|
54 |
<?php foreach ( $checkout_field_type as $key => $value ): ?>
|
55 |
<?php if ( $key == 'checkbox' ) continue; ?>
|
56 |
-
<option value="<?php echo $key ?>"><?php echo $value['name'] ?></option>
|
57 |
<?php endforeach; ?>
|
58 |
</select>
|
59 |
</div>
|
@@ -144,7 +144,7 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
144 |
<div id="post-body" class="fields-container">
|
145 |
<h3><?php _e( 'Section Fields', 'flexible-checkout-fields' ) ?><?php //echo $checkout_field_type_name[$key] ?></h3>
|
146 |
|
147 |
-
<ul class="fields menu sortable" id="<?php echo $key; ?>">
|
148 |
<?php foreach ( $fields as $name => $field ) : ?>
|
149 |
<?php
|
150 |
if ( empty( $settings[ $key ][ $name ]['short_name'] ) ) {
|
@@ -168,7 +168,7 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
168 |
}
|
169 |
?>
|
170 |
<li
|
171 |
-
class="field-item menu-item<?php if ( ! $field_visible ): ?> field-hidden<?php endif; ?> fcf-field-<?php echo $field_type; ?>"
|
172 |
data-qa-id="field-item"
|
173 |
data-qa-id2="<?php if ( isset( $settings[ $key ][ $name ]['label'] ) ): echo esc_attr( $settings[ $key ][ $name ]['label'] ); elseif ( isset( $field['label'] ) ): echo esc_attr( $field['label'] ); endif; ?>"
|
174 |
>
|
@@ -177,14 +177,14 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
177 |
<?php if ( ! empty( $settings[ $key ][ $name ]['custom_field'] ) && $settings[ $key ][ $name ]['custom_field'] == '1' ): ?>
|
178 |
<input class="field_custom_field"
|
179 |
type="hidden"
|
180 |
-
name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name
|
181 |
value="1"
|
182 |
data-qa-id="field-custom-field"
|
183 |
/>
|
184 |
<?php else : ?>
|
185 |
<input class="field_custom_field"
|
186 |
type="hidden"
|
187 |
-
name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name
|
188 |
value="0"
|
189 |
data-qa-id="field-custom-field"
|
190 |
/>
|
@@ -193,15 +193,15 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
193 |
<input
|
194 |
class="field_name"
|
195 |
type="hidden"
|
196 |
-
name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name ?>][name]"
|
197 |
-
value="<?php echo $name ?>"
|
198 |
data-qa-id="field-name"
|
199 |
/>
|
200 |
|
201 |
<span class="item-title">
|
202 |
<span class="item-type">
|
203 |
<?php if ( isset( $checkout_field_type[$field_type] ) ) : ?>
|
204 |
-
<?php echo $checkout_field_type[$field_type]['name']; ?>
|
205 |
<?php else : ?>
|
206 |
<?php echo __( ucfirst( $field_type ), 'woocommerce' ); ?>
|
207 |
<?php endif; ?>
|
@@ -209,7 +209,7 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
209 |
<?php if ( ! empty( $field['label'] ) ): ?>
|
210 |
<?php echo esc_html( strip_tags( $field['label'] ) ); ?>
|
211 |
<?php else: ?>
|
212 |
-
<?php echo $name ?>
|
213 |
<?php endif; ?>
|
214 |
|
215 |
<?php if ( $field_required ): ?> *<?php endif; ?>
|
@@ -227,14 +227,14 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
227 |
class="nav-tab nav-tab-active"><?php _e( 'General', 'flexible-checkout-fields' ); ?></a>
|
228 |
<a class="nav-tab"
|
229 |
href="#appearance"><?php _e( 'Appearance', 'flexible-checkout-fields' ); ?></a>
|
230 |
-
<a class="nav-tab display-options display-options-<?php echo $field_type; ?>"
|
231 |
href="#display-options"><?php _e( 'Display On', 'flexible-checkout-fields' ); ?></a>
|
232 |
<?php
|
233 |
$additional_tabs = apply_filters( 'flexible_checkout_fields_field_tabs', array() );
|
234 |
foreach ( $additional_tabs as $additional_tab ) {
|
235 |
?>
|
236 |
<a class="nav-tab"
|
237 |
-
href="#<?php echo $additional_tab['hash']; ?>"><?php echo $additional_tab['title']; ?></a>
|
238 |
<?php
|
239 |
}
|
240 |
?>
|
@@ -251,14 +251,14 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
251 |
|
252 |
<div>
|
253 |
<input type="hidden"
|
254 |
-
name="inspire_checkout_fields[settings][<?php echo $key
|
255 |
value="1"
|
256 |
/>
|
257 |
|
258 |
<label>
|
259 |
<input class="field_visible"
|
260 |
type="checkbox"
|
261 |
-
name="inspire_checkout_fields[settings][<?php echo $key
|
262 |
value="0" <?php if ( $field_visible ): ?> checked<?php endif; ?>
|
263 |
data-qa-id="field-visible"
|
264 |
/>
|
@@ -293,15 +293,15 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
293 |
$field['class'] = array( 'form-row' );
|
294 |
}
|
295 |
?>
|
296 |
-
<div style="<?php echo $style; ?>">
|
297 |
<input type="hidden"
|
298 |
-
name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name ?>][required]"
|
299 |
value="0"
|
300 |
/>
|
301 |
<label>
|
302 |
<input class="field_required"
|
303 |
type="checkbox"
|
304 |
-
name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name ?>][required]"
|
305 |
value="1" <?php echo $checked; ?> <?php echo $disabled; ?>
|
306 |
data-qa-id="field-required"
|
307 |
/>
|
@@ -309,16 +309,16 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
309 |
</label>
|
310 |
<?php if ( $requirement_controlled_by_woocommerce ) : ?>
|
311 |
<?php $tip = __( 'Requirement of this field is controlled by WooCommerce and cannot be changed.', 'flexible-checkout-fields' ); ?>
|
312 |
-
<span class="woocommerce-help-tip" data-tip="<?php echo $tip;?>"></span>
|
313 |
<?php endif; ?>
|
314 |
</div>
|
315 |
|
316 |
-
<div class="element_<?php echo $name ?> field-type-label">
|
317 |
|
318 |
-
<label for="label_<?php echo $name ?>"><?php _e( 'Label', 'flexible-checkout-fields' ) ?></label>
|
319 |
|
320 |
-
<textarea data-field="<?php echo $name; ?>" class="fcf_label field-name field_label" id="label_<?php echo $name ?>" class="field-name"
|
321 |
-
name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name ?>][label]"
|
322 |
data-qa-id="field-name"
|
323 |
><?php if ( isset( $settings[ $key ][ $name ]['label'] ) ): echo esc_html( $settings[ $key ][ $name ]['label'] );
|
324 |
elseif ( isset( $field['label'] ) ): echo esc_html( $field['label'] ); endif; ?></textarea>
|
@@ -332,7 +332,7 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
332 |
<?php endif; ?>
|
333 |
<div class="field-type-name">
|
334 |
|
335 |
-
<label for="short_name_<?php echo $name ?>"><?php _e( 'Name', 'flexible-checkout-fields' ) ?></label>
|
336 |
|
337 |
<?php $short_name_value = ''; ?>
|
338 |
<?php if ( isset( $settings[ $key ][ $name ]['short_name'] ) ): $short_name_value = esc_attr( $settings[ $key ][ $name ]['short_name'] ); elseif ( isset( $field['short_name'] ) ): $short_name_value = $field['short_name']; endif; ?>
|
@@ -341,7 +341,7 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
341 |
required <?php echo $short_name_disabled; ?>
|
342 |
class="short_name field_short_name"
|
343 |
type="text"
|
344 |
-
name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name ?>][short_name]" value="<?php echo $short_name_value; ?>"
|
345 |
data-qa-id="field-short-nem"
|
346 |
/>
|
347 |
|
@@ -349,17 +349,17 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
349 |
|
350 |
</div>
|
351 |
|
352 |
-
<div class="field-validation field-validation-<?php echo $field_type; ?>">
|
353 |
|
354 |
-
<label for="validation_<?php echo $name ?>"><?php _e( 'Validation', 'flexible-checkout-fields' ) ?></label>
|
355 |
|
356 |
<?php $validation_value = ''; ?>
|
357 |
<?php if ( isset( $settings[ $key ][ $name ]['validation'] ) ): $validation_value = esc_attr( $settings[ $key ][ $name ]['validation'] ); elseif ( isset( $field['validation'] ) ): $short_name_value = $field['validation']; endif; ?>
|
358 |
|
359 |
-
<select class="validation field_validation" type="text" name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name ?>][validation]" data-qa-id="field-validation">
|
360 |
<?php foreach ( $validation_options as $option_value => $option ) : ?>
|
361 |
<?php if ( $is_custom_field && $option_value == '' ) continue; ?>
|
362 |
-
<option value="<?php echo $option_value; ?>" <?php echo selected( $validation_value, $option_value ); ?>><?php echo $option; ?></option>
|
363 |
<?php endforeach; ?>
|
364 |
</select>
|
365 |
<p class="description"><?php echo __( 'For Post Code validation works only with country.', 'flexible-checkout-fields' ); ?></p>
|
@@ -375,13 +375,13 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
375 |
?>
|
376 |
<div class="element-option<?php if ( isset( $checkout_field_type[ $settings[ $key ][ $name ]['type'] ]['has_options'] ) && $checkout_field_type[ $settings[ $key ][ $name ]['type'] ]['has_options'] )
|
377 |
echo " show" ?>">
|
378 |
-
<label for="option_<?php echo $name ?>"><?php _e( 'Options', 'flexible-checkout-fields' ) ?></label>
|
379 |
|
380 |
<textarea class="field_option"
|
381 |
-
data-field="<?php echo $name; ?>" class="fcf_options"
|
382 |
-
id="option_<?php echo $name ?>"
|
383 |
data-qa-id="field-option"
|
384 |
-
name="inspire_checkout_fields[settings][<?php echo $key
|
385 |
<p><?php _e( 'Format: <code>Value : Name</code>. Value will be in the code, name will be visible to the user. One option per line. Example:<br /><code>woman : I am a woman</code><br /><code>man : I am a man</code>', 'flexible-checkout-fields' ) ?></p>
|
386 |
</div>
|
387 |
<?php endif; ?>
|
@@ -389,17 +389,17 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
389 |
<?php if ( $is_custom_field ): ?>
|
390 |
<?php do_action( 'flexible_checkout_fields_settings_html', $key, $name, $settings ); ?>
|
391 |
<div class="field_type">
|
392 |
-
<label for="type_<?php echo $name ?>"><?php _e( 'Field Type', 'flexible-checkout-fields' ) ?></label>
|
393 |
|
394 |
-
<select class="field_type" id="field_type_<?php echo $name ?>"
|
395 |
-
name="inspire_checkout_fields[settings][<?php echo $key
|
396 |
disabled
|
397 |
data-qa-id="field-type"
|
398 |
>
|
399 |
<?php foreach ( $checkout_field_type as $type_key => $value ): ?>
|
400 |
-
<option value="<?php echo $type_key ?>"<?php if ( $settings[ $key ][ $name ]['type'] == $type_key ) {
|
401 |
echo " selected";
|
402 |
-
} ?>><?php echo $value['name'] ?></option>
|
403 |
<?php endforeach; ?>
|
404 |
</select>
|
405 |
</div>
|
@@ -407,9 +407,9 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
407 |
<?php if ( !empty( $field['type'] ) ) : ?>
|
408 |
<input
|
409 |
type="hidden"
|
410 |
-
id="field_type_<?php echo $name ?>"
|
411 |
-
name="inspire_checkout_fields[settings][<?php echo $key
|
412 |
-
value="<?php echo $field['type']; ?>"
|
413 |
data-qa-id="field-type"
|
414 |
/>
|
415 |
<?php endif; ?>
|
@@ -424,7 +424,7 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
424 |
$required = ' required';
|
425 |
}
|
426 |
?>
|
427 |
-
<label for="placeholder_<?php echo $name ?>"><?php if ( $is_custom_field && isset( $checkout_field_type[ $settings[ $key ][ $name ]['type'] ]['placeholder_label'] ) ): ?><?php echo $checkout_field_type[ $settings[ $key ][ $name ]['type'] ]['placeholder_label']; ?><?php else: ?><?php _e( 'Placeholder', 'flexible-checkout-fields' ) ?><?php endif; ?></label>
|
428 |
|
429 |
<?php
|
430 |
$disabled = '';
|
@@ -436,14 +436,14 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
436 |
$disabled = 'disabled';
|
437 |
$tip = __( 'This field is address locale dependent and cannot be modified.', 'flexible-checkout-fields' );
|
438 |
?>
|
439 |
-
<span class="woocommerce-help-tip" data-tip="<?php echo $tip
|
440 |
<?php
|
441 |
}
|
442 |
?>
|
443 |
|
444 |
<input class="field_placeholder"
|
445 |
-
<?php echo $disabled; ?> type="text" id="placeholder_<?php echo $name ?>"
|
446 |
-
name="inspire_checkout_fields[settings][<?php echo $key
|
447 |
value="<?php if ( ! empty( $settings[ $key ][ $name ]['placeholder'] ) ): echo esc_attr( $settings[ $key ][ $name ]['placeholder'] );
|
448 |
else: echo isset( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : ''; endif; ?>" <?php echo $required; ?>
|
449 |
data-qa-id="field-placeholder"
|
@@ -451,12 +451,12 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
451 |
</div>
|
452 |
<?php endif; ?>
|
453 |
<div class="field-class">
|
454 |
-
<label for="class_<?php echo $name ?>"><?php _e( 'CSS Class', 'flexible-checkout-fields' ) ?></label>
|
455 |
-
<input class="field_class" type="text" id="class_<?php echo $name ?>"
|
456 |
-
name="inspire_checkout_fields[settings][<?php echo $key
|
457 |
-
value="<?php if ( ! empty( $settings[ $key ][ $name ]['class'] ) ): echo $settings[ $key ][ $name ]['class'];
|
458 |
else: if ( ! empty( $field['class'] ) ) {
|
459 |
-
echo implode( ' ', $field['class'] );
|
460 |
} endif; ?>"
|
461 |
data-qa-id="field-class"
|
462 |
/>
|
@@ -471,7 +471,7 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
471 |
|
472 |
<?php foreach ( $fields_display_on as $display_on_field_key => $display_on_field ) : ?>
|
473 |
<?php if ( $display_on_field_key == 'address' && !in_array( $key, array( 'billing', 'shipping' ) ) ) continue; ?>
|
474 |
-
<div class="fcf-display-on-<?php echo $display_on_field_key; ?>">
|
475 |
<?php
|
476 |
$checked = ' checked';
|
477 |
$style = '';
|
@@ -482,13 +482,13 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
482 |
}
|
483 |
?>
|
484 |
<input type="hidden"
|
485 |
-
name="inspire_checkout_fields[settings][<?php echo $key
|
486 |
value="0"/>
|
487 |
|
488 |
<label>
|
489 |
<input class="field_required"
|
490 |
type="checkbox"
|
491 |
-
name="inspire_checkout_fields[settings][<?php echo $key
|
492 |
value="1" <?php echo $checked; ?>
|
493 |
data-qa-id="field-display-on-address"
|
494 |
/>
|
@@ -501,7 +501,7 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
501 |
|
502 |
<?php do_action( 'flexible_checkout_fields_field_tabs_content', $key, $name, $field, $settings ); ?>
|
503 |
<?php if ( $is_custom_field ) : ?>
|
504 |
-
<a class="remove-field" data-field="<?php echo $name; ?>"
|
505 |
href="#"><?php _e( 'Delete Field', 'flexible-checkout-fields' ) ?></a>
|
506 |
<?php endif; ?>
|
507 |
</div>
|
@@ -658,7 +658,7 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
658 |
$additional_tabs = apply_filters( 'flexible_checkout_fields_field_tabs', array() );
|
659 |
foreach ( $additional_tabs as $additional_tab ) {
|
660 |
?>
|
661 |
-
html += '<a class="nav-tab" href="#<?php echo $additional_tab['hash']; ?>"><?php echo $additional_tab['title']; ?></a>';
|
662 |
<?php
|
663 |
}
|
664 |
?>
|
@@ -667,8 +667,8 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
667 |
|
668 |
<?php foreach ( $checkout_field_type as $key => $value ) : ?>
|
669 |
<?php if ( isset( $value['description'] ) ) : ?>
|
670 |
-
html += '<div class="element-<?php echo $key; ?>-description">';
|
671 |
-
html += '<p class="description"><?php echo $value['description']; ?></p>';
|
672 |
html += '</div>';
|
673 |
<?php endif; ?>
|
674 |
<?php endforeach; ?>
|
@@ -708,7 +708,7 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
708 |
<?php unset( $validation_options[''] ); ?>
|
709 |
<?php foreach ( $validation_options as $option_value => $option ) : ?>
|
710 |
<?php if ( $option_value == '' ) continue; ?>
|
711 |
-
html += ' <option value="<?php echo $option_value; ?>"><?php echo $option; ?></option>';
|
712 |
<?php endforeach; ?>
|
713 |
html += ' </select>';
|
714 |
html += ' <p class="description"><?php echo __( 'For Post Code validation works only with country.', 'flexible-checkout-fields' ); ?></p>';
|
@@ -739,11 +739,11 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
739 |
|
740 |
<?php foreach ( $fields_display_on as $display_on_field_key => $display_on_field ) : ?>
|
741 |
<?php if ( $display_on_field_key === 'address' && !in_array( $current_tab, array( 'fields_billing', 'fields_shipping' ) ) ) continue; ?>
|
742 |
-
html += '<div class=" fcf-display-on-<?php echo $display_on_field_key; ?>">';
|
743 |
-
html += '<input type="hidden" name="inspire_checkout_fields[settings][' + field_section + '][' + field_slug + '][display_on_<?php echo $display_on_field_key; ?>]" value="0"/>';
|
744 |
html += '<label>';
|
745 |
-
html += '<input class="field_required" type="checkbox" name="inspire_checkout_fields[settings][' + field_section + '][' + field_slug + '][display_on_<?php echo $display_on_field_key; ?>]" value="1" checked data-qa-id="field-display-on-address" />';
|
746 |
-
html += '<?php echo $display_on_field['label']; ?>';
|
747 |
html += '</label>';
|
748 |
html += '</div>';
|
749 |
<?php endforeach; ?>
|
@@ -941,8 +941,8 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
|
|
941 |
|
942 |
var type = {
|
943 |
<?php foreach ( $checkout_field_type as $key => $value ) : ?>
|
944 |
-
<?php echo $key; ?>:
|
945 |
-
'<?php echo $value['name']; ?>',
|
946 |
<?php endforeach; ?>
|
947 |
}
|
948 |
;
|
53 |
name="woocommerce_checkout_fields_field_type">
|
54 |
<?php foreach ( $checkout_field_type as $key => $value ): ?>
|
55 |
<?php if ( $key == 'checkbox' ) continue; ?>
|
56 |
+
<option value="<?php echo esc_attr($key); ?>"><?php echo esc_attr($value['name']); ?></option>
|
57 |
<?php endforeach; ?>
|
58 |
</select>
|
59 |
</div>
|
144 |
<div id="post-body" class="fields-container">
|
145 |
<h3><?php _e( 'Section Fields', 'flexible-checkout-fields' ) ?><?php //echo $checkout_field_type_name[$key] ?></h3>
|
146 |
|
147 |
+
<ul class="fields menu sortable" id="<?php echo esc_attr($key); ?>">
|
148 |
<?php foreach ( $fields as $name => $field ) : ?>
|
149 |
<?php
|
150 |
if ( empty( $settings[ $key ][ $name ]['short_name'] ) ) {
|
168 |
}
|
169 |
?>
|
170 |
<li
|
171 |
+
class="field-item menu-item<?php if ( ! $field_visible ): ?> field-hidden<?php endif; ?> fcf-field-<?php echo esc_attr($field_type); ?>"
|
172 |
data-qa-id="field-item"
|
173 |
data-qa-id2="<?php if ( isset( $settings[ $key ][ $name ]['label'] ) ): echo esc_attr( $settings[ $key ][ $name ]['label'] ); elseif ( isset( $field['label'] ) ): echo esc_attr( $field['label'] ); endif; ?>"
|
174 |
>
|
177 |
<?php if ( ! empty( $settings[ $key ][ $name ]['custom_field'] ) && $settings[ $key ][ $name ]['custom_field'] == '1' ): ?>
|
178 |
<input class="field_custom_field"
|
179 |
type="hidden"
|
180 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key); ?>][<?php echo esc_attr($name) ?>][custom_field]"
|
181 |
value="1"
|
182 |
data-qa-id="field-custom-field"
|
183 |
/>
|
184 |
<?php else : ?>
|
185 |
<input class="field_custom_field"
|
186 |
type="hidden"
|
187 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key); ?>][<?php echo esc_attr($name) ?>][custom_field]"
|
188 |
value="0"
|
189 |
data-qa-id="field-custom-field"
|
190 |
/>
|
193 |
<input
|
194 |
class="field_name"
|
195 |
type="hidden"
|
196 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key); ?>][<?php echo esc_attr($name); ?>][name]"
|
197 |
+
value="<?php echo esc_html($name); ?>"
|
198 |
data-qa-id="field-name"
|
199 |
/>
|
200 |
|
201 |
<span class="item-title">
|
202 |
<span class="item-type">
|
203 |
<?php if ( isset( $checkout_field_type[$field_type] ) ) : ?>
|
204 |
+
<?php echo esc_attr($checkout_field_type[$field_type]['name']); ?>
|
205 |
<?php else : ?>
|
206 |
<?php echo __( ucfirst( $field_type ), 'woocommerce' ); ?>
|
207 |
<?php endif; ?>
|
209 |
<?php if ( ! empty( $field['label'] ) ): ?>
|
210 |
<?php echo esc_html( strip_tags( $field['label'] ) ); ?>
|
211 |
<?php else: ?>
|
212 |
+
<?php echo esc_html($name) ?>
|
213 |
<?php endif; ?>
|
214 |
|
215 |
<?php if ( $field_required ): ?> *<?php endif; ?>
|
227 |
class="nav-tab nav-tab-active"><?php _e( 'General', 'flexible-checkout-fields' ); ?></a>
|
228 |
<a class="nav-tab"
|
229 |
href="#appearance"><?php _e( 'Appearance', 'flexible-checkout-fields' ); ?></a>
|
230 |
+
<a class="nav-tab display-options display-options-<?php echo esc_attr($field_type); ?>"
|
231 |
href="#display-options"><?php _e( 'Display On', 'flexible-checkout-fields' ); ?></a>
|
232 |
<?php
|
233 |
$additional_tabs = apply_filters( 'flexible_checkout_fields_field_tabs', array() );
|
234 |
foreach ( $additional_tabs as $additional_tab ) {
|
235 |
?>
|
236 |
<a class="nav-tab"
|
237 |
+
href="#<?php echo esc_attr($additional_tab['hash']); ?>"><?php echo esc_attr($additional_tab['title']); ?></a>
|
238 |
<?php
|
239 |
}
|
240 |
?>
|
251 |
|
252 |
<div>
|
253 |
<input type="hidden"
|
254 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][visible]"
|
255 |
value="1"
|
256 |
/>
|
257 |
|
258 |
<label>
|
259 |
<input class="field_visible"
|
260 |
type="checkbox"
|
261 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][visible]"
|
262 |
value="0" <?php if ( $field_visible ): ?> checked<?php endif; ?>
|
263 |
data-qa-id="field-visible"
|
264 |
/>
|
293 |
$field['class'] = array( 'form-row' );
|
294 |
}
|
295 |
?>
|
296 |
+
<div style="<?php echo esc_attr($style); ?>">
|
297 |
<input type="hidden"
|
298 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][required]"
|
299 |
value="0"
|
300 |
/>
|
301 |
<label>
|
302 |
<input class="field_required"
|
303 |
type="checkbox"
|
304 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][required]"
|
305 |
value="1" <?php echo $checked; ?> <?php echo $disabled; ?>
|
306 |
data-qa-id="field-required"
|
307 |
/>
|
309 |
</label>
|
310 |
<?php if ( $requirement_controlled_by_woocommerce ) : ?>
|
311 |
<?php $tip = __( 'Requirement of this field is controlled by WooCommerce and cannot be changed.', 'flexible-checkout-fields' ); ?>
|
312 |
+
<span class="woocommerce-help-tip" data-tip="<?php echo esc_attr($tip);?>"></span>
|
313 |
<?php endif; ?>
|
314 |
</div>
|
315 |
|
316 |
+
<div class="element_<?php echo esc_attr($name) ?> field-type-label">
|
317 |
|
318 |
+
<label for="label_<?php echo esc_attr($name) ?>"><?php _e( 'Label', 'flexible-checkout-fields' ) ?></label>
|
319 |
|
320 |
+
<textarea data-field="<?php echo esc_attr($name); ?>" class="fcf_label field-name field_label" id="label_<?php echo esc_attr($name) ?>" class="field-name"
|
321 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][label]"
|
322 |
data-qa-id="field-name"
|
323 |
><?php if ( isset( $settings[ $key ][ $name ]['label'] ) ): echo esc_html( $settings[ $key ][ $name ]['label'] );
|
324 |
elseif ( isset( $field['label'] ) ): echo esc_html( $field['label'] ); endif; ?></textarea>
|
332 |
<?php endif; ?>
|
333 |
<div class="field-type-name">
|
334 |
|
335 |
+
<label for="short_name_<?php echo esc_attr($name); ?>"><?php _e( 'Name', 'flexible-checkout-fields' ) ?></label>
|
336 |
|
337 |
<?php $short_name_value = ''; ?>
|
338 |
<?php if ( isset( $settings[ $key ][ $name ]['short_name'] ) ): $short_name_value = esc_attr( $settings[ $key ][ $name ]['short_name'] ); elseif ( isset( $field['short_name'] ) ): $short_name_value = $field['short_name']; endif; ?>
|
341 |
required <?php echo $short_name_disabled; ?>
|
342 |
class="short_name field_short_name"
|
343 |
type="text"
|
344 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][short_name]" value="<?php echo esc_attr($short_name_value); ?>"
|
345 |
data-qa-id="field-short-nem"
|
346 |
/>
|
347 |
|
349 |
|
350 |
</div>
|
351 |
|
352 |
+
<div class="field-validation field-validation-<?php echo esc_attr($field_type); ?>">
|
353 |
|
354 |
+
<label for="validation_<?php echo esc_attr($name) ?>"><?php _e( 'Validation', 'flexible-checkout-fields' ) ?></label>
|
355 |
|
356 |
<?php $validation_value = ''; ?>
|
357 |
<?php if ( isset( $settings[ $key ][ $name ]['validation'] ) ): $validation_value = esc_attr( $settings[ $key ][ $name ]['validation'] ); elseif ( isset( $field['validation'] ) ): $short_name_value = $field['validation']; endif; ?>
|
358 |
|
359 |
+
<select class="validation field_validation" type="text" name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][validation]" data-qa-id="field-validation">
|
360 |
<?php foreach ( $validation_options as $option_value => $option ) : ?>
|
361 |
<?php if ( $is_custom_field && $option_value == '' ) continue; ?>
|
362 |
+
<option value="<?php echo esc_attr($option_value); ?>" <?php echo selected( $validation_value, $option_value ); ?>><?php echo esc_attr($option); ?></option>
|
363 |
<?php endforeach; ?>
|
364 |
</select>
|
365 |
<p class="description"><?php echo __( 'For Post Code validation works only with country.', 'flexible-checkout-fields' ); ?></p>
|
375 |
?>
|
376 |
<div class="element-option<?php if ( isset( $checkout_field_type[ $settings[ $key ][ $name ]['type'] ]['has_options'] ) && $checkout_field_type[ $settings[ $key ][ $name ]['type'] ]['has_options'] )
|
377 |
echo " show" ?>">
|
378 |
+
<label for="option_<?php echo esc_attr($name); ?>"><?php _e( 'Options', 'flexible-checkout-fields' ) ?></label>
|
379 |
|
380 |
<textarea class="field_option"
|
381 |
+
data-field="<?php echo esc_attr($name); ?>" class="fcf_options"
|
382 |
+
id="option_<?php echo esc_attr($name); ?>"
|
383 |
data-qa-id="field-option"
|
384 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][option]" <?php echo $required; ?>><?php echo isset( $settings[ $key ][ $name ]['option'] ) ? esc_textarea( stripslashes( $settings[ $key ][ $name ]['option'] ) ) : ''; ?></textarea>
|
385 |
<p><?php _e( 'Format: <code>Value : Name</code>. Value will be in the code, name will be visible to the user. One option per line. Example:<br /><code>woman : I am a woman</code><br /><code>man : I am a man</code>', 'flexible-checkout-fields' ) ?></p>
|
386 |
</div>
|
387 |
<?php endif; ?>
|
389 |
<?php if ( $is_custom_field ): ?>
|
390 |
<?php do_action( 'flexible_checkout_fields_settings_html', $key, $name, $settings ); ?>
|
391 |
<div class="field_type">
|
392 |
+
<label for="type_<?php echo esc_attr($name); ?>"><?php _e( 'Field Type', 'flexible-checkout-fields' ) ?></label>
|
393 |
|
394 |
+
<select class="field_type" id="field_type_<?php echo esc_attr($name); ?>"
|
395 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][type]"
|
396 |
disabled
|
397 |
data-qa-id="field-type"
|
398 |
>
|
399 |
<?php foreach ( $checkout_field_type as $type_key => $value ): ?>
|
400 |
+
<option value="<?php echo esc_attr($type_key); ?>"<?php if ( $settings[ $key ][ $name ]['type'] == $type_key ) {
|
401 |
echo " selected";
|
402 |
+
} ?>><?php echo esc_html($value['name']) ?></option>
|
403 |
<?php endforeach; ?>
|
404 |
</select>
|
405 |
</div>
|
407 |
<?php if ( !empty( $field['type'] ) ) : ?>
|
408 |
<input
|
409 |
type="hidden"
|
410 |
+
id="field_type_<?php echo esc_attr($name); ?>"
|
411 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][type]"
|
412 |
+
value="<?php echo esc_attr($field['type']); ?>"
|
413 |
data-qa-id="field-type"
|
414 |
/>
|
415 |
<?php endif; ?>
|
424 |
$required = ' required';
|
425 |
}
|
426 |
?>
|
427 |
+
<label for="placeholder_<?php echo esc_attr($name); ?>"><?php if ( $is_custom_field && isset( $checkout_field_type[ $settings[ $key ][ $name ]['type'] ]['placeholder_label'] ) ): ?><?php echo $checkout_field_type[ $settings[ $key ][ $name ]['type'] ]['placeholder_label']; ?><?php else: ?><?php _e( 'Placeholder', 'flexible-checkout-fields' ) ?><?php endif; ?></label>
|
428 |
|
429 |
<?php
|
430 |
$disabled = '';
|
436 |
$disabled = 'disabled';
|
437 |
$tip = __( 'This field is address locale dependent and cannot be modified.', 'flexible-checkout-fields' );
|
438 |
?>
|
439 |
+
<span class="woocommerce-help-tip" data-tip="<?php echo esc_attr($tip); ?>"></span>
|
440 |
<?php
|
441 |
}
|
442 |
?>
|
443 |
|
444 |
<input class="field_placeholder"
|
445 |
+
<?php echo $disabled; ?> type="text" id="placeholder_<?php echo esc_attr($name); ?>"
|
446 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][placeholder]"
|
447 |
value="<?php if ( ! empty( $settings[ $key ][ $name ]['placeholder'] ) ): echo esc_attr( $settings[ $key ][ $name ]['placeholder'] );
|
448 |
else: echo isset( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : ''; endif; ?>" <?php echo $required; ?>
|
449 |
data-qa-id="field-placeholder"
|
451 |
</div>
|
452 |
<?php endif; ?>
|
453 |
<div class="field-class">
|
454 |
+
<label for="class_<?php echo esc_attr($name); ?>"><?php _e( 'CSS Class', 'flexible-checkout-fields' ) ?></label>
|
455 |
+
<input class="field_class" type="text" id="class_<?php echo esc_attr($name); ?>"
|
456 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][class]"
|
457 |
+
value="<?php if ( ! empty( $settings[ $key ][ $name ]['class'] ) ): echo esc_attr($settings[ $key ][ $name ]['class']);
|
458 |
else: if ( ! empty( $field['class'] ) ) {
|
459 |
+
echo esc_attr( implode( ' ', $field['class'] ) );
|
460 |
} endif; ?>"
|
461 |
data-qa-id="field-class"
|
462 |
/>
|
471 |
|
472 |
<?php foreach ( $fields_display_on as $display_on_field_key => $display_on_field ) : ?>
|
473 |
<?php if ( $display_on_field_key == 'address' && !in_array( $key, array( 'billing', 'shipping' ) ) ) continue; ?>
|
474 |
+
<div class="fcf-display-on-<?php echo esc_attr($display_on_field_key); ?>">
|
475 |
<?php
|
476 |
$checked = ' checked';
|
477 |
$style = '';
|
482 |
}
|
483 |
?>
|
484 |
<input type="hidden"
|
485 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][display_on_<?php echo $display_on_field_key; ?>]"
|
486 |
value="0"/>
|
487 |
|
488 |
<label>
|
489 |
<input class="field_required"
|
490 |
type="checkbox"
|
491 |
+
name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][display_on_<?php echo $display_on_field_key; ?>]"
|
492 |
value="1" <?php echo $checked; ?>
|
493 |
data-qa-id="field-display-on-address"
|
494 |
/>
|
501 |
|
502 |
<?php do_action( 'flexible_checkout_fields_field_tabs_content', $key, $name, $field, $settings ); ?>
|
503 |
<?php if ( $is_custom_field ) : ?>
|
504 |
+
<a class="remove-field" data-field="<?php echo esc_attr($name); ?>"
|
505 |
href="#"><?php _e( 'Delete Field', 'flexible-checkout-fields' ) ?></a>
|
506 |
<?php endif; ?>
|
507 |
</div>
|
658 |
$additional_tabs = apply_filters( 'flexible_checkout_fields_field_tabs', array() );
|
659 |
foreach ( $additional_tabs as $additional_tab ) {
|
660 |
?>
|
661 |
+
html += '<a class="nav-tab" href="#<?php echo esc_attr($additional_tab['hash']); ?>"><?php echo esc_html($additional_tab['title']); ?></a>';
|
662 |
<?php
|
663 |
}
|
664 |
?>
|
667 |
|
668 |
<?php foreach ( $checkout_field_type as $key => $value ) : ?>
|
669 |
<?php if ( isset( $value['description'] ) ) : ?>
|
670 |
+
html += '<div class="element-<?php echo esc_attr($key); ?>-description">';
|
671 |
+
html += '<p class="description"><?php echo esc_html($value['description']); ?></p>';
|
672 |
html += '</div>';
|
673 |
<?php endif; ?>
|
674 |
<?php endforeach; ?>
|
708 |
<?php unset( $validation_options[''] ); ?>
|
709 |
<?php foreach ( $validation_options as $option_value => $option ) : ?>
|
710 |
<?php if ( $option_value == '' ) continue; ?>
|
711 |
+
html += ' <option value="<?php echo esc_attr($option_value); ?>"><?php echo esc_html($option); ?></option>';
|
712 |
<?php endforeach; ?>
|
713 |
html += ' </select>';
|
714 |
html += ' <p class="description"><?php echo __( 'For Post Code validation works only with country.', 'flexible-checkout-fields' ); ?></p>';
|
739 |
|
740 |
<?php foreach ( $fields_display_on as $display_on_field_key => $display_on_field ) : ?>
|
741 |
<?php if ( $display_on_field_key === 'address' && !in_array( $current_tab, array( 'fields_billing', 'fields_shipping' ) ) ) continue; ?>
|
742 |
+
html += '<div class=" fcf-display-on-<?php echo esc_attr($display_on_field_key); ?>">';
|
743 |
+
html += '<input type="hidden" name="inspire_checkout_fields[settings][' + field_section + '][' + field_slug + '][display_on_<?php echo esc_attr($display_on_field_key); ?>]" value="0"/>';
|
744 |
html += '<label>';
|
745 |
+
html += '<input class="field_required" type="checkbox" name="inspire_checkout_fields[settings][' + field_section + '][' + field_slug + '][display_on_<?php echo esc_attr($display_on_field_key); ?>]" value="1" checked data-qa-id="field-display-on-address" />';
|
746 |
+
html += '<?php echo esc_attr($display_on_field['label']); ?>';
|
747 |
html += '</label>';
|
748 |
html += '</div>';
|
749 |
<?php endforeach; ?>
|
941 |
|
942 |
var type = {
|
943 |
<?php foreach ( $checkout_field_type as $key => $value ) : ?>
|
944 |
+
<?php echo esc_attr($key); ?>:
|
945 |
+
'<?php echo esc_attr($value['name']); ?>',
|
946 |
<?php endforeach; ?>
|
947 |
}
|
948 |
;
|
flexible-checkout-fields.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Flexible Checkout Fields
|
4 |
Plugin URI: https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/
|
5 |
Description: Manage your WooCommerce checkout fields. Change order, labels, placeholders and add new fields.
|
6 |
-
Version: 2.3.
|
7 |
Author: WP Desk
|
8 |
Author URI: https://www.wpdesk.net/
|
9 |
Text Domain: flexible-checkout-fields
|
@@ -37,8 +37,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
37 |
|
38 |
|
39 |
/* THESE TWO VARIABLES CAN BE CHANGED AUTOMATICALLY */
|
40 |
-
$plugin_version = '2.3.
|
41 |
-
$plugin_release_timestamp = '2020-02-
|
42 |
|
43 |
define( 'FLEXIBLE_CHECKOUT_FIELDS_VERSION', $plugin_version );
|
44 |
|
3 |
Plugin Name: Flexible Checkout Fields
|
4 |
Plugin URI: https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/
|
5 |
Description: Manage your WooCommerce checkout fields. Change order, labels, placeholders and add new fields.
|
6 |
+
Version: 2.3.4
|
7 |
Author: WP Desk
|
8 |
Author URI: https://www.wpdesk.net/
|
9 |
Text Domain: flexible-checkout-fields
|
37 |
|
38 |
|
39 |
/* THESE TWO VARIABLES CAN BE CHANGED AUTOMATICALLY */
|
40 |
+
$plugin_version = '2.3.4';
|
41 |
+
$plugin_release_timestamp = '2020-02-26 09:45';
|
42 |
|
43 |
define( 'FLEXIBLE_CHECKOUT_FIELDS_VERSION', $plugin_version );
|
44 |
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Donate link: https://www.wpdesk.net/flexible-checkout-fields-woocommerce/
|
|
5 |
Tags: woocommerce checkout fields, woocommerce custom fields, woocommerce checkout manager, woocommerce checkout editor, woocommerce fields manager, woocommerce fields editor, woocommerce custom checkout fields, woocommerce checkout options, woocommerce checkout pro, woocommerce custom sections, woocommerce file upload
|
6 |
Requires at least: 4.5
|
7 |
Tested up to: 5.3.2
|
8 |
-
Stable tag: 2.3.
|
9 |
Requires PHP: 5.6
|
10 |
License: GPLv3 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -193,6 +193,10 @@ If you are upgrading from the old WooCommerce Checkout Fields version (1.1, wooc
|
|
193 |
|
194 |
== Changelog ==
|
195 |
|
|
|
|
|
|
|
|
|
196 |
= 2.3.3 - 2020-02-25 =
|
197 |
* Added security nonce to settings form
|
198 |
|
5 |
Tags: woocommerce checkout fields, woocommerce custom fields, woocommerce checkout manager, woocommerce checkout editor, woocommerce fields manager, woocommerce fields editor, woocommerce custom checkout fields, woocommerce checkout options, woocommerce checkout pro, woocommerce custom sections, woocommerce file upload
|
6 |
Requires at least: 4.5
|
7 |
Tested up to: 5.3.2
|
8 |
+
Stable tag: 2.3.4
|
9 |
Requires PHP: 5.6
|
10 |
License: GPLv3 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
193 |
|
194 |
== Changelog ==
|
195 |
|
196 |
+
= 2.3.4 - 2020-02-25 =
|
197 |
+
* Fixed attibute/value escaping in admin panel and on checkout page
|
198 |
+
* Added additional security hardenings
|
199 |
+
|
200 |
= 2.3.3 - 2020-02-25 =
|
201 |
* Added security nonce to settings form
|
202 |
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit5d9b591879aa2d09adfbf96a5fca0b73::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInite52b7af303d364c315ea18bbe592c641
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit5d9b591879aa2d09adfbf96a5fca0b73
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit5d9b591879aa2d09adfbf96a5fca0b73', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit5d9b591879aa2d09adfbf96a5fca0b73', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit5d9b591879aa2d09adfbf96a5fca0b73::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'P' =>
|
@@ -267,9 +267,9 @@ class ComposerStaticInite52b7af303d364c315ea18bbe592c641
|
|
267 |
public static function getInitializer(ClassLoader $loader)
|
268 |
{
|
269 |
return \Closure::bind(function () use ($loader) {
|
270 |
-
$loader->prefixLengthsPsr4 =
|
271 |
-
$loader->prefixDirsPsr4 =
|
272 |
-
$loader->classMap =
|
273 |
|
274 |
}, null, ClassLoader::class);
|
275 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit5d9b591879aa2d09adfbf96a5fca0b73
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'P' =>
|
267 |
public static function getInitializer(ClassLoader $loader)
|
268 |
{
|
269 |
return \Closure::bind(function () use ($loader) {
|
270 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit5d9b591879aa2d09adfbf96a5fca0b73::$prefixLengthsPsr4;
|
271 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit5d9b591879aa2d09adfbf96a5fca0b73::$prefixDirsPsr4;
|
272 |
+
$loader->classMap = ComposerStaticInit5d9b591879aa2d09adfbf96a5fca0b73::$classMap;
|
273 |
|
274 |
}, null, ClassLoader::class);
|
275 |
}
|