Meta Box - Version 5.3.6

Version Description

  • 2020-12-29 =
  • Fix validation not working for image-select, image and wysiwyg fields
  • Fix clone_default not working for switch
  • Fix saving select field value when defining each option as an array
  • Fix wysiwyg not editable in WP 5.6
Download this release

Release Info

Developer rilwis
Plugin Icon 128x128 Meta Box
Version 5.3.6
Comparing to
See all releases

Code changes from version 5.3.5 to 5.3.6

css/style.css CHANGED
@@ -101,6 +101,7 @@
101
  p.rwmb-error {
102
  color: #dc3232;
103
  margin: 2px 0 5px;
 
104
  }
105
  input.rwmb-error.rwmb-error,
106
  textarea.rwmb-error,
101
  p.rwmb-error {
102
  color: #dc3232;
103
  margin: 2px 0 5px;
104
+ clear: both;
105
  }
106
  input.rwmb-error.rwmb-error,
107
  textarea.rwmb-error,
css/wysiwyg.css CHANGED
@@ -5,6 +5,11 @@
5
  padding-top: 20px;
6
  }
7
 
 
 
 
 
 
8
  /* Fix style for Gutenberg */
9
  .block-editor .wp-editor-wrap {
10
  box-sizing: content-box;
5
  padding-top: 20px;
6
  }
7
 
8
+ /* Fix both tinymce & quick tags display together (somehow) */
9
+ .html-active .mce-container {
10
+ display: none;
11
+ }
12
+
13
  /* Fix style for Gutenberg */
