Flexible Checkout Fields for WooCommerce – WooCommerce Checkout Manager - Version 2.5.0

Version Description

  • 2020-08-06 =
  • Added action flexible_checkout_fields_validate_{$field_type} for custom validation
  • Added new argument to callback function for filter flexible_checkout_fields_custom_validation
Download this release

Release Info

Developer wpdesk
Plugin Icon wp plugin Flexible Checkout Fields for WooCommerce – WooCommerce Checkout Manager
Version 2.5.0
Comparing to
See all releases

Code changes from version 2.4.14 to 2.5.0

classes/display-options.php CHANGED
@@ -440,7 +440,7 @@ class Flexible_Checkout_Fields_Disaplay_Options {
440
  // if field exists and is defined as select we can use this data. If not then better do not touch as it's probably optional checkbox
441
  if ( isset( $wc_field_def['options'] ) ) {
442
  $select_options = $wc_meta_key_definitions[ $this->current_address_type ]['fields'][ $field_key ]['options'];
443
- $option_val = $select_options[ $val ];
444
 
445
  return $label . ': ' . $option_val;
446
  } elseif ( (int) $val === 1 ) {
440
  // if field exists and is defined as select we can use this data. If not then better do not touch as it's probably optional checkbox
441
  if ( isset( $wc_field_def['options'] ) ) {
442
  $select_options = $wc_meta_key_definitions[ $this->current_address_type ]['fields'][ $field_key ]['options'];
443
+ $option_val = isset( $select_options[ $val ] ) ? $select_options[ $val ] : '';
444
 
445
  return $label . ': ' . $option_val;
446
  } elseif ( (int) $val === 1 ) {
classes/filed-validation.php CHANGED
@@ -43,7 +43,10 @@ class Flexible_Checkout_Fields_Field_Validation {
43
  foreach ( $settings as $section => $fields ) {
44
  foreach ( $fields as $field_key => $field ) {
45
  if ( isset( $_POST[$field_key] ) && !empty( $field['validation'] ) && array_key_exists( $field['validation'], $custom_validations ) ) {
46
- call_user_func( $custom_validations[$field['validation']]['callback'], $field['label'], sanitize_textarea_field($_POST[$field_key]) );
 
 
 
47
  }
48
  }
49
  }
43
  foreach ( $settings as $section => $fields ) {
44
  foreach ( $fields as $field_key => $field ) {
45
  if ( isset( $_POST[$field_key] ) && !empty( $field['validation'] ) && array_key_exists( $field['validation'], $custom_validations ) ) {
46
+ call_user_func( $custom_validations[$field['validation']]['callback'], $field['label'], sanitize_textarea_field($_POST[$field_key]), $field );
47
+ }
48
+ if ( isset( $field['custom_field'] ) && $field['custom_field'] && isset( $_POST[ $field_key ] ) && ! empty( $_POST[ $field_key ] ) ) {
49
+ do_action( 'flexible_checkout_fields_validate_' . $field['type'], sanitize_textarea_field( $_POST[ $field_key ] ), $field );
50
  }
51
  }
52
  }
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.4.14
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-checkout-fields
@@ -39,7 +39,7 @@ if ( ! defined( 'ABSPATH' ) ) {
39
 
40
 
41
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
42
- $plugin_version = '2.4.14';
43
 
44
  define( 'FLEXIBLE_CHECKOUT_FIELDS_VERSION', $plugin_version );
45
 
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.5.0
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-checkout-fields
39
 
40
 
41
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
42
+ $plugin_version = '2.5.0';
43
 
44
  define( 'FLEXIBLE_CHECKOUT_FIELDS_VERSION', $plugin_version );
45
 
lang/flexible-checkout-fields.pot CHANGED
@@ -7,8 +7,8 @@ msgstr ""
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
- "POT-Creation-Date: 2020-07-22T21:41:12+00:00\n"
11
- "PO-Revision-Date: 2020-07-22T21:41:12+00:00\n"
12
  "Language: \n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
@@ -101,23 +101,23 @@ msgstr ""
101
  msgid "%s is a required field."
102
  msgstr ""
103
 
104
- #: /builds/wpdesk/flexible-checkout-fields/classes/filed-validation.php:70
105
  msgid "Default"
106
  msgstr ""
107
 
108
- #: /builds/wpdesk/flexible-checkout-fields/classes/filed-validation.php:71
109
  msgid "None"
110
  msgstr ""
111
 
112
- #: /builds/wpdesk/flexible-checkout-fields/classes/filed-validation.php:72
113
  msgid "Email"
114
  msgstr ""
115
 
116
- #: /builds/wpdesk/flexible-checkout-fields/classes/filed-validation.php:73
117
  msgid "Phone"
118
  msgstr ""
119
 
120
- #: /builds/wpdesk/flexible-checkout-fields/classes/filed-validation.php:76
121
  msgid "Post code"
122
  msgstr ""
123
 
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
+ "POT-Creation-Date: 2020-08-06T14:20:13+00:00\n"
11
+ "PO-Revision-Date: 2020-08-06T14:20:13+00:00\n"
12
  "Language: \n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
101
  msgid "%s is a required field."
102
  msgstr ""
103
 
104
+ #: /builds/wpdesk/flexible-checkout-fields/classes/filed-validation.php:73
105
  msgid "Default"
106
  msgstr ""
107
 
108
+ #: /builds/wpdesk/flexible-checkout-fields/classes/filed-validation.php:74
109
  msgid "None"
110
  msgstr ""
111
 
112
+ #: /builds/wpdesk/flexible-checkout-fields/classes/filed-validation.php:75
113
  msgid "Email"
114
  msgstr ""
115
 
116
+ #: /builds/wpdesk/flexible-checkout-fields/classes/filed-validation.php:76
117
  msgid "Phone"
118
  msgstr ""
119
 
120
+ #: /builds/wpdesk/flexible-checkout-fields/classes/filed-validation.php:79
121
  msgid "Post code"
122
  msgstr ""
123
 
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.4.2
8
- Stable tag: 2.4.14
9
  Requires PHP: 5.6
10
  License: GPLv3 or later
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -187,6 +187,10 @@ If you are upgrading from the old WooCommerce Checkout Fields version (1.1, wooc
187
 
188
  == Changelog ==
189
 
 
 
 
 
190
  = 2.4.14 - 2020-07-22 =
191
  * Fixed displaying empty address in user profile
192
 
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.4.2
8
+ Stable tag: 2.5.0
9
  Requires PHP: 5.6
10
  License: GPLv3 or later
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
187
 
188
  == Changelog ==
189
 
190
+ = 2.5.0 - 2020-08-06 =
191
+ * Added action `flexible_checkout_fields_validate_{$field_type}` for custom validation
192
+ * Added new argument to callback function for filter `flexible_checkout_fields_custom_validation`
193
+
194
  = 2.4.14 - 2020-07-22 =
195
  * Fixed displaying empty address in user profile
196
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitbba39f5d6a23e65f3a64705cbb6d999f::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitd67d2b94dcb4a280007cb57aaed81fda::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitbba39f5d6a23e65f3a64705cbb6d999f
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitbba39f5d6a23e65f3a64705cbb6d999f
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitbba39f5d6a23e65f3a64705cbb6d999f', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitbba39f5d6a23e65f3a64705cbb6d999f', '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\ComposerStaticInitbba39f5d6a23e65f3a64705cbb6d999f::getInitializer($loader));
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 ComposerAutoloaderInitd67d2b94dcb4a280007cb57aaed81fda
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitd67d2b94dcb4a280007cb57aaed81fda', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitd67d2b94dcb4a280007cb57aaed81fda', '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\ComposerStaticInitd67d2b94dcb4a280007cb57aaed81fda::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 ComposerStaticInitbba39f5d6a23e65f3a64705cbb6d999f
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'P' =>
@@ -278,9 +278,9 @@ class ComposerStaticInitbba39f5d6a23e65f3a64705cbb6d999f
278
  public static function getInitializer(ClassLoader $loader)
279
  {
280
  return \Closure::bind(function () use ($loader) {
281
- $loader->prefixLengthsPsr4 = ComposerStaticInitbba39f5d6a23e65f3a64705cbb6d999f::$prefixLengthsPsr4;
282
- $loader->prefixDirsPsr4 = ComposerStaticInitbba39f5d6a23e65f3a64705cbb6d999f::$prefixDirsPsr4;
283
- $loader->classMap = ComposerStaticInitbba39f5d6a23e65f3a64705cbb6d999f::$classMap;
284
 
285
  }, null, ClassLoader::class);
286
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitd67d2b94dcb4a280007cb57aaed81fda
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'P' =>
278
  public static function getInitializer(ClassLoader $loader)
279
  {
280
  return \Closure::bind(function () use ($loader) {
281
+ $loader->prefixLengthsPsr4 = ComposerStaticInitd67d2b94dcb4a280007cb57aaed81fda::$prefixLengthsPsr4;
282
+ $loader->prefixDirsPsr4 = ComposerStaticInitd67d2b94dcb4a280007cb57aaed81fda::$prefixDirsPsr4;
283
+ $loader->classMap = ComposerStaticInitd67d2b94dcb4a280007cb57aaed81fda::$classMap;
284
 
285
  }, null, ClassLoader::class);
286
  }