Meta Box - Version 5.4.8

Version Description

  • 2021-10-20 =
  • Respect cols attribute of textarea field to set the width of the input (without cols, textarea is 100% width)
  • Fix padding for seamless style in Gutenberg
  • Fix divider not showing in Gutenberg
  • Remove unnesseccary escape meta value
Download this release

Release Info

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

Code changes from version 5.4.7 to 5.4.8

css/divider.css CHANGED
@@ -1,7 +1,5 @@
1
- /* =Styles for 'divider' field
2
- -------------------------------------------------------------- */
3
-
4
  .rwmb-divider-wrapper hr {
 
5
  border: none;
6
  border-top: 1px solid #e6e6e6;
7
  }
 
 
 
1
  .rwmb-divider-wrapper hr {
2
+ flex: 1;
3
  border: none;
4
  border-top: 1px solid #e6e6e6;
5
  }
css/style.css CHANGED
@@ -31,7 +31,7 @@
31
  .rwmb-input-group,
32
  .rwmb-input select,
33
  .rwmb-input .select2-container,
34
- .rwmb-input textarea {
35
  width: 100%;
36
  }
37
  .rwmb-input input[type="checkbox"],
@@ -151,7 +151,7 @@ select.rwmb-error {
151
  border: none;
152
  box-shadow: none;
153
  }
154
- .rwmb-seamless .inside {
155
  padding-left: 0;
156
  padding-right: 0;
157
  }
31
  .rwmb-input-group,
32
  .rwmb-input select,
33
  .rwmb-input .select2-container,
34
+ .rwmb-input textarea:not([cols]) {
35
  width: 100%;
36
  }
37
  .rwmb-input input[type="checkbox"],
151
  border: none;
152
  box-shadow: none;
153
  }
154
+ .rwmb-seamless .inside.inside {
155
  padding-left: 0;
156
  padding-right: 0;
157
  }
inc/field.php CHANGED
@@ -227,23 +227,9 @@ abstract class RWMB_Field {
227
  $meta = RWMB_Helpers_Array::ensure( $meta );
228
  }
229
 
230
- // Escape attributes.
231
- $meta = self::call( $field, 'esc_meta', $meta );
232
-
233
  return $meta;
234
  }
235
 
