Meta Box - Version 4.7.2

Version Description

  • Fix: notice undefined index in date, time fields.
Download this release

Release Info

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

Code changes from version 4.7.1 to 4.7.2

inc/fields/checkbox.php CHANGED
@@ -47,10 +47,9 @@ if ( ! class_exists( 'RWMB_Checkbox_Field' ) )
47
  */
48
  static function normalize_field( $field )
49
  {
50
- $field = parent::normalize_field( $field );
51
- $field['attributes']['list'] = false;
52
- $field['attributes']['type'] = 'checkbox';
53
- $field['attributes']['class'] = 'rwmb-checkbox';
54
 
55
  return $field;
56
  }
47
  */
48
  static function normalize_field( $field )
49
  {
50
+ $field = parent::normalize_field( $field );
51
+ $field['attributes']['list'] = false;
52
+ $field['attributes']['type'] = 'checkbox';
 
53
 
54
  return $field;
55
  }
inc/fields/color.php CHANGED
@@ -63,8 +63,6 @@ if ( ! class_exists( 'RWMB_Color_Field' ) )
63
  'data-options' => wp_json_encode( $field['js_options'] ),
64
  ) );
65
 
66
- $field['attributes']['class'] = 'rwmb-color';
67
-
68
  return $field;
69
  }
70
  }
63
  'data-options' => wp_json_encode( $field['js_options'] ),
64
  ) );
65
 
 
 
66
  return $field;
67
  }
68
  }
inc/fields/date.php CHANGED
@@ -63,14 +63,12 @@ if ( ! class_exists( 'RWMB_Date_Field' ) )
63
  'showButtonPanel' => true,
64
  ) );
65
 
 
 
66
  $field['attributes'] = wp_parse_args( $field['attributes'], array(
67
  'data-options' => wp_json_encode( $field['js_options'] ),
68
  ) );
69
 
70
- $field = parent::normalize_field( $field );
71
-
72
- $field['attributes']['class'] = 'rwmb-date';
73
-
74
  return $field;
75
  }
76
  }
63
  'showButtonPanel' => true,
64
  ) );
65
 
66
+ $field = parent::normalize_field( $field );
67
+
68
  $field['attributes'] = wp_parse_args( $field['attributes'], array(
69
  'data-options' => wp_json_encode( $field['js_options'] ),
70
  ) );
71
 
 
 
 
 
72
  return $field;
73
  }
74
  }
inc/fields/datetime.php CHANGED
@@ -143,7 +143,8 @@ if ( ! class_exists( 'RWMB_Datetime_Field' ) )
143
  static function normalize_field( $field )
144
  {
145
  $field = wp_parse_args( $field, array(
146
- 'timestamp' => false,
 
147
  ) );
148
 
149
  // Deprecate 'format', but keep it for backward compatible
@@ -155,8 +156,6 @@ if ( ! class_exists( 'RWMB_Datetime_Field' ) )
155
 
156
  $field = RWMB_Date_Field::normalize_field( $field );
157
 
158
- $field['attributes']['class'] = 'rwmb-datetime';
159
-
160
  return $field;
161
  }
162
 
143
  static function normalize_field( $field )
144
  {
145
  $field = wp_parse_args( $field, array(
146
+ 'timestamp' => false,
147
+ 'js_options' => array()
148
  ) );
149
 
150
  // Deprecate 'format', but keep it for backward compatible
156
 
157
  $field = RWMB_Date_Field::normalize_field( $field );
158
 
 
 
159
  return $field;
160
  }
161
 
inc/fields/email.php CHANGED
@@ -21,7 +21,6 @@ if ( ! class_exists( 'RWMB_Email_Field' ) )
21
  $field = parent::normalize_field( $field );
22
 
23
  $field['attributes']['type'] = 'email';
24
- $field['attributes']['class'] = 'rwmb-email';
25
 
26
  return $field;
27
  }
21
  $field = parent::normalize_field( $field );
22
 
23
  $field['attributes']['type'] = 'email';
 
24
 
25
  return $field;
26
  }
inc/fields/hidden.php CHANGED
@@ -18,9 +18,11 @@ if ( ! class_exists( 'RWMB_Hidden_Field' ) )
18
  */
19
  static function normalize_field( $field )