14
  .block-editor .wp-editor-wrap {
15
  box-sizing: content-box;
inc/about/dashboard.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class RWMB_Dashboard {
3
+ private $feed_url;
4
+ private $link;
5
+ private $title;
6
+ private $slug;
7
+
8
+ public function __construct( $feed_url, $link, $title ) {
9
+ $this->feed_url = $feed_url;
10
+ $this->link = $link;
11
+ $this->title = $title;
12
+ $this->slug = sanitize_title( $title );
13
+
14
+ $transient_name = $this->get_transient_name();
15
+ add_filter( "transient_$transient_name", array( $this, 'transient_for_dashboard_news' ) );
16
+ }
17
+
18
+ private function get_transient_name() {
19
+ include ABSPATH . WPINC . '/version.php';
20
+ global $wp_version;
21
+
22
+ $locale = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
23
+ $prefix = version_compare( $wp_version, '4.8', '>=') ? 'dash_v2_' : 'dash_';
24
+ $widget_id = 'dashboard_primary';
25
+
26
+ return version_compare( $wp_version, '4.3', '>=' ) ? $prefix . md5( "{$widget_id}_{$locale}" ) : 'dash_' . md5( $widget_id );
27
+ }
28
+
29
+ public function transient_for_dashboard_news($value) {
30
+ return $value . $this->get_dashboard_news_html();
31
+ }
32
+
33
+ private function get_dashboard_news_html() {
34
+ $cache_key = $this->slug . '_dashboard_news';
35
+ $output = get_transient( $cache_key );
36
+ if ( false !== $output) {
37
+ return $output;
38
+ }
39
+
40
+ $feeds = array(
41
+ $this->slug => array(
42
+ 'link' => $this->link,
43
+ 'url' => $this->feed_url,
44
+ 'title' => $this->title['title'],
45
+ 'items' => 3,
46
+ 'show_summary' => 0,
47
+ 'show_author' => 0,
48
+ 'show_date' => 0,
49
+ )
50
+ );
51
+ ob_start();
52
+ wp_dashboard_primary_output( 'dashboard_primary', $feeds );
53
+ $output = ob_get_clean();
54
+ set_transient( $cache_key, $output, DAY_IN_SECONDS );
55
+
56
+ return $output;
57
+ }
58
+ }
inc/fields/image-select.php CHANGED
@@ -26,16 +26,13 @@ class RWMB_Image_Select_Field extends RWMB_Field {
26
  */
27
  public static function html( $meta, $field ) {
28
  $html = array();
29
- $tpl = '<label class="rwmb-image-select"><img src="%s"><input type="%s" class="rwmb-image_select" name="%s" value="%s"%s></label>';
30
-
31
  $meta = (array) $meta;
32
  foreach ( $field['options'] as $value => $image ) {
 
33
  $html[] = sprintf(
34
- $tpl,
35
  $image,
36
- $field['multiple'] ? 'checkbox' : 'radio',
37
- $field['field_name'],
38
- $value,
39
  checked( in_array( $value, $meta ), true, false )
40
  );
41
  }
@@ -56,6 +53,21 @@ class RWMB_Image_Select_Field extends RWMB_Field {
56
  return $field;
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  /**
60
  * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
61
  *
26
  */
27
  public static function html( $meta, $field ) {
28
  $html = array();
 
 
29
  $meta = (array) $meta;
30
  foreach ( $field['options'] as $value => $image ) {
31
+ $attributes = self::get_attributes( $field, $value );
32
  $html[] = sprintf(
33
+ '<label class="rwmb-image-select"><img src="%s"><input %s%s></label>',
34
  $image,
35
+ self::render_attributes( $attributes ),
 
 
36
  checked( in_array( $value, $meta ), true, false )
37
  );
38
  }
53
  return $field;
54
  }
55
 
56
+ /**
57
+ * Get the attributes for a field.
58
+ *
59
+ * @param array $field Field parameters.
60
+ * @param mixed $value Meta value.
61
+ * @return array
62
+ */
63
+ public static function get_attributes( $field, $value = null ) {
64
+ $attributes = parent::get_attributes( $field, $value );
65
+ $attributes['id'] = false;
66
+ $attributes['type'] = $field['multiple'] ? 'checkbox' : 'radio';
67
+ $attributes['value'] = $value;
68
+
69
+ return $attributes;
70
+ }
71
  /**
72
  * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
73
  *
inc/fields/wysiwyg.php CHANGED
@@ -49,11 +49,15 @@ class RWMB_Wysiwyg_Field extends RWMB_Field {
49
  // Using output buffering because wp_editor() echos directly.
50
  ob_start();
51
 
52
- $field['options']['textarea_name'] = $field['field_name'];
53
- $attributes = self::get_attributes( $field );
54
 
55
- // Use new wp_editor() since WP 3.3.
56
- wp_editor( $meta, $attributes['id'], $field['options'] );
 
 
 
 
 
57
 
58
  return ob_get_clean();
59
  }
49
  // Using output buffering because wp_editor() echos directly.
50
  ob_start();
51
 
52
+ $attributes = self::get_attributes( $field );
 
53
 
54
+ $options = $field['options'];
55
+ $options['textarea_name'] = $field['field_name'];
56
+ if ( ! empty( $attributes['required'] ) ) {
57
+ $options['editor_class'] .= ' rwmb-wysiwyg-required';
58
+ }
59
+
60
+ wp_editor( $meta, $attributes['id'], $options );
61
 
62
  return ob_get_clean();
63
  }
inc/loader.php CHANGED
@@ -18,7 +18,7 @@ class RWMB_Loader {
18
  */
19
  protected function constants() {
20
  // Script version, used to add version for scripts and styles.
21
- define( 'RWMB_VER', '5.3.5' );
22
 
23
  list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
 
@@ -113,6 +113,8 @@ class RWMB_Loader {
113
  if ( is_admin() ) {
114
  $about = new RWMB_About( $update_checker );
115
  $about->init();
 
 
116
  }
117
 
118
  // Public functions.
18
  */
19
  protected function constants() {
20
  // Script version, used to add version for scripts and styles.
21
+ define( 'RWMB_VER', '5.3.6' );
22
 
23
  list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
 
113
  if ( is_admin() ) {
114
  $about = new RWMB_About( $update_checker );
115
  $about->init();
116
+
117
+ new RWMB_Dashboard( 'http://feeds.feedburner.com/metaboxio', 'https://metabox.io/blog/', 'Meta Box' );
118
  }
119
 
120
  // Public functions.
inc/sanitizer.php CHANGED
@@ -150,8 +150,9 @@ class RWMB_Sanitizer {
150
  * @return string|array
151
  */
152
  private function sanitize_choice( $value, $field ) {
153
- $options = $field['options'];
154
- return is_array( $value ) ? array_intersect( $value, array_keys( $options ) ) : ( isset( $options[ $value ] ) ? $value : '' );
 
155
  }
156
 
157
  /**
150
  * @return string|array
151
  */
152
  private function sanitize_choice( $value, $field ) {
153
+ $options = RWMB_Choice_Field::transform_options( $field['options'] );
154
+ $options = wp_list_pluck( $options, 'value' );
155
+ return is_array( $value ) ? array_intersect( $value, $options ) : ( in_array( $value, $options ) ? $value : '' );
156
  }
157
 
158
  /**
js/clone.js CHANGED
@@ -90,8 +90,8 @@
90
 
91
  if ( 'radio' === type ) {
92
  $field.prop( 'checked', $field.val() === defaultValue );
93
- } else if ( $field.hasClass( 'rwmb-checkbox' ) ) {
94
- $field.prop( 'checked', !! defaultValue );
95
  } else if ( $field.hasClass( 'rwmb-checkbox_list' ) ) {
96
  var value = $field.val();
97
  $field.prop( 'checked', Array.isArray( defaultValue ) ? -1 !== defaultValue.indexOf( value ) : value == defaultValue );
90
 
91
  if ( 'radio' === type ) {
92
  $field.prop( 'checked', $field.val() === defaultValue );
93
+ } else if ( $field.hasClass( 'rwmb-checkbox' ) || $field.hasClass( 'rwmb-switch' ) ) {
94
+ $field.prop( 'checked', !! defaultValue );
95
  } else if ( $field.hasClass( 'rwmb-checkbox_list' ) ) {
96
  var value = $field.val();
97
  $field.prop( 'checked', Array.isArray( defaultValue ) ? -1 !== defaultValue.indexOf( value ) : value == defaultValue );
js/file.js CHANGED
@@ -136,7 +136,7 @@
136
  $uploaded.each( file.sort );
137
  $uploaded.each( file.updateVisibility );
138
 
139
- $el.find( '.rwmb-file-wrapper' ).each( file.setRequired );
140
  }
141
 
142
  rwmb.$document
136
  $uploaded.each( file.sort );
137
  $uploaded.each( file.updateVisibility );
138
 
139
+ $el.find( '.rwmb-file-wrapper, .rwmb-image-wrapper' ).each( file.setRequired );
140
  }
141
 
142
  rwmb.$document
js/validation.min.js CHANGED
@@ -15,4 +15,4 @@ function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof S
15
  * Copyright (c) 2019 Jörn Zaefferer
16
  * Released under the MIT license
17
  */
18
- function(t){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}((function(t){return function(){function e(t){return t.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}t.validator.addMethod("maxWords",(function(t,i,a){return this.optional(i)||e(t).match(/\b\w+\b/g).length<=a}),t.validator.format("Please enter {0} words or less.")),t.validator.addMethod("minWords",(function(t,i,a){return this.optional(i)||e(t).match(/\b\w+\b/g).length>=a}),t.validator.format("Please enter at least {0} words.")),t.validator.addMethod("rangeWords",(function(t,i,a){var n=e(t),r=/\b\w+\b/g;return this.optional(i)||n.match(r).length>=a[0]&&n.match(r).length<=a[1]}),t.validator.format("Please enter between {0} and {1} words."))}(),t.validator.addMethod("abaRoutingNumber",(function(t){var e=0,i=t.split(""),a=i.length;if(9!==a)return!1;for(var n=0;n<a;n+=3)e+=3*parseInt(i[n],10)+7*parseInt(i[n+1],10)+parseInt(i[n+2],10);return 0!==e&&e%10==0}),"Please enter a valid routing number."),t.validator.addMethod("accept",(function(e,i,a){var n,r,s="string"==typeof a?a.replace(/\s/g,""):"image/*",o=this.optional(i);if(o)return o;if("file"===t(i).attr("type")&&(s=s.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g,"\\$&").replace(/,/g,"|").replace(/\/\*/g,"/.*"),i.files&&i.files.length))for(r=new RegExp(".?("+s+")$","i"),n=0;n<i.files.length;n++)if(!i.files[n].type.match(r))return!1;return!0}),t.validator.format("Please enter a value with a valid mimetype.")),t.validator.addMethod("alphanumeric",(function(t,e){return this.optional(e)||/^\w+$/i.test(t)}),"Letters, numbers, and underscores only please"),t.validator.addMethod("bankaccountNL",(function(t,e){if(this.optional(e))return!0;if(!/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(t))return!1;var i,a=t.replace(/ /g,""),n=0,r=a.length;for(i=0;i<r;i++)n+=(r-i)*a.substring(i,i+1);return n%11==0}),"Please specify a valid bank account number"),t.validator.addMethod("bankorgiroaccountNL",(function(e,i){return this.optional(i)||t.validator.methods.bankaccountNL.call(this,e,i)||t.validator.methods.giroaccountNL.call(this,e,i)}),"Please specify a valid bank or giro account number"),t.validator.addMethod("bic",(function(t,e){return this.optional(e)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(t.toUpperCase())}),"Please specify a valid BIC code"),t.validator.addMethod("cifES",(function(t,e){"use strict";if(this.optional(e))return!0;var i,a,n,r,s=new RegExp(/^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi),o=t.substring(0,1),d=t.substring(1,8),l=t.substring(8,9),u=0,h=0;function c(t){return t%2==0}if(9!==t.length||!s.test(t))return!1;for(i=0;i<d.length;i++)a=parseInt(d[i],10),c(i)?h+=(a*=2)<10?a:a-9:u+=a;return n=(10-(u+h).toString().substr(-1)).toString(),n=parseInt(n,10)>9?"0":n,r="JABCDEFGHI".substr(n,1).toString(),o.match(/[ABEH]/)?l===n:o.match(/[KPQS]/)?l===r:l===n||l===r}),"Please specify a valid CIF number."),t.validator.addMethod("cnhBR",(function(t){if(11!==(t=t.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,"")).length)return!1;var e,i,a,n,r,s=0,o=0;if(e=t.charAt(0),new Array(12).join(e)===t)return!1;for(n=0,r=9,0;n<9;++n,--r)s+=+t.charAt(n)*r;for((i=s%11)>=10&&(i=0,o=2),s=0,n=0,r=1,0;n<9;++n,++r)s+=+t.charAt(n)*r;return(a=s%11)>=10?a=0:a-=o,String(i).concat(a)===t.substr(-2)}),"Please specify a valid CNH number"),t.validator.addMethod("cnpjBR",(function(t,e){"use strict";if(this.optional(e))return!0;if(14!==(t=t.replace(/[^\d]+/g,"")).length)return!1;if("00000000000000"===t||"11111111111111"===t||"22222222222222"===t||"33333333333333"===t||"44444444444444"===t||"55555555555555"===t||"66666666666666"===t||"77777777777777"===t||"88888888888888"===t||"99999999999999"===t)return!1;for(var i=t.length-2,a=t.substring(0,i),n=t.substring(i),r=0,s=i-7,o=i;o>=1;o--)r+=a.charAt(i-o)*s--,s<2&&(s=9);var d=r%11<2?0:11-r%11;if(d!==parseInt(n.charAt(0),10))return!1;i+=1,a=t.substring(0,i),r=0,s=i-7;for(var l=i;l>=1;l--)r+=a.charAt(i-l)*s--,s<2&&(s=9);return(d=r%11<2?0:11-r%11)===parseInt(n.charAt(1),10)}),"Please specify a CNPJ value number"),t.validator.addMethod("cpfBR",(function(t,e){"use strict";if(this.optional(e))return!0;if(11!==(t=t.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,"")).length)return!1;var i,a,n,r,s=0;if(i=parseInt(t.substring(9,10),10),a=parseInt(t.substring(10,11),10),n=function(t,e){var i=10*t%11;return 10!==i&&11!==i||(i=0),i===e},""===t||"00000000000"===t||"11111111111"===t||"22222222222"===t||"33333333333"===t||"44444444444"===t||"55555555555"===t||"66666666666"===t||"77777777777"===t||"88888888888"===t||"99999999999"===t)return!1;for(r=1;r<=9;r++)s+=parseInt(t.substring(r-1,r),10)*(11-r);if(n(s,i)){for(s=0,r=1;r<=10;r++)s+=parseInt(t.substring(r-1,r),10)*(12-r);return n(s,a)}return!1}),"Please specify a valid CPF number"),t.validator.addMethod("creditcard",(function(t,e){if(this.optional(e))return"dependency-mismatch";if(/[^0-9 \-]+/.test(t))return!1;var i,a,n=0,r=0,s=!1;if((t=t.replace(/\D/g,"")).length<13||t.length>19)return!1;for(i=t.length-1;i>=0;i--)a=t.charAt(i),r=parseInt(a,10),s&&(r*=2)>9&&(r-=9),n+=r,s=!s;return n%10==0}),"Please enter a valid credit card number."),t.validator.addMethod("creditcardtypes",(function(t,e,i){if(/[^0-9\-]+/.test(t))return!1;t=t.replace(/\D/g,"");var a=0;return i.mastercard&&(a|=1),i.visa&&(a|=2),i.amex&&(a|=4),i.dinersclub&&(a|=8),i.enroute&&(a|=16),i.discover&&(a|=32),i.jcb&&(a|=64),i.unknown&&(a|=128),i.all&&(a=255),1&a&&(/^(5[12345])/.test(t)||/^(2[234567])/.test(t))||2&a&&/^(4)/.test(t)?16===t.length:4&a&&/^(3[47])/.test(t)?15===t.length:8&a&&/^(3(0[012345]|[68]))/.test(t)?14===t.length:16&a&&/^(2(014|149))/.test(t)?15===t.length:32&a&&/^(6011)/.test(t)||64&a&&/^(3)/.test(t)?16===t.length:64&a&&/^(2131|1800)/.test(t)?15===t.length:!!(128&a)}),"Please enter a valid credit card number."),t.validator.addMethod("currency",(function(t,e,i){var a,n="string"==typeof i,r=n?i:i[0],s=!!n||i[1];return r=r.replace(/,/g,""),a="^["+(r=s?r+"]":r+"]?")+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",a=new RegExp(a),this.optional(e)||a.test(t)}),"Please specify a valid currency"),t.validator.addMethod("dateFA",(function(t,e){return this.optional(e)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(t)}),t.validator.messages.date),t.validator.addMethod("dateITA",(function(t,e){var i,a,n,r,s,o=!1;return/^\d{1,2}\/\d{1,2}\/\d{4}$/.test(t)?(i=t.split("/"),a=parseInt(i[0],10),n=parseInt(i[1],10),r=parseInt(i[2],10),o=(s=new Date(Date.UTC(r,n-1,a,12,0,0,0))).getUTCFullYear()===r&&s.getUTCMonth()===n-1&&s.getUTCDate()===a):o=!1,this.optional(e)||o}),t.validator.messages.date),t.validator.addMethod("dateNL",(function(t,e){return this.optional(e)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(t)}),t.validator.messages.date),t.validator.addMethod("extension",(function(t,e,i){return i="string"==typeof i?i.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(e)||t.match(new RegExp("\\.("+i+")$","i"))}),t.validator.format("Please enter a value with a valid extension.")),t.validator.addMethod("giroaccountNL",(function(t,e){return this.optional(e)||/^[0-9]{1,7}$/.test(t)}),"Please specify a valid giro account number"),t.validator.addMethod("greaterThan",(function(e,i,a){var n=t(a);return this.settings.onfocusout&&n.not(".validate-greaterThan-blur").length&&n.addClass("validate-greaterThan-blur").on("blur.validate-greaterThan",(function(){t(i).valid()})),e>n.val()}),"Please enter a greater value."),t.validator.addMethod("greaterThanEqual",(function(e,i,a){var n=t(a);return this.settings.onfocusout&&n.not(".validate-greaterThanEqual-blur").length&&n.addClass("validate-greaterThanEqual-blur").on("blur.validate-greaterThanEqual",(function(){t(i).valid()})),e>=n.val()}),"Please enter a greater value."),t.validator.addMethod("iban",(function(t,e){if(this.optional(e))return!0;var i,a,n,r,s,o=t.replace(/ /g,"").toUpperCase(),d="",l=!0,u="";if(o.length<5)return!1;if(void 0!==(n={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"}[o.substring(0,2)])&&!new RegExp("^[A-Z]{2}\\d{2}"+n+"$","").test(o))return!1;for(i=o.substring(4,o.length)+o.substring(0,4),r=0;r<i.length;r++)"0"!==(a=i.charAt(r))&&(l=!1),l||(d+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(a));for(s=0;s<d.length;s++)u=(""+u+d.charAt(s))%97;return 1===u}),"Please specify a valid IBAN"),t.validator.addMethod("integer",(function(t,e){return this.optional(e)||/^-?\d+$/.test(t)}),"A positive or negative non-decimal number please"),t.validator.addMethod("ipv4",(function(t,e){return this.optional(e)||/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(t)}),"Please enter a valid IP v4 address."),t.validator.addMethod("ipv6",(function(t,e){return this.optional(e)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(t)}),"Please enter a valid IP v6 address."),t.validator.addMethod("lessThan",(function(e,i,a){var n=t(a);return this.settings.onfocusout&&n.not(".validate-lessThan-blur").length&&n.addClass("validate-lessThan-blur").on("blur.validate-lessThan",(function(){t(i).valid()})),e<n.val()}),"Please enter a lesser value."),t.validator.addMethod("lessThanEqual",(function(e,i,a){var n=t(a);return this.settings.onfocusout&&n.not(".validate-lessThanEqual-blur").length&&n.addClass("validate-lessThanEqual-blur").on("blur.validate-lessThanEqual",(function(){t(i).valid()})),e<=n.val()}),"Please enter a lesser value."),t.validator.addMethod("lettersonly",(function(t,e){return this.optional(e)||/^[a-z]+$/i.test(t)}),"Letters only please"),t.validator.addMethod("letterswithbasicpunc",(function(t,e){return this.optional(e)||/^[a-z\-.,()'"\s]+$/i.test(t)}),"Letters or punctuation only please"),t.validator.addMethod("maxfiles",(function(e,i,a){return!!this.optional(i)||!("file"===t(i).attr("type")&&i.files&&i.files.length>a)}),t.validator.format("Please select no more than {0} files.")),t.validator.addMethod("maxsize",(function(e,i,a){if(this.optional(i))return!0;if("file"===t(i).attr("type")&&i.files&&i.files.length)for(var n=0;n<i.files.length;n++)if(i.files[n].size>a)return!1;return!0}),t.validator.format("File size must not exceed {0} bytes each.")),t.validator.addMethod("maxsizetotal",(function(e,i,a){if(this.optional(i))return!0;if("file"===t(i).attr("type")&&i.files&&i.files.length)for(var n=0,r=0;r<i.files.length;r++)if((n+=i.files[r].size)>a)return!1;return!0}),t.validator.format("Total size of all files must not exceed {0} bytes.")),t.validator.addMethod("mobileNL",(function(t,e){return this.optional(e)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(t)}),"Please specify a valid mobile number"),t.validator.addMethod("mobileRU",(function(t,e){var i=t.replace(/\(|\)|\s+|-/g,"");return this.optional(e)||i.length>9&&/^((\+7|7|8)+([0-9]){10})$/.test(i)}),"Please specify a valid mobile number"),t.validator.addMethod("mobileUK",(function(t,e){return t=t.replace(/\(|\)|\s+|-/g,""),this.optional(e)||t.length>9&&t.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)}),"Please specify a valid mobile number"),t.validator.addMethod("netmask",(function(t,e){return this.optional(e)||/^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test(t)}),"Please enter a valid netmask."),t.validator.addMethod("nieES",(function(t,e){"use strict";if(this.optional(e))return!0;var i,a=new RegExp(/^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi),n=t.substr(t.length-1).toUpperCase();return!((t=t.toString().toUpperCase()).length>10||t.length<9||!a.test(t))&&(i=9===(t=t.replace(/^[X]/,"0").replace(/^[Y]/,"1").replace(/^[Z]/,"2")).length?t.substr(0,8):t.substr(0,9),"TRWAGMYFPDXBNJZSQVHLCKET".charAt(parseInt(i,10)%23)===n)}),"Please specify a valid NIE number."),t.validator.addMethod("nifES",(function(t,e){"use strict";return!!this.optional(e)||!!(t=t.toUpperCase()).match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")&&(/^[0-9]{8}[A-Z]{1}$/.test(t)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(t.substring(8,0)%23)===t.charAt(8):!!/^[KLM]{1}/.test(t)&&t[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(t.substring(8,1)%23))}),"Please specify a valid NIF number."),t.validator.addMethod("nipPL",(function(t){"use strict";if(10!==(t=t.replace(/[^0-9]/g,"")).length)return!1;for(var e=[6,5,7,2,3,4,5,6,7],i=0,a=0;a<9;a++)i+=e[a]*t[a];var n=i%11;return(10===n?0:n)===parseInt(t[9],10)}),"Please specify a valid NIP number."),t.validator.addMethod("nisBR",(function(t){var e,i,a,n,r,s=0;if(11!==(t=t.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,"")).length)return!1;for(i=parseInt(t.substring(10,11),10),e=parseInt(t.substring(0,10),10),n=2;n<12;n++)r=n,10===n&&(r=2),11===n&&(r=3),s+=e%10*r,e=parseInt(e/10,10);return i===(a=(a=s%11)>1?11-a:0)}),"Please specify a valid NIS/PIS number"),t.validator.addMethod("notEqualTo",(function(e,i,a){return this.optional(i)||!t.validator.methods.equalTo.call(this,e,i,a)}),"Please enter a different value, values must not be the same."),t.validator.addMethod("nowhitespace",(function(t,e){return this.optional(e)||/^\S+$/i.test(t)}),"No white space please"),t.validator.addMethod("pattern",(function(t,e,i){return!!this.optional(e)||("string"==typeof i&&(i=new RegExp("^(?:"+i+")$")),i.test(t))}),"Invalid format."),t.validator.addMethod("phoneNL",(function(t,e){return this.optional(e)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(t)}),"Please specify a valid phone number."),t.validator.addMethod("phonePL",(function(t,e){t=t.replace(/\s+/g,"");return this.optional(e)||/^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/.test(t)}),"Please specify a valid phone number"),t.validator.addMethod("phonesUK",(function(t,e){return t=t.replace(/\(|\)|\s+|-/g,""),this.optional(e)||t.length>9&&t.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)}),"Please specify a valid uk phone number"),t.validator.addMethod("phoneUK",(function(t,e){return t=t.replace(/\(|\)|\s+|-/g,""),this.optional(e)||t.length>9&&t.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)}),"Please specify a valid phone number"),t.validator.addMethod("phoneUS",(function(t,e){return t=t.replace(/\s+/g,""),this.optional(e)||t.length>9&&t.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/)}),"Please specify a valid phone number"),t.validator.addMethod("postalcodeBR",(function(t,e){return this.optional(e)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(t)}),"Informe um CEP válido."),t.validator.addMethod("postalCodeCA",(function(t,e){return this.optional(e)||/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test(t)}),"Please specify a valid postal code"),t.validator.addMethod("postalcodeIT",(function(t,e){return this.optional(e)||/^\d{5}$/.test(t)}),"Please specify a valid postal code"),t.validator.addMethod("postalcodeNL",(function(t,e){return this.optional(e)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(t)}),"Please specify a valid postal code"),t.validator.addMethod("postcodeUK",(function(t,e){return this.optional(e)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(t)}),"Please specify a valid UK postcode"),t.validator.addMethod("require_from_group",(function(e,i,a){var n=t(a[1],i.form),r=n.eq(0),s=r.data("valid_req_grp")?r.data("valid_req_grp"):t.extend({},this),o=n.filter((function(){return s.elementValue(this)})).length>=a[0];return r.data("valid_req_grp",s),t(i).data("being_validated")||(n.data("being_validated",!0),n.each((function(){s.element(this)})),n.data("being_validated",!1)),o}),t.validator.format("Please fill at least {0} of these fields.")),t.validator.addMethod("skip_or_fill_minimum",(function(e,i,a){var n=t(a[1],i.form),r=n.eq(0),s=r.data("valid_skip")?r.data("valid_skip"):t.extend({},this),o=n.filter((function(){return s.elementValue(this)})).length,d=0===o||o>=a[0];return r.data("valid_skip",s),t(i).data("being_validated")||(n.data("being_validated",!0),n.each((function(){s.element(this)})),n.data("being_validated",!1)),d}),t.validator.format("Please either skip these fields or fill at least {0} of them.")),t.validator.addMethod("stateUS",(function(t,e,i){var a,n=void 0===i,r=!n&&void 0!==i.caseSensitive&&i.caseSensitive,s=!n&&void 0!==i.includeTerritories&&i.includeTerritories,o=!n&&void 0!==i.includeMilitary&&i.includeMilitary;return a=s||o?s&&o?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":s?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",a=r?new RegExp(a):new RegExp(a,"i"),this.optional(e)||a.test(t)}),"Please specify a valid state"),t.validator.addMethod("strippedminlength",(function(e,i,a){return t(e).text().length>=a}),t.validator.format("Please enter at least {0} characters")),t.validator.addMethod("time",(function(t,e){return this.optional(e)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(t)}),"Please enter a valid time, between 00:00 and 23:59"),t.validator.addMethod("time12h",(function(t,e){return this.optional(e)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(t)}),"Please enter a valid time in 12-hour am/pm format"),t.validator.addMethod("url2",(function(t,e){return this.optional(e)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)}),t.validator.messages.url),t.validator.addMethod("vinUS",(function(t){if(17!==t.length)return!1;var e,i,a,n,r,s,o=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],d=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],l=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],u=0;for(e=0;e<17;e++){if(n=l[e],a=t.slice(e,e+1),8===e&&(s=a),isNaN(a)){for(i=0;i<o.length;i++)if(a.toUpperCase()===o[i]){a=d[i],a*=n,isNaN(s)&&8===i&&(s=o[i]);break}}else a*=n;u+=a}return 10===(r=u%11)&&(r="X"),r===s}),"The specified vehicle identification number (VIN) is invalid."),t.validator.addMethod("zipcodeUS",(function(t,e){return this.optional(e)||/^\d{5}(-\d{4})?$/.test(t)}),"The specified US ZIP Code is invalid"),t.validator.addMethod("ziprange",(function(t,e){return this.optional(e)||/^90[2-5]\d\{2\}-\d{4}$/.test(t)}),"Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx"),t})),function(t,e,i){"use strict";var a=function(){function e(i){_classCallCheck(this,e),this.$form=t(i),this.validationElements=this.$form.find(".rwmb-validation"),this.showAsterisks(),this.getSettings()}return _createClass(e,[{key:"init",value:function(){this.$form.on("submit",(function(){"undefined"!=typeof tinyMCE&&tinyMCE.triggerSave()})).validate(this.settings)}},{key:"showAsterisks",value:function(){this.validationElements.each((function(){var e=t(this).data("validation");t.each(e.rules,(function(e,i){if(i.required){var a=t('[name="'+e+'"]');a.length&&a.closest(".rwmb-input").siblings(".rwmb-label").find("label").append('<span class="rwmb-required">*</span>')}}))}))}},{key:"getSettings",value:function(){this.settings={ignore:':not(.rwmb-media,[class|="rwmb"]:visible)',errorPlacement:function(t,e){t.appendTo(e.closest(".rwmb-input"))},errorClass:"rwmb-error",errorElement:"p",invalidHandler:this.invalidHandler.bind(this)};var e=this;this.validationElements.each((function(){t.extend(!0,e.settings,t(this).data("validation"))}))}},{key:"invalidHandler",value:function(){this.showMessage();var t=this;setTimeout((function(){t.$form.trigger("after_validate")}),200)}},{key:"showMessage",value:function(){t("#publish").removeClass("button-primary-disabled"),t("#ajax-loading").attr("style",""),t("#rwmb-validation-message").remove(),this.$form.before('<div id="rwmb-validation-message" class="notice notice-error is-dismissible"><p>'+i.message+"</p></div>")}}]),e}(),n=function(t){_inherits(a,t);var e=_createSuper(a);function a(){return _classCallCheck(this,a),e.apply(this,arguments)}return _createClass(a,[{key:"init",value:function(){var t=this,e=wp.data.dispatch("core/editor"),i=e.savePost;e.savePost=function(e){"object"===_typeof(e)&&e.isPreview?i(e):(t.$form.validate(t.settings),t.$form.valid()&&i(e))}}},{key:"showMessage",value:function(){wp.data.dispatch("core/notices").createErrorNotice(i.message,{id:"meta-box-validation",isDismissible:!0})}}]),a}(a);t((function(){if(e.isGutenberg){var i=new n(".metabox-location-advanced"),r=new n(".metabox-location-normal");return new n(".metabox-location-side").init(),r.init(),void i.init()}t("#post, #edittag, #your-profile, .rwmb-form").each((function(){new a(this).init()}))}))}(jQuery,rwmb,rwmbValidation);
15
  * Copyright (c) 2019 Jörn Zaefferer
16
  * Released under the MIT license
17
  */
18
+ function(t){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}((function(t){return function(){function e(t){return t.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}t.validator.addMethod("maxWords",(function(t,i,a){return this.optional(i)||e(t).match(/\b\w+\b/g).length<=a}),t.validator.format("Please enter {0} words or less.")),t.validator.addMethod("minWords",(function(t,i,a){return this.optional(i)||e(t).match(/\b\w+\b/g).length>=a}),t.validator.format("Please enter at least {0} words.")),t.validator.addMethod("rangeWords",(function(t,i,a){var n=e(t),r=/\b\w+\b/g;return this.optional(i)||n.match(r).length>=a[0]&&n.match(r).length<=a[1]}),t.validator.format("Please enter between {0} and {1} words."))}(),t.validator.addMethod("abaRoutingNumber",(function(t){var e=0,i=t.split(""),a=i.length;if(9!==a)return!1;for(var n=0;n<a;n+=3)e+=3*parseInt(i[n],10)+7*parseInt(i[n+1],10)+parseInt(i[n+2],10);return 0!==e&&e%10==0}),"Please enter a valid routing number."),t.validator.addMethod("accept",(function(e,i,a){var n,r,s="string"==typeof a?a.replace(/\s/g,""):"image/*",o=this.optional(i);if(o)return o;if("file"===t(i).attr("type")&&(s=s.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g,"\\$&").replace(/,/g,"|").replace(/\/\*/g,"/.*"),i.files&&i.files.length))for(r=new RegExp(".?("+s+")$","i"),n=0;n<i.files.length;n++)if(!i.files[n].type.match(r))return!1;return!0}),t.validator.format("Please enter a value with a valid mimetype.")),t.validator.addMethod("alphanumeric",(function(t,e){return this.optional(e)||/^\w+$/i.test(t)}),"Letters, numbers, and underscores only please"),t.validator.addMethod("bankaccountNL",(function(t,e){if(this.optional(e))return!0;if(!/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(t))return!1;var i,a=t.replace(/ /g,""),n=0,r=a.length;for(i=0;i<r;i++)n+=(r-i)*a.substring(i,i+1);return n%11==0}),"Please specify a valid bank account number"),t.validator.addMethod("bankorgiroaccountNL",(function(e,i){return this.optional(i)||t.validator.methods.bankaccountNL.call(this,e,i)||t.validator.methods.giroaccountNL.call(this,e,i)}),"Please specify a valid bank or giro account number"),t.validator.addMethod("bic",(function(t,e){return this.optional(e)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(t.toUpperCase())}),"Please specify a valid BIC code"),t.validator.addMethod("cifES",(function(t,e){"use strict";if(this.optional(e))return!0;var i,a,n,r,s=new RegExp(/^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi),o=t.substring(0,1),d=t.substring(1,8),l=t.substring(8,9),u=0,h=0;function c(t){return t%2==0}if(9!==t.length||!s.test(t))return!1;for(i=0;i<d.length;i++)a=parseInt(d[i],10),c(i)?h+=(a*=2)<10?a:a-9:u+=a;return n=(10-(u+h).toString().substr(-1)).toString(),n=parseInt(n,10)>9?"0":n,r="JABCDEFGHI".substr(n,1).toString(),o.match(/[ABEH]/)?l===n:o.match(/[KPQS]/)?l===r:l===n||l===r}),"Please specify a valid CIF number."),t.validator.addMethod("cnhBR",(function(t){if(11!==(t=t.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,"")).length)return!1;var e,i,a,n,r,s=0,o=0;if(e=t.charAt(0),new Array(12).join(e)===t)return!1;for(n=0,r=9,0;n<9;++n,--r)s+=+t.charAt(n)*r;for((i=s%11)>=10&&(i=0,o=2),s=0,n=0,r=1,0;n<9;++n,++r)s+=+t.charAt(n)*r;return(a=s%11)>=10?a=0:a-=o,String(i).concat(a)===t.substr(-2)}),"Please specify a valid CNH number"),t.validator.addMethod("cnpjBR",(function(t,e){"use strict";if(this.optional(e))return!0;if(14!==(t=t.replace(/[^\d]+/g,"")).length)return!1;if("00000000000000"===t||"11111111111111"===t||"22222222222222"===t||"33333333333333"===t||"44444444444444"===t||"55555555555555"===t||"66666666666666"===t||"77777777777777"===t||"88888888888888"===t||"99999999999999"===t)return!1;for(var i=t.length-2,a=t.substring(0,i),n=t.substring(i),r=0,s=i-7,o=i;o>=1;o--)r+=a.charAt(i-o)*s--,s<2&&(s=9);var d=r%11<2?0:11-r%11;if(d!==parseInt(n.charAt(0),10))return!1;i+=1,a=t.substring(0,i),r=0,s=i-7;for(var l=i;l>=1;l--)r+=a.charAt(i-l)*s--,s<2&&(s=9);return(d=r%11<2?0:11-r%11)===parseInt(n.charAt(1),10)}),"Please specify a CNPJ value number"),t.validator.addMethod("cpfBR",(function(t,e){"use strict";if(this.optional(e))return!0;if(11!==(t=t.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,"")).length)return!1;var i,a,n,r,s=0;if(i=parseInt(t.substring(9,10),10),a=parseInt(t.substring(10,11),10),n=function(t,e){var i=10*t%11;return 10!==i&&11!==i||(i=0),i===e},""===t||"00000000000"===t||"11111111111"===t||"22222222222"===t||"33333333333"===t||"44444444444"===t||"55555555555"===t||"66666666666"===t||"77777777777"===t||"88888888888"===t||"99999999999"===t)return!1;for(r=1;r<=9;r++)s+=parseInt(t.substring(r-1,r),10)*(11-r);if(n(s,i)){for(s=0,r=1;r<=10;r++)s+=parseInt(t.substring(r-1,r),10)*(12-r);return n(s,a)}return!1}),"Please specify a valid CPF number"),t.validator.addMethod("creditcard",(function(t,e){if(this.optional(e))return"dependency-mismatch";if(/[^0-9 \-]+/.test(t))return!1;var i,a,n=0,r=0,s=!1;if((t=t.replace(/\D/g,"")).length<13||t.length>19)return!1;for(i=t.length-1;i>=0;i--)a=t.charAt(i),r=parseInt(a,10),s&&(r*=2)>9&&(r-=9),n+=r,s=!s;return n%10==0}),"Please enter a valid credit card number."),t.validator.addMethod("creditcardtypes",(function(t,e,i){if(/[^0-9\-]+/.test(t))return!1;t=t.replace(/\D/g,"");var a=0;return i.mastercard&&(a|=1),i.visa&&(a|=2),i.amex&&(a|=4),i.dinersclub&&(a|=8),i.enroute&&(a|=16),i.discover&&(a|=32),i.jcb&&(a|=64),i.unknown&&(a|=128),i.all&&(a=255),1&a&&(/^(5[12345])/.test(t)||/^(2[234567])/.test(t))||2&a&&/^(4)/.test(t)?16===t.length:4&a&&/^(3[47])/.test(t)?15===t.length:8&a&&/^(3(0[012345]|[68]))/.test(t)?14===t.length:16&a&&/^(2(014|149))/.test(t)?15===t.length:32&a&&/^(6011)/.test(t)||64&a&&/^(3)/.test(t)?16===t.length:64&a&&/^(2131|1800)/.test(t)?15===t.length:!!(128&a)}),"Please enter a valid credit card number."),t.validator.addMethod("currency",(function(t,e,i){var a,n="string"==typeof i,r=n?i:i[0],s=!!n||i[1];return r=r.replace(/,/g,""),a="^["+(r=s?r+"]":r+"]?")+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",a=new RegExp(a),this.optional(e)||a.test(t)}),"Please specify a valid currency"),t.validator.addMethod("dateFA",(function(t,e){return this.optional(e)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(t)}),t.validator.messages.date),t.validator.addMethod("dateITA",(function(t,e){var i,a,n,r,s,o=!1;return/^\d{1,2}\/\d{1,2}\/\d{4}$/.test(t)?(i=t.split("/"),a=parseInt(i[0],10),n=parseInt(i[1],10),r=parseInt(i[2],10),o=(s=new Date(Date.UTC(r,n-1,a,12,0,0,0))).getUTCFullYear()===r&&s.getUTCMonth()===n-1&&s.getUTCDate()===a):o=!1,this.optional(e)||o}),t.validator.messages.date),t.validator.addMethod("dateNL",(function(t,e){return this.optional(e)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(t)}),t.validator.messages.date),t.validator.addMethod("extension",(function(t,e,i){return i="string"==typeof i?i.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(e)||t.match(new RegExp("\\.("+i+")$","i"))}),t.validator.format("Please enter a value with a valid extension.")),t.validator.addMethod("giroaccountNL",(function(t,e){return this.optional(e)||/^[0-9]{1,7}$/.test(t)}),"Please specify a valid giro account number"),t.validator.addMethod("greaterThan",(function(e,i,a){var n=t(a);return this.settings.onfocusout&&n.not(".validate-greaterThan-blur").length&&n.addClass("validate-greaterThan-blur").on("blur.validate-greaterThan",(function(){t(i).valid()})),e>n.val()}),"Please enter a greater value."),t.validator.addMethod("greaterThanEqual",(function(e,i,a){var n=t(a);return this.settings.onfocusout&&n.not(".validate-greaterThanEqual-blur").length&&n.addClass("validate-greaterThanEqual-blur").on("blur.validate-greaterThanEqual",(function(){t(i).valid()})),e>=n.val()}),"Please enter a greater value."),t.validator.addMethod("iban",(function(t,e){if(this.optional(e))return!0;var i,a,n,r,s,o=t.replace(/ /g,"").toUpperCase(),d="",l=!0,u="";if(o.length<5)return!1;if(void 0!==(n={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"}[o.substring(0,2)])&&!new RegExp("^[A-Z]{2}\\d{2}"+n+"$","").test(o))return!1;for(i=o.substring(4,o.length)+o.substring(0,4),r=0;r<i.length;r++)"0"!==(a=i.charAt(r))&&(l=!1),l||(d+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(a));for(s=0;s<d.length;s++)u=(""+u+d.charAt(s))%97;return 1===u}),"Please specify a valid IBAN"),t.validator.addMethod("integer",(function(t,e){return this.optional(e)||/^-?\d+$/.test(t)}),"A positive or negative non-decimal number please"),t.validator.addMethod("ipv4",(function(t,e){return this.optional(e)||/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(t)}),"Please enter a valid IP v4 address."),t.validator.addMethod("ipv6",(function(t,e){return this.optional(e)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(t)}),"Please enter a valid IP v6 address."),t.validator.addMethod("lessThan",(function(e,i,a){var n=t(a);return this.settings.onfocusout&&n.not(".validate-lessThan-blur").length&&n.addClass("validate-lessThan-blur").on("blur.validate-lessThan",(function(){t(i).valid()})),e<n.val()}),"Please enter a lesser value."),t.validator.addMethod("lessThanEqual",(function(e,i,a){var n=t(a);return this.settings.onfocusout&&n.not(".validate-lessThanEqual-blur").length&&n.addClass("validate-lessThanEqual-blur").on("blur.validate-lessThanEqual",(function(){t(i).valid()})),e<=n.val()}),"Please enter a lesser value."),t.validator.addMethod("lettersonly",(function(t,e){return this.optional(e)||/^[a-z]+$/i.test(t)}),"Letters only please"),t.validator.addMethod("letterswithbasicpunc",(function(t,e){return this.optional(e)||/^[a-z\-.,()'"\s]+$/i.test(t)}),"Letters or punctuation only please"),t.validator.addMethod("maxfiles",(function(e,i,a){return!!this.optional(i)||!("file"===t(i).attr("type")&&i.files&&i.files.length>a)}),t.validator.format("Please select no more than {0} files.")),t.validator.addMethod("maxsize",(function(e,i,a){if(this.optional(i))return!0;if("file"===t(i).attr("type")&&i.files&&i.files.length)for(var n=0;n<i.files.length;n++)if(i.files[n].size>a)return!1;return!0}),t.validator.format("File size must not exceed {0} bytes each.")),t.validator.addMethod("maxsizetotal",(function(e,i,a){if(this.optional(i))return!0;if("file"===t(i).attr("type")&&i.files&&i.files.length)for(var n=0,r=0;r<i.files.length;r++)if((n+=i.files[r].size)>a)return!1;return!0}),t.validator.format("Total size of all files must not exceed {0} bytes.")),t.validator.addMethod("mobileNL",(function(t,e){return this.optional(e)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(t)}),"Please specify a valid mobile number"),t.validator.addMethod("mobileRU",(function(t,e){var i=t.replace(/\(|\)|\s+|-/g,"");return this.optional(e)||i.length>9&&/^((\+7|7|8)+([0-9]){10})$/.test(i)}),"Please specify a valid mobile number"),t.validator.addMethod("mobileUK",(function(t,e){return t=t.replace(/\(|\)|\s+|-/g,""),this.optional(e)||t.length>9&&t.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)}),"Please specify a valid mobile number"),t.validator.addMethod("netmask",(function(t,e){return this.optional(e)||/^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test(t)}),"Please enter a valid netmask."),t.validator.addMethod("nieES",(function(t,e){"use strict";if(this.optional(e))return!0;var i,a=new RegExp(/^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi),n=t.substr(t.length-1).toUpperCase();return!((t=t.toString().toUpperCase()).length>10||t.length<9||!a.test(t))&&(i=9===(t=t.replace(/^[X]/,"0").replace(/^[Y]/,"1").replace(/^[Z]/,"2")).length?t.substr(0,8):t.substr(0,9),"TRWAGMYFPDXBNJZSQVHLCKET".charAt(parseInt(i,10)%23)===n)}),"Please specify a valid NIE number."),t.validator.addMethod("nifES",(function(t,e){"use strict";return!!this.optional(e)||!!(t=t.toUpperCase()).match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")&&(/^[0-9]{8}[A-Z]{1}$/.test(t)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(t.substring(8,0)%23)===t.charAt(8):!!/^[KLM]{1}/.test(t)&&t[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(t.substring(8,1)%23))}),"Please specify a valid NIF number."),t.validator.addMethod("nipPL",(function(t){"use strict";if(10!==(t=t.replace(/[^0-9]/g,"")).length)return!1;for(var e=[6,5,7,2,3,4,5,6,7],i=0,a=0;a<9;a++)i+=e[a]*t[a];var n=i%11;return(10===n?0:n)===parseInt(t[9],10)}),"Please specify a valid NIP number."),t.validator.addMethod("nisBR",(function(t){var e,i,a,n,r,s=0;if(11!==(t=t.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,"")).length)return!1;for(i=parseInt(t.substring(10,11),10),e=parseInt(t.substring(0,10),10),n=2;n<12;n++)r=n,10===n&&(r=2),11===n&&(r=3),s+=e%10*r,e=parseInt(e/10,10);return i===(a=(a=s%11)>1?11-a:0)}),"Please specify a valid NIS/PIS number"),t.validator.addMethod("notEqualTo",(function(e,i,a){return this.optional(i)||!t.validator.methods.equalTo.call(this,e,i,a)}),"Please enter a different value, values must not be the same."),t.validator.addMethod("nowhitespace",(function(t,e){return this.optional(e)||/^\S+$/i.test(t)}),"No white space please"),t.validator.addMethod("pattern",(function(t,e,i){return!!this.optional(e)||("string"==typeof i&&(i=new RegExp("^(?:"+i+")$")),i.test(t))}),"Invalid format."),t.validator.addMethod("phoneNL",(function(t,e){return this.optional(e)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(t)}),"Please specify a valid phone number."),t.validator.addMethod("phonePL",(function(t,e){t=t.replace(/\s+/g,"");return this.optional(e)||/^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/.test(t)}),"Please specify a valid phone number"),t.validator.addMethod("phonesUK",(function(t,e){return t=t.replace(/\(|\)|\s+|-/g,""),this.optional(e)||t.length>9&&t.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)}),"Please specify a valid uk phone number"),t.validator.addMethod("phoneUK",(function(t,e){return t=t.replace(/\(|\)|\s+|-/g,""),this.optional(e)||t.length>9&&t.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)}),"Please specify a valid phone number"),t.validator.addMethod("phoneUS",(function(t,e){return t=t.replace(/\s+/g,""),this.optional(e)||t.length>9&&t.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/)}),"Please specify a valid phone number"),t.validator.addMethod("postalcodeBR",(function(t,e){return this.optional(e)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(t)}),"Informe um CEP válido."),t.validator.addMethod("postalCodeCA",(function(t,e){return this.optional(e)||/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test(t)}),"Please specify a valid postal code"),t.validator.addMethod("postalcodeIT",(function(t,e){return this.optional(e)||/^\d{5}$/.test(t)}),"Please specify a valid postal code"),t.validator.addMethod("postalcodeNL",(function(t,e){return this.optional(e)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(t)}),"Please specify a valid postal code"),t.validator.addMethod("postcodeUK",(function(t,e){return this.optional(e)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(t)}),"Please specify a valid UK postcode"),t.validator.addMethod("require_from_group",(function(e,i,a){var n=t(a[1],i.form),r=n.eq(0),s=r.data("valid_req_grp")?r.data("valid_req_grp"):t.extend({},this),o=n.filter((function(){return s.elementValue(this)})).length>=a[0];return r.data("valid_req_grp",s),t(i).data("being_validated")||(n.data("being_validated",!0),n.each((function(){s.element(this)})),n.data("being_validated",!1)),o}),t.validator.format("Please fill at least {0} of these fields.")),t.validator.addMethod("skip_or_fill_minimum",(function(e,i,a){var n=t(a[1],i.form),r=n.eq(0),s=r.data("valid_skip")?r.data("valid_skip"):t.extend({},this),o=n.filter((function(){return s.elementValue(this)})).length,d=0===o||o>=a[0];return r.data("valid_skip",s),t(i).data("being_validated")||(n.data("being_validated",!0),n.each((function(){s.element(this)})),n.data("being_validated",!1)),d}),t.validator.format("Please either skip these fields or fill at least {0} of them.")),t.validator.addMethod("stateUS",(function(t,e,i){var a,n=void 0===i,r=!n&&void 0!==i.caseSensitive&&i.caseSensitive,s=!n&&void 0!==i.includeTerritories&&i.includeTerritories,o=!n&&void 0!==i.includeMilitary&&i.includeMilitary;return a=s||o?s&&o?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":s?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",a=r?new RegExp(a):new RegExp(a,"i"),this.optional(e)||a.test(t)}),"Please specify a valid state"),t.validator.addMethod("strippedminlength",(function(e,i,a){return t(e).text().length>=a}),t.validator.format("Please enter at least {0} characters")),t.validator.addMethod("time",(function(t,e){return this.optional(e)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(t)}),"Please enter a valid time, between 00:00 and 23:59"),t.validator.addMethod("time12h",(function(t,e){return this.optional(e)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(t)}),"Please enter a valid time in 12-hour am/pm format"),t.validator.addMethod("url2",(function(t,e){return this.optional(e)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)}),t.validator.messages.url),t.validator.addMethod("vinUS",(function(t){if(17!==t.length)return!1;var e,i,a,n,r,s,o=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],d=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],l=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],u=0;for(e=0;e<17;e++){if(n=l[e],a=t.slice(e,e+1),8===e&&(s=a),isNaN(a)){for(i=0;i<o.length;i++)if(a.toUpperCase()===o[i]){a=d[i],a*=n,isNaN(s)&&8===i&&(s=o[i]);break}}else a*=n;u+=a}return 10===(r=u%11)&&(r="X"),r===s}),"The specified vehicle identification number (VIN) is invalid."),t.validator.addMethod("zipcodeUS",(function(t,e){return this.optional(e)||/^\d{5}(-\d{4})?$/.test(t)}),"The specified US ZIP Code is invalid"),t.validator.addMethod("ziprange",(function(t,e){return this.optional(e)||/^90[2-5]\d\{2\}-\d{4}$/.test(t)}),"Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx"),t})),function(t,e,i){"use strict";var a=function(){function e(i){_classCallCheck(this,e),this.$form=t(i),this.validationElements=this.$form.find(".rwmb-validation"),this.showAsterisks(),this.getSettings()}return _createClass(e,[{key:"init",value:function(){this.$form.on("submit",(function(){"undefined"!=typeof tinyMCE&&tinyMCE.triggerSave()})).validate(this.settings)}},{key:"showAsterisks",value:function(){this.validationElements.each((function(){var e=t(this).data("validation");t.each(e.rules,(function(e,i){if(i.required){var a=t('[name="'+e+'"]');a.length&&a.closest(".rwmb-input").siblings(".rwmb-label").find("label").append('<span class="rwmb-required">*</span>')}}))}))}},{key:"getSettings",value:function(){this.settings={ignore:':not(.rwmb-media,.rwmb-image_select,.rwmb-wysiwyg,[class|="rwmb"]:visible)',errorPlacement:function(t,e){t.appendTo(e.closest(".rwmb-input"))},errorClass:"rwmb-error",errorElement:"p",invalidHandler:this.invalidHandler.bind(this)};var e=this;this.validationElements.each((function(){t.extend(!0,e.settings,t(this).data("validation"))}))}},{key:"invalidHandler",value:function(){this.showMessage();var t=this;setTimeout((function(){t.$form.trigger("after_validate")}),200)}},{key:"showMessage",value:function(){t("#publish").removeClass("button-primary-disabled"),t("#ajax-loading").attr("style",""),t("#rwmb-validation-message").remove(),this.$form.before('<div id="rwmb-validation-message" class="notice notice-error is-dismissible"><p>'+i.message+"</p></div>")}}]),e}(),n=function(t){_inherits(a,t);var e=_createSuper(a);function a(){return _classCallCheck(this,a),e.apply(this,arguments)}return _createClass(a,[{key:"init",value:function(){var t=this,e=wp.data.dispatch("core/editor"),i=e.savePost;e.savePost=function(e){"object"===_typeof(e)&&e.isPreview?i(e):(t.$form.validate(t.settings),t.$form.valid()&&i(e))}}},{key:"showMessage",value:function(){wp.data.dispatch("core/notices").createErrorNotice(i.message,{id:"meta-box-validation",isDismissible:!0})}}]),a}(a);t((function(){if(e.isGutenberg){var i=new n(".metabox-location-advanced"),r=new n(".metabox-location-normal");return new n(".metabox-location-side").init(),r.init(),void i.init()}t("#post, #edittag, #your-profile, .rwmb-form").each((function(){new a(this).init()}))}))}(jQuery,rwmb,rwmbValidation);
js/wysiwyg.js CHANGED
@@ -1,6 +1,8 @@
1
- ( function ( $, wp, window, rwmb ) {
2
  'use strict';
3
 
 
 
4
  /**
5
  * Transform textarea into wysiwyg editor.
6
  */
@@ -10,11 +12,12 @@
10
  id = $this.attr( 'id' ),
11
  isInBlock = $this.closest( '.wp-block' ).length > 0;
12
 
13
- // Ignore existing editor.
14
- if ( ! isInBlock && tinyMCEPreInit.mceInit[id] ) {
15
  return;
16
  }
17
 
 
 
18
  // Update the ID attribute if the editor is in a new block.
19
  if ( isInBlock ) {
20
  id = id + '_' + rwmb.uniqid();
@@ -31,13 +34,15 @@
31
 
32
  // TinyMCE
33
  if ( window.tinymce ) {
34
- var editor = new tinymce.Editor(id, settings.tinymce, tinymce.EditorManager);
35
  editor.render();
36
 
37
  editor.on( 'keyup change', function() {
38
  editor.save();
39
  $this.trigger( 'change' );
40
  } );
 
 
41
  }
42
 
43
  // Quick tags
@@ -48,14 +53,20 @@
48
  }
49
  }
50
 
 
 
 
 
 
 
51
  function getEditorSettings( id ) {
52
  var settings = getDefaultEditorSettings();
53
 
54
  if ( id && tinyMCEPreInit.mceInit.hasOwnProperty( id ) ) {
55
- settings.tinymce = tinyMCEPreInit.mceInit[id];
56
  }
57
  if ( id && window.quicktags && tinyMCEPreInit.qtInit.hasOwnProperty( id ) ) {
58
- settings.quicktags = tinyMCEPreInit.qtInit[id];
59
  }
60
 
61
  return settings;
@@ -78,6 +89,12 @@
78
  * @param $el Current cloned textarea
79
  */
80
  function getOriginalId( $el ) {
 
 
 
 
 
 
81
  var $clone = $el.closest( '.rwmb-clone' ),
82
  currentId = $clone.find( '.rwmb-wysiwyg' ).attr( 'id' );
83
 
@@ -99,10 +116,10 @@
99
  function updateDom( $wrapper, id ) {
100
  // Wrapper div and media buttons
101
  $wrapper.attr( 'id', 'wp-' + id + '-wrap' )
102
- .find( '.mce-container' ).remove().end() // Remove rendered tinyMCE editor
103
- .find( '.wp-editor-tools' ).attr( 'id', 'wp-' + id + '-editor-tools' )
104
- .find( '.wp-media-buttons' ).attr( 'id', 'wp-' + id + '-media-buttons' )
105
- .find( 'button' ).data( 'editor', id ).attr( 'data-editor', id );
106
 
107
  // Set default active mode.
108
  $wrapper.removeClass( 'html-active tmce-active' );
@@ -110,15 +127,15 @@
110
 
111
  // Editor tabs
112
  $wrapper.find( '.switch-tmce' )
113
- .attr( 'id', id + 'tmce' )
114
- .data( 'wp-editor-id', id ).attr( 'data-wp-editor-id', id ).end()
115
- .find( '.switch-html' )
116
- .attr( 'id', id + 'html' )
117
- .data( 'wp-editor-id', id ).attr( 'data-wp-editor-id', id );
118
 
119
  // Quick tags
120
  $wrapper.find( '.wp-editor-container' ).attr( 'id', 'wp-' + id + '-editor-container' )
121
- .find( '.quicktags-toolbar' ).attr( 'id', 'qt_' + id + '_toolbar' ).html( '' );
122
  }
123
 
124
  /**
@@ -127,7 +144,7 @@
127
  * https://github.com/WordPress/gutenberg/issues/7176
128
  */
129
  function ensureSave() {
130
- if ( ! wp.data || ! wp.data.hasOwnProperty( 'subscribe' ) || ! window.tinyMCE ) {
131
  return;
132
  }
133
  wp.data.subscribe( function() {
@@ -143,6 +160,13 @@
143
  $( e.target ).find( '.rwmb-wysiwyg' ).each( transform );
144
  }
145
 
 
 
 
 
 
 
 
146
  ensureSave();
147
  rwmb.$document
148
  .on( 'mb_blocks_edit', init )
1
+ ( function( $, wp, window, rwmb ) {
2
  'use strict';
3
 
4
+ var renderedEditors = [];
5
+
6
  /**
7
  * Transform textarea into wysiwyg editor.
8
  */
12
  id = $this.attr( 'id' ),
13
  isInBlock = $this.closest( '.wp-block' ).length > 0;
14
 
15
+ if ( renderedEditors.includes( id ) ) {
 
16
  return;
17
  }
18
 
19
+ addRequiredAttribute( $this );
20
+
21
  // Update the ID attribute if the editor is in a new block.
22
  if ( isInBlock ) {
23
  id = id + '_' + rwmb.uniqid();
34
 
35
  // TinyMCE
36
  if ( window.tinymce ) {
37
+ var editor = new tinymce.Editor( id, settings.tinymce, tinymce.EditorManager );
38
  editor.render();
39
 
40
  editor.on( 'keyup change', function() {
41
  editor.save();
42
  $this.trigger( 'change' );
43
  } );
44
+
45
+ renderedEditors.push( id );
46
  }
47
 
48
  // Quick tags
53
  }
54
  }
55
 
56
+ function addRequiredAttribute( $el ) {
57
+ if ( $el.hasClass( 'rwmb-wysiwyg-required' ) ) {
58
+ $el.prop( 'required', true );
59
+ }
60
+ }
61
+
62
  function getEditorSettings( id ) {
63
  var settings = getDefaultEditorSettings();
64
 
65
  if ( id && tinyMCEPreInit.mceInit.hasOwnProperty( id ) ) {
66
+ settings.tinymce = tinyMCEPreInit.mceInit[ id ];
67
  }
68
  if ( id && window.quicktags && tinyMCEPreInit.qtInit.hasOwnProperty( id ) ) {
69
+ settings.quicktags = tinyMCEPreInit.qtInit[ id ];
70
  }
71
 
72
  return settings;
89
  * @param $el Current cloned textarea
90
  */
91
  function getOriginalId( $el ) {
92
+ // Existing editors.
93
+ var id = $el.attr( 'id' );
94
+ if ( tinyMCEPreInit.mceInit[ id ] ) {
95
+ return id;
96
+ }
97
+
98
  var $clone = $el.closest( '.rwmb-clone' ),
99
  currentId = $clone.find( '.rwmb-wysiwyg' ).attr( 'id' );
100
 
116
  function updateDom( $wrapper, id ) {
117
  // Wrapper div and media buttons
118
  $wrapper.attr( 'id', 'wp-' + id + '-wrap' )
119
+ .find( '.mce-container' ).remove().end() // Remove rendered tinyMCE editor
120
+ .find( '.wp-editor-tools' ).attr( 'id', 'wp-' + id + '-editor-tools' )
121
+ .find( '.wp-media-buttons' ).attr( 'id', 'wp-' + id + '-media-buttons' )
122
+ .find( 'button' ).data( 'editor', id ).attr( 'data-editor', id );
123
 
124
  // Set default active mode.
125
  $wrapper.removeClass( 'html-active tmce-active' );
127
 
128
  // Editor tabs
129
  $wrapper.find( '.switch-tmce' )
130
+ .attr( 'id', id + 'tmce' )
131
+ .data( 'wp-editor-id', id ).attr( 'data-wp-editor-id', id ).end()
132
+ .find( '.switch-html' )
133
+ .attr( 'id', id + 'html' )
134
+ .data( 'wp-editor-id', id ).attr( 'data-wp-editor-id', id );
135
 
136
  // Quick tags
137
  $wrapper.find( '.wp-editor-container' ).attr( 'id', 'wp-' + id + '-editor-container' )
138
+ .find( '.quicktags-toolbar' ).attr( 'id', 'qt_' + id + '_toolbar' ).html( '' );
139
  }
140
 
141
  /**
144
  * https://github.com/WordPress/gutenberg/issues/7176
145
  */
146
  function ensureSave() {
147
+ if ( !wp.data || !wp.data.hasOwnProperty( 'subscribe' ) || !window.tinyMCE ) {
148
  return;
149
  }
150
  wp.data.subscribe( function() {
160
  $( e.target ).find( '.rwmb-wysiwyg' ).each( transform );
161
  }
162
 
163
+ // Force re-render editors. Use setTimeOut to run after all other code. Bug occurs in WP 5.6.
164
+ $( function() {
165
+ setTimeout( function() {
166
+ $( '.rwmb-wysiwyg' ).each( transform );
167
+ }, 0 );
168
+ } );
169
+
170
  ensureSave();
171
  rwmb.$document
172
  .on( 'mb_blocks_edit', init )
meta-box.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Meta Box
4
  * Plugin URI: https://metabox.io
5
  * Description: Create custom meta boxes and custom fields in WordPress.
6
- * Version: 5.3.5
7
  * Author: MetaBox.io
8
  * Author URI: https://metabox.io
9
  * License: GPL2+
3
  * Plugin Name: Meta Box
4
  * Plugin URI: https://metabox.io
5
  * Description: Create custom meta boxes and custom fields in WordPress.
6
+ * Version: 5.3.6
7
  * Author: MetaBox.io
8
  * Author URI: https://metabox.io
9
  * License: GPL2+
readme.txt CHANGED
@@ -1,24 +1,24 @@
1
  === Meta Box - WordPress Custom Fields Framework ===
2
  Contributors: elightup, metabox, rilwis, fitwp, f-j-kaiser, funkatronic, PerWiklander, ruanmer, Omnicia
3
  Donate link: https://metabox.io/pricing/
4
- Tags: meta-box, custom fields, custom field, meta, meta-boxes, admin, advanced, custom, edit, field, file, image, magic fields, matrix, more fields, Post, repeater, simple fields, text, textarea, type, cms, fields post
5
  Requires at least: 4.3
6
  Requires PHP: 5.3
7
- Tested up to: 5.5.4
8
- Stable tag: 5.3.5
9
  License: GPLv2 or later
10
 
11
- Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress.
12
 
13
  == Description ==
14
 
15
- **Meta Box is a powerful, professional, and lightweight toolkit for developers to create unlimited custom meta boxes and WordPress custom fields.**
16
 
17
- Meta Box helps you add [custom fields](https://metabox.io) and details on your website such as pages, posts, forms and anywhere you want using over 40 different field types such as text, images, file upload, checkboxes, and more.
18
 
19
  On top of that, each WordPress custom field type has extensive internal options for unlimited content possibilities. Complete customization and control is just a few clicks away.
20
 
21
- Adding WordPress custom fields and custom meta boxes is quick and painless: Select the field types you want in the user-friendly [Online Generator](https://metabox.io/online-generator/), then copy and paste the code into your child theme's `functions.php` file.
22
 
23
  **Boom! All the power with none of the bloat.**
24
 
@@ -36,7 +36,7 @@ That's right – any type. No matter where you need to insert custom data and fe
36
 
37
  - Posts
38
  - Pages
39
- - Custom post types
40
  - [Taxonomies](https://metabox.io/plugins/mb-term-meta/)
41
  - [Settings pages](https://metabox.io/plugins/mb-settings-page/)
42
  - [Theme option pages](https://metabox.io/plugins/mb-settings-page/)
@@ -57,7 +57,7 @@ Take your standard WordPress custom field and imagine it infinitely expanded. Th
57
 
58
  As a developer, you have enough on your plate. You shouldn't have to create an entirely new system for each project. Use Meta Box to your full advantage.
59
 
60
- You can use Meta Box and its custom fields in WordPress on as many websites as you want so you can use it on client projects as well.
61
 
62
  - Has an ultra-lightweight, yet powerful API that won't overload your site.
63
  - Add only what you need instead of getting stuck with a bundle of features you don't even want that bloat your site.
@@ -69,7 +69,7 @@ You can use Meta Box and its custom fields in WordPress on as many websites as y
69
 
70
  Meta Box is built mostly for developers since you need to copy and paste some code, but if you prefer a more visual system to create custom fields in WordPress, you can choose one or all of the extensions below:
71
 
72
- - [MB Custom Post Type](https://wordpress.org/plugins/mb-custom-post-type/)
73
  - [Meta Box – Beaver Themer Integrator](https://metabox.io/plugins/meta-box-beaver-themer-integrator/)
74
  - [Meta Box Builder](https://metabox.io/plugins/meta-box-builder/)
75
 
@@ -90,7 +90,7 @@ You'll have ultimate control to add whatever meta box and custom fields in WordP
90
 
91
  #### Free Extensions
92
 
93
- - [MB Custom Post Type](https://wordpress.org/plugins/mb-custom-post-type/): Create and manage custom post types and taxonomies quickly with an easy-to-use interface.
94
  - [MB Relationships](https://wordpress.org/plugins/mb-relationships/): Create as many connections as you want from post-to-post or page-to-page.
95
  - [Meta Box Yoast SEO](https://wordpress.org/plugins/meta-box-yoast-seo/): Add WordPress custom fields to Yoast SEO Content Analysis to generate more accurate SEO scores.
96
  - [MB Rest API](https://metabox.io/plugins/mb-rest-api/): Pull all meta values from posts and terms into the WP REST API responses.
@@ -102,6 +102,7 @@ You'll have ultimate control to add whatever meta box and custom fields in WordP
102
 
103
  #### Premium Extensions
104
 
 
105
  - [MB Blocks](https://metabox.io/plugins/mb-blocks/): Create custom Gutenberg blocks with PHP, using the same syntax in Meta Box.
106
  - [Meta Box Builder](https://metabox.io/plugins/meta-box-builder/): Create custom meta boxes and custom fields in WordPress using a user-friendly drag-and-drop interface.
107
  - [Meta Box Group](https://metabox.io/plugins/meta-box-group/): Create repeatable groups of WordPress custom fields for better appearance and structure.
@@ -167,6 +168,12 @@ To getting started with the plugin, please read the [Quick Start Guide](https://
167
 
168
  == Changelog ==
169
 
 
 
 
 
 
 
170
  = 5.3.5 - 2020-11-30 =
171
  - Update color picker library to v3.0.0 and fix color picker with opacity not working in the Customizer (used with [MB Settings Page](https://metabox.io/plugins/mb-settings/page/)).
172
  - Cache update requests
1
  === Meta Box - WordPress Custom Fields Framework ===
2
  Contributors: elightup, metabox, rilwis, fitwp, f-j-kaiser, funkatronic, PerWiklander, ruanmer, Omnicia
3
  Donate link: https://metabox.io/pricing/
4
+ Tags: meta-box, custom fields, custom field, meta, meta-boxes, admin, advanced, custom, edit, field, file, image, magic fields, post type, post types, more fields, Post, repeater, simple fields, text, textarea, type, cms, fields post
5
  Requires at least: 4.3
6
  Requires PHP: 5.3
7
+ Tested up to: 5.6
8
+ Stable tag: 5.3.6
9
  License: GPLv2 or later
10
 
11
+ Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for your custom post types in WordPress.
12
 
13
  == Description ==
14
 
15
+ **Meta Box is a powerful, professional, and lightweight toolkit for developers to create custom meta boxes and custom fields for any custom post type in WordPress.**
16
 
17
+ Meta Box helps you add [custom fields](https://metabox.io) and details on your website such as pages, posts, custom post types, forms and anywhere you want using over 40 different field types such as text, images, file upload, checkboxes, and more.
18
 
19
  On top of that, each WordPress custom field type has extensive internal options for unlimited content possibilities. Complete customization and control is just a few clicks away.
20
 
21
+ Adding WordPress custom fields and custom meta boxes for custom post types is quick and painless: Select the field types you want in the user-friendly [Online Generator](https://metabox.io/online-generator/), then copy and paste the code into your child theme's `functions.php` file.
22
 
23
  **Boom! All the power with none of the bloat.**
24
 
36
 
37
  - Posts
38
  - Pages
39
+ - Custom post types (you can also use our free plugin [MB Custom Post Types & Custom Taxonomies](https://metabox.io/plugins/custom-post-type/) to create custom post types and custom taxonomies)
40
  - [Taxonomies](https://metabox.io/plugins/mb-term-meta/)
41
  - [Settings pages](https://metabox.io/plugins/mb-settings-page/)
42
  - [Theme option pages](https://metabox.io/plugins/mb-settings-page/)
57
 
58
  As a developer, you have enough on your plate. You shouldn't have to create an entirely new system for each project. Use Meta Box to your full advantage.
59
 
60
+ You can use Meta Box and its custom fields for any custom post type in WordPress on as many websites as you want so you can use it on client projects as well.
61
 
62
  - Has an ultra-lightweight, yet powerful API that won't overload your site.
63
  - Add only what you need instead of getting stuck with a bundle of features you don't even want that bloat your site.
69
 
70
  Meta Box is built mostly for developers since you need to copy and paste some code, but if you prefer a more visual system to create custom fields in WordPress, you can choose one or all of the extensions below:
71
 
72
+ - [MB Custom Post Types & Custom Taxonomies](https://wordpress.org/plugins/mb-custom-post-type/)
73
  - [Meta Box – Beaver Themer Integrator](https://metabox.io/plugins/meta-box-beaver-themer-integrator/)
74
  - [Meta Box Builder](https://metabox.io/plugins/meta-box-builder/)
75
 
90
 
91
  #### Free Extensions
92
 
93
+ - [MB Custom Post Types & Custom Taxonomies](https://wordpress.org/plugins/mb-custom-post-type/): Create and manage custom post types and taxonomies quickly with an easy-to-use interface.
94
  - [MB Relationships](https://wordpress.org/plugins/mb-relationships/): Create as many connections as you want from post-to-post or page-to-page.
95
  - [Meta Box Yoast SEO](https://wordpress.org/plugins/meta-box-yoast-seo/): Add WordPress custom fields to Yoast SEO Content Analysis to generate more accurate SEO scores.
96
  - [MB Rest API](https://metabox.io/plugins/mb-rest-api/): Pull all meta values from posts and terms into the WP REST API responses.
102
 
103
  #### Premium Extensions
104
 
105
+ - [MB Views](https://metabox.io/plugins/mb-views/): Outputing custom fields and build front-end templates for WordPress without touching theme files.
106
  - [MB Blocks](https://metabox.io/plugins/mb-blocks/): Create custom Gutenberg blocks with PHP, using the same syntax in Meta Box.
107
  - [Meta Box Builder](https://metabox.io/plugins/meta-box-builder/): Create custom meta boxes and custom fields in WordPress using a user-friendly drag-and-drop interface.
108
  - [Meta Box Group](https://metabox.io/plugins/meta-box-group/): Create repeatable groups of WordPress custom fields for better appearance and structure.
168
 
169
  == Changelog ==
170
 
171
+ = 5.3.6 - 2020-12-29 =
172
+ - Fix validation not working for image-select, image and wysiwyg fields
173
+ - Fix clone_default not working for switch
174
+ - Fix saving select field value when defining each option as an array
175
+ - Fix wysiwyg not editable in WP 5.6
176
+
177
  = 5.3.5 - 2020-11-30 =
178
  - Update color picker library to v3.0.0 and fix color picker with opacity not working in the Customizer (used with [MB Settings Page](https://metabox.io/plugins/mb-settings/page/)).
179
  - Cache update requests