236
- /**
237
- * Escape meta for field output.
238
- *
239
- * @param mixed $meta Meta value.
240
- *
241
- * @return mixed
242
- */
243
- public static function esc_meta( $meta ) {
244
- return is_array( $meta ) ? array_map( __METHOD__, $meta ) : esc_attr( $meta );
245
- }
246
-
247
  /**
248
  * Process the submitted value before saving into the database.
249
  *
227
  $meta = RWMB_Helpers_Array::ensure( $meta );
228
  }
229
 
 
 
 
230
  return $meta;
231
  }
232
 
 
 
 
 
 
 
 
 
 
 
 
233
  /**
234
  * Process the submitted value before saving into the database.
235
  *
inc/fields/file.php CHANGED
@@ -64,7 +64,7 @@ class RWMB_File_Field extends RWMB_Field {
64
  $field_value = self::raw_meta( $object_id, $field );
65
  $field_value = $field['clone'] ? call_user_func_array( 'array_merge', $field_value ) : $field_value;
66
 
67
- if ( ( 'child' !== $type && ! in_array( $attachment, $field_value ) ) ||
68
  ( 'child' === $type && ! in_array( $attachment, self::get_sub_values( $field_value, $request->filter_post( 'field_id', FILTER_SANITIZE_STRING ) ) ) ) ) {
69
  wp_send_json_error( __( 'Error: Invalid file', 'meta-box' ) );
70
  }
@@ -233,15 +233,15 @@ class RWMB_File_Field extends RWMB_Field {
233
  <input type="hidden" name="%s[%s]" value="%s">
234
  </li>',
235
  $data['icon'],
236
- $data['url'],
237
- $data['title'],
238
- $data['name'],
239
  $data['edit_link'],
240
- $file,
241
- $i18n_delete,
242
- $attributes['name'],
243
- $index,
244
- $file
245
  );
246
  }
247
 
64
  $field_value = self::raw_meta( $object_id, $field );
65
  $field_value = $field['clone'] ? call_user_func_array( 'array_merge', $field_value ) : $field_value;
66
 
67
+ if ( ( 'child' !== $type && ! in_array( $attachment, $field_value ) ) ||
68
  ( 'child' === $type && ! in_array( $attachment, self::get_sub_values( $field_value, $request->filter_post( 'field_id', FILTER_SANITIZE_STRING ) ) ) ) ) {
69
  wp_send_json_error( __( 'Error: Invalid file', 'meta-box' ) );
70
  }
233
  <input type="hidden" name="%s[%s]" value="%s">
234
  </li>',
235
  $data['icon'],
236
+ esc_url( $data['url'] ),
237
+ esc_html( $data['title'] ),
238
+ esc_html( $data['name'] ),
239
  $data['edit_link'],
240
+ esc_attr( $file ),
241
+ esc_html( $i18n_delete ),
242
+ esc_attr( $attributes['name'] ),
243
+ esc_attr( $index ),
244
+ esc_attr( $file )
245
  );
246
  }
247
 
inc/fields/image.php CHANGED
@@ -47,10 +47,10 @@ class RWMB_Image_Field extends RWMB_File_Field {
47
  </li>',
48
  wp_get_attachment_image( $file, $field['image_size'] ),
49
  $edit_link,
50
- $file,
51
- $attributes['name'],
52
- $index,
53
- $file
54
  );
55
  }
56
 
47
  </li>',
48
  wp_get_attachment_image( $file, $field['image_size'] ),
49
  $edit_link,
50
+ esc_attr( $file ),
51
+ esc_attr( $attributes['name'] ),
52
+ esc_attr( $index ),
53
+ esc_attr( $file )
54
  );
55
  }
56
 
inc/fields/key-value.php CHANGED
@@ -75,20 +75,6 @@ class RWMB_Key_Value_Field extends RWMB_Input_Field {
75
  return '';
76
  }
77
 
78
- /**
79
- * Escape meta for field output.
80
- *
81
- * @param mixed $meta Meta value.
82
- *
83
- * @return mixed
84
- */
85
- public static function esc_meta( $meta ) {
86
- foreach ( (array) $meta as $k => $pairs ) {
87
- $meta[ $k ] = array_map( 'esc_attr', (array) $pairs );
88
- }
89
- return $meta;
90
- }
91
-
92
  /**
93
  * Sanitize field value.
94
  *
75
  return '';
76
  }
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  /**
79
  * Sanitize field value.
80
  *
inc/fields/textarea.php CHANGED
@@ -22,20 +22,10 @@ class RWMB_Textarea_Field extends RWMB_Field {
22
  return sprintf(
23
  '<textarea %s>%s</textarea>',
24
  self::render_attributes( $attributes ),
25
- $meta
26
  );
27
  }
28
 
29
- /**
30
- * Escape meta for field output.
31
- *
32
- * @param mixed $meta Meta value.
33
- * @return mixed
34
- */
35
- public static function esc_meta( $meta ) {
36
- return is_array( $meta ) ? array_map( 'esc_textarea', $meta ) : esc_textarea( $meta );
37
- }
38
-
39
  /**
40
  * Normalize parameters for field.
41
  *
@@ -48,7 +38,7 @@ class RWMB_Textarea_Field extends RWMB_Field {
48
  $field,
49
  array(
50
  'autocomplete' => false,
51
- 'cols' => 60,
52
  'rows' => 3,
53
  'maxlength' => false,
54
  'wrap' => false,
@@ -81,7 +71,6 @@ class RWMB_Textarea_Field extends RWMB_Field {
81
  'placeholder' => $field['placeholder'],
82
  )
83
  );
84
- $attributes['class'] .= ' large-text';
85
 
86
  return $attributes;
87
  }
22
  return sprintf(
23
  '<textarea %s>%s</textarea>',
24
  self::render_attributes( $attributes ),
25
+ esc_textarea( $meta )
26
  );
27
  }
28
 
 
 
 
 
 
 
 
 
 
 
29
  /**
30
  * Normalize parameters for field.
31
  *
38
  $field,
39
  array(
40
  'autocomplete' => false,
41
+ 'cols' => false,
42
  'rows' => 3,
43
  'maxlength' => false,
44
  'wrap' => false,
71
  'placeholder' => $field['placeholder'],
72
  )
73
  );
 
74
 
75
  return $attributes;
76
  }
inc/fields/wysiwyg.php CHANGED
@@ -56,16 +56,6 @@ class RWMB_Wysiwyg_Field extends RWMB_Field {
56
  return ob_get_clean();
57
  }
58
 
59
- /**
60
- * Escape meta for field output.
61
- *
62
- * @param mixed $meta Meta value.
63
- * @return mixed
64
- */
65
- public static function esc_meta( $meta ) {
66
- return $meta;
67
- }
68
-
69
  /**
70
  * Normalize parameters for field.
71
  *
56
  return ob_get_clean();
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
59
  /**
60
  * Normalize parameters for field.
61
  *
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.4.7' );
22
 
23
  list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
 
18
  */
19
  protected function constants() {
20
  // Script version, used to add version for scripts and styles.
21
+ define( 'RWMB_VER', '5.4.8' );
22
 
23
  list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
 
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.4.7
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.4.8
7
  * Author: MetaBox.io
8
  * Author URI: https://metabox.io
9
  * License: GPL2+
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: meta box, custom fields, custom post types, custom taxonomies, cpt, meta b
5
  Requires at least: 4.3
6
  Requires PHP: 5.6
7
  Tested up to: 5.8.1
8
- Stable tag: 5.4.7
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.
@@ -168,6 +168,12 @@ To getting started with the plugin, please read the [Quick Start Guide](https://
168
 
169
  == Changelog ==
170
 
 
 
 
 
 
 
171
  = 5.4.7 - 2021-09-16 =
172
  - Fix deleting files and images inside groups.
173
  - Fix maxlength and pattern not working if not set inside attributes
5
  Requires at least: 4.3
6
  Requires PHP: 5.6
7
  Tested up to: 5.8.1
8
+ Stable tag: 5.4.8
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.
168
 
169
  == Changelog ==
170
 
171
+ = 5.4.8 - 2021-10-20 =
172
+ - Respect `cols` attribute of `textarea` field to set the width of the input (without `cols`, textarea is 100% width)
173
+ - Fix padding for seamless style in Gutenberg
174
+ - Fix divider not showing in Gutenberg
175
+ - Remove unnesseccary escape meta value
176
+
177
  = 5.4.7 - 2021-09-16 =
178
  - Fix deleting files and images inside groups.
179
  - Fix maxlength and pattern not working if not set inside attributes