20
  {
 
 
21
  $field['attributes'] = array(
22
  'name' => $field['field_name'],
23
- 'id' => $field['clone'] ? false : $field['id']
24
  );
25
 
26
  return $field;
18
  */
19
  static function normalize_field( $field )
20
  {
21
+ $field = parent::normalize_field( $field );
22
+
23
  $field['attributes'] = array(
24
  'name' => $field['field_name'],
25
+ 'id' => $field['clone'] ? false : $field['id'],
26
  );
27
 
28
  return $field;
inc/fields/input.php CHANGED
@@ -4,7 +4,7 @@ defined( 'ABSPATH' ) || exit;
4
 
5
  if ( ! class_exists( 'RWMB_Input_Field' ) )
6
  {
7
- class RWMB_Input_Field extends RWMB_Field
8
  {
9
  /**
10
  * Get field HTML
@@ -39,13 +39,13 @@ if ( ! class_exists( 'RWMB_Input_Field' ) )
39
  'datalist' => false,
40
  'disabled' => false,
41
  'required' => false,
42
- 'readonly' => false
43
  ) );
44
  if ( $field['datalist'] )
45
  {
46
  $field['datalist'] = wp_parse_args( $field['datalist'], array(
47
  'id' => $field['id'] . '_list',
48
- 'options' => array()
49
  ) );
50
  }
51
 
@@ -55,7 +55,8 @@ if ( ! class_exists( 'RWMB_Input_Field' ) )
55
  'readonly' => $field['readonly'],
56
  'required' => $field['required'],
57
  'name' => $field['field_name'],
58
- 'id' => $field['clone'] ? false : $field['id']
 
59
  ) );
60
 
61
  return $field;
@@ -70,7 +71,7 @@ if ( ! class_exists( 'RWMB_Input_Field' ) )
70
  */
71
  static function datalist_html( $field )
72
  {
73
- if ( ! $field['datalist'] )
74
  return '';
75
 
76
  $datalist = $field['datalist'];
4
 
5
  if ( ! class_exists( 'RWMB_Input_Field' ) )
6
  {
7
+ abstract class RWMB_Input_Field extends RWMB_Field
8
  {
9
  /**
10
  * Get field HTML
39
  'datalist' => false,
40
  'disabled' => false,
41
  'required' => false,
42
+ 'readonly' => false,
43
  ) );
44
  if ( $field['datalist'] )
45
  {
46
  $field['datalist'] = wp_parse_args( $field['datalist'], array(
47
  'id' => $field['id'] . '_list',
48
+ 'options' => array(),
49
  ) );
50
  }
51
 
55
  'readonly' => $field['readonly'],
56
  'required' => $field['required'],
57
  'name' => $field['field_name'],
58
+ 'class' => "rwmb-{$field['type']}",
59
+ 'id' => $field['clone'] ? false : $field['id'],
60
  ) );
61
 
62
  return $field;
71
  */
72
  static function datalist_html( $field )
73
  {
74
+ if ( empty( $field['datalist'] ) )
75
  return '';
76
 
77
  $datalist = $field['datalist'];
inc/fields/number.php CHANGED
@@ -32,8 +32,7 @@ if ( ! class_exists( 'RWMB_Number_Field' ) )
32
  'min' => $field['min'],
33
  ) );
34
 
35
- $field['attributes']['type'] = 'number';
36
- $field['attributes']['class'] = 'rwmb-number';
37
 
38
  return $field;
39
  }
32
  'min' => $field['min'],
33
  ) );
34
 
35
+ $field['attributes']['type'] = 'number';
 
36
 
37
  return $field;
38
  }
inc/fields/password.php CHANGED
@@ -20,8 +20,7 @@ if ( ! class_exists( 'RWMB_Password_Field' ) )
20
  {
21
  $field = parent::normalize_field( $field );
22
 
23
- $field['attributes']['type'] = 'password';
24
- $field['attributes']['class'] = 'rwmb-password';
25
 
26
  return $field;
27
  }
20
  {
21
  $field = parent::normalize_field( $field );
22
 
23
+ $field['attributes']['type'] = 'password';
 
24
 
25
  return $field;
26
  }
inc/fields/radio.php CHANGED
@@ -48,10 +48,9 @@ if ( ! class_exists( 'RWMB_Radio_Field' ) )
48
  {
49
  $field = parent::normalize_field( $field );
50
 
51
- $field['attributes']['list'] = false;
52
- $field['attributes']['id'] = false;
53
- $field['attributes']['type'] = 'radio';
54
- $field['attributes']['class'] = 'rwmb-radio';
55
 
56
  return $field;
57
  }
48
  {
49
  $field = parent::normalize_field( $field );
50
 
51
+ $field['attributes']['list'] = false;
52
+ $field['attributes']['id'] = false;
53
+ $field['attributes']['type'] = 'radio';
 
54
 
55
  return $field;
56
  }
inc/fields/range.php CHANGED
@@ -36,8 +36,7 @@ if ( ! class_exists( 'RWMB_Range_Field' ) )
36
 
37
  $field = parent::normalize_field( $field );
38
 
39
- $field['attributes']['type'] = 'range';
40
- $field['attributes']['class'] = 'rwmb-range';
41
 
42
  return $field;
43
  }
36
 
37
  $field = parent::normalize_field( $field );
38
 
39
+ $field['attributes']['type'] = 'range';
 
40
 
41
  return $field;
42
  }
inc/fields/text.php CHANGED
@@ -34,8 +34,7 @@ if ( ! class_exists( 'RWMB_Text_Field' ) )
34
  'placeholder' => $field['placeholder'],
35
  ) );
36
 
37
- $field['attributes']['type'] = 'text';
38
- $field['attributes']['class'] = 'rwmb-text';
39
 
40
  return $field;
41
  }
34
  'placeholder' => $field['placeholder'],
35
  ) );
36
 
37
+ $field['attributes']['type'] = 'text';
 
38
 
39
  return $field;
40
  }
inc/fields/time.php CHANGED
@@ -64,14 +64,12 @@ if ( ! class_exists( 'RWMB_Time_Field' ) )
64
  'timeFormat' => empty( $field['format'] ) ? 'HH:mm' : $field['format'],
65
  ) );
66
 
 
 
67
  $field['attributes'] = wp_parse_args( $field['attributes'], array(
68
  'data-options' => wp_json_encode( $field['js_options'] ),
69
  ) );
70
 
71
- $field = parent::normalize_field( $field );
72
-
73
- $field['attributes']['class'] = 'rwmb-time';
74
-
75
  return $field;
76
  }
77
  }
64
  'timeFormat' => empty( $field['format'] ) ? 'HH:mm' : $field['format'],
65
  ) );
66
 
67
+ $field = parent::normalize_field( $field );
68
+
69
  $field['attributes'] = wp_parse_args( $field['attributes'], array(
70
  'data-options' => wp_json_encode( $field['js_options'] ),
71
  ) );
72
 
 
 
 
 
73
  return $field;
74
  }
75
  }
inc/fields/url.php CHANGED
@@ -20,8 +20,7 @@ if ( ! class_exists( 'RWMB_URL_Field' ) )
20
  {
21
  $field = parent::normalize_field( $field );
22
 
23
- $field['attributes']['type'] = 'url';
24
- $field['attributes']['class'] = 'rwmb-url';
25
 
26
  return $field;
27
  }
20
  {
21
  $field = parent::normalize_field( $field );
22
 
23
+ $field['attributes']['type'] = 'url';
 
24
 
25
  return $field;
26
  }
meta-box-loader.php CHANGED
@@ -4,7 +4,7 @@ class RWMB_Loader
4
  {
5
  static function load( $url, $dir )
6
  {
7
- define( 'RWMB_VER', '4.7.1' );
8
 
9
  define( 'RWMB_URL', $url );
10
  define( 'RWMB_DIR', $dir );
4
  {
5
  static function load( $url, $dir )
6
  {
7
+ define( 'RWMB_VER', '4.7.2' );
8
 
9
  define( 'RWMB_URL', $url );
10
  define( 'RWMB_DIR', $dir );
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 for any post type in WordPress.
6
- * Version: 4.7.1
7
  * Author: Rilwis
8
  * Author URI: http://www.deluxeblogtips.com
9
  * License: GPL2+
@@ -15,7 +15,7 @@
15
  defined( 'ABSPATH' ) || exit;
16
 
17
  // Script version, used to add version for scripts and styles
18
- define( 'RWMB_VER', '4.7.1' );
19
 
20
  // Define plugin URLs, for fast enqueuing scripts and styles
21
  if ( ! defined( 'RWMB_URL' ) )
3
  * Plugin Name: Meta Box
4
  * Plugin URI: https://metabox.io
5
  * Description: Create custom meta boxes and custom fields for any post type in WordPress.
6
+ * Version: 4.7.2
7
  * Author: Rilwis
8
  * Author URI: http://www.deluxeblogtips.com
9
  * License: GPL2+
15
  defined( 'ABSPATH' ) || exit;
16
 
17
  // Script version, used to add version for scripts and styles
18
+ define( 'RWMB_VER', '4.7.2' );
19
 
20
  // Define plugin URLs, for fast enqueuing scripts and styles
21
  if ( ! defined( 'RWMB_URL' ) )
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.deluxeblogtips.com/donate
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: 3.5
6
  Tested up to: 4.3.1
7
- Stable tag: 4.7.1
8
  License: GPLv2 or later
9
 
10
  Meta Box plugin is a powerful, professional solution to create custom meta boxes and custom fields for WordPress websites.
@@ -75,6 +75,11 @@ To getting started with the plugin API, please read [this tutorial](https://meta
75
 
76
  == Changelog ==
77
 
 
 
 
 
 
78
  = 4.7.1 =
79
 
80
  * Fix: remove default `maxlength = 30` for text fields.
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: 3.5
6
  Tested up to: 4.3.1
7
+ Stable tag: 4.7.2
8
  License: GPLv2 or later
9
 
10
  Meta Box plugin is a powerful, professional solution to create custom meta boxes and custom fields for WordPress websites.
75
 
76
  == Changelog ==
77
 
78
+
79
+ = 4.7.2 =
80
+
81
+ * Fix: notice undefined index in date, time fields.
82
+
83
  = 4.7.1 =
84
 
85
  * Fix: remove default `maxlength = 30` for text fields.