Meta Box - Version 5.4.4

Version Description

  • 2021-07-06 =

  • Improve usability for time picker on mobile by adding +/- buttons

  • Make all input, select, textarea 100% width

  • Export clone functions to the global "rwmb"

Download this release

Release Info

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

Code changes from version 5.4.3 to 5.4.4

css/background.css CHANGED
@@ -5,10 +5,6 @@
5
  align-items: flex-start;
6
  }
7
 
8
- .rwmb-background-row .button {
9
- margin-right: 5px;
10
- }
11
-
12
  .rwmb-background-wrapper .wp-picker-container {
13
  position: relative;
14
  display: inline-block;
5
  align-items: flex-start;
6
  }
7
 
 
 
 
 
8
  .rwmb-background-wrapper .wp-picker-container {
9
  position: relative;
10
  display: inline-block;
css/date.css CHANGED
@@ -113,6 +113,18 @@
113
  opacity: 1;
114
  color: #999;
115
  }
 
 
 
 
 
 
 
 
 
 
 
 
116
  /* Other Datepicker Color Schemes */
117
  /* Blue */
118
  .admin-color-blue .ui-datepicker .ui-datepicker-header,
113
  opacity: 1;
114
  color: #999;
115
  }
116
+ /* timepicker button */
117
+ .ui-timepicker-div .ui-slider-access {
118
+ display: inline-block;
119
+ }
120
+ .ui-timepicker-div .ui-slider-access button {
121
+ padding: 0 8px;
122
+ margin: 0 2px;
123
+ border-radius: 4px;
124
+ }
125
+ .ui-timepicker-div .ui-slider-access button span.ui-button-icon{
126
+ display: inline;
127
+ }
128
  /* Other Datepicker Color Schemes */
129
  /* Blue */
130
  .admin-color-blue .ui-datepicker .ui-datepicker-header,
css/file-input.css CHANGED
@@ -1,12 +1,12 @@
1
- .rwmb-file_input.rwmb-file_input {
2
- line-height: 18px;
3
- margin: 0 5px 0 0;
4
- padding: 4px;
5
- width: 300px;
6
  }
7
- @media (max-width: 767px) {
8
- .rwmb-file_input.rwmb-file_input,
9
- .rwmb-file-input-select {
10
- margin-bottom: 5px;
11
- }
12
  }
 
 
 
1
+ .rwmb-file-input-inner {
2
+ width: 100%;
3
+ display: flex;
4
+ align-items: center;
5
+ grid-gap: 4px;
6
  }
7
+ .rwmb-file_input {
8
+ margin: 0 4px 0 0;
 
 
 
9
  }
10
+ .rwmb-file-input-inner .button {
11
+ margin: 0;
12
+ }
css/key-value.css ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ .rwmb-key_value-clone {
2
+ display: flex;
3
+ align-items: center;
4
+ }
5
+ .rwmb-key_value-clone input {
6
+ flex: 1;
7
+ }
8
+ .rwmb-key_value-clone .remove-clone {
9
+ position: static;
10
+ }
css/range.css CHANGED
@@ -1,9 +1,17 @@
 
 
 
 
 
 
 
 
1
  .rwmb-range.rwmb-range,
2
  .rwmb-range.rwmb-range:hover {
3
  vertical-align: middle;
4
  padding: 0;
5
  border: none;
6
  }
7
- .rwmb-output {
8
  margin-left: 8px;
9
  }
1
+ .rwmb-range-inner {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ }
6
+ .rwmb-range {
7
+ flex: 1;
8
+ }
9
  .rwmb-range.rwmb-range,
10
  .rwmb-range.rwmb-range:hover {
11
  vertical-align: middle;
12
  padding: 0;
13
  border: none;
14
  }
15
+ .rwmb-range-output {
16
  margin-left: 8px;
17
  }
css/select-advanced.css CHANGED
@@ -8,6 +8,9 @@
8
  .select2-dropdown {
9
  border-color: #7e8993;
10
  }
 
 
 
11
  .select2-container--open .select2-dropdown--below {
12
  border-top: 1px solid #7e8993;
13
  top: -1px;
@@ -19,6 +22,9 @@
19
  .select2-container .select2-selection--single {
20
  height: 30px;
21
  }
 
 
 
22
  .select2-container--default .select2-selection--single .select2-selection__rendered {
23
  line-height: 30px;
24
  }
@@ -31,6 +37,10 @@
31
  .select2-container .select2-search--inline {
32
  margin-bottom: 0;
33
  }
 
 
 
 
34
  .select2-search--dropdown .select2-search__field {
35
  padding: 0 4px;
36
  min-height: 30px;
8
  .select2-dropdown {
9
  border-color: #7e8993;
10
  }
11
+ .select2-container .select2-selection--multiple {
12
+ min-height: 30px;
13
+ }
14
  .select2-container--open .select2-dropdown--below {
15
  border-top: 1px solid #7e8993;
16
  top: -1px;
22
  .select2-container .select2-selection--single {
23
  height: 30px;
24
  }
25
+ .select2-container .select2-selection--multiple .select2-selection__rendered {
26
+ display: block;
27
+ }
28
  .select2-container--default .select2-selection--single .select2-selection__rendered {
29
  line-height: 30px;
30
  }
37
  .select2-container .select2-search--inline {
38
  margin-bottom: 0;
39
  }
40
+ .select2-container .select2-search--inline .select2-search__field {
41
+ margin-top: 0;
42
+ min-height: auto;
43
+ }
44
  .select2-search--dropdown .select2-search__field {
45
  padding: 0 4px;
46
  min-height: 30px;
css/slider.css CHANGED
@@ -1,12 +1,15 @@
 
 
 
 
 
1
  .rwmb-slider-ui {
2
- display: inline-block;
3
- vertical-align: middle;
4
- width: 50%;
5
  }
6
  .rwmb-slider-label {
7
- margin-left: 10px;
8
- vertical-align: middle;
9
  }
 
10
  /* Fix slider handle being visible through jQuery panel */
11
  .ui-slider .ui-slider-handle {
12
  z-index: 1;
1
+ .rwmb-slider-inner {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ }
6
  .rwmb-slider-ui {
7
+ flex: 1;
 
 
8
  }
9
  .rwmb-slider-label {
10
+ margin-left: 8px;
 
11
  }
12
+
13
  /* Fix slider handle being visible through jQuery panel */
14
  .ui-slider .ui-slider-handle {
15
  z-index: 1;
css/style.css CHANGED
@@ -2,23 +2,19 @@
2
  -------------------------------------------------------------- */
3
 
4
  /* Clearfix for field */
5
- .rwmb-field:after {
6
- content: " ";
7
- display: table;
8
- clear: both;
9
  }
10
  .rwmb-field:not(:last-of-type) {
11
  margin: 0 0 12px;
12
  }
13
- .rwmb-label,
14
- .rwmb-input {
15
- vertical-align: top;
16
- float: left;
17
- box-sizing: border-box;
18
- }
19
  .rwmb-label {
20
  width: 25%;
21
  }
 
 
 
 
22
  .rwmb-label > label {
23
  font-weight: 600;
24
  }
@@ -27,21 +23,22 @@
27
  font-weight: bold;
28
  margin-left: 3px;
29
  }
30
- .rwmb-input input,
31
- .rwmb-input select {
32
- max-width: 100%;
33
- }
34
 
35
- /* 75% if field has label, 100% if no label */
36
- .rwmb-input {
37
- width: 100%;
38
- }
39
- .rwmb-label ~ .rwmb-input {
40
- width: 75%;
41
- }
42
  .rwmb-input h4 {
43
  margin: 0;
44
  }
 
 
 
 
 
 
 
 
 
 
 
 
45
  .rwmb-textarea {
46
  resize: vertical;
47
  }
@@ -80,7 +77,7 @@
80
  box-shadow: none;
81
  }
82
  .rwmb-button.add-clone {
83
- margin-top: 5px;
84
  }
85
  .rwmb-clone-icon {
86
  cursor: move;
@@ -100,7 +97,7 @@
100
  /* jQuery validation */
101
  p.rwmb-error {
102
  color: #dc3232;
103
- margin: 2px 0 5px;
104
  clear: both;
105
  }
106
  input.rwmb-error.rwmb-error,
@@ -127,34 +124,23 @@ select.rwmb-error {
127
  width: 100%;
128
  }
129
  #side-sortables .rwmb-label {
130
- margin-bottom: 3px;
131
- }
132
- #side-sortables .rwmb-input input:not([type="checkbox"]):not([type="radio"]),
133
- #side-sortables .rwmb-input-group,
134
- #side-sortables .rwmb-input select,
135
- #side-sortables .rwmb-input .select2-container,
136
- #side-sortables .rwmb-input textarea {
137
- width: 100% !important;
138
- min-width: auto;
139
  }
140
 
141
  /* Mobile style */
142
  @media (max-width: 1023px) {
143
- .rwmb-label,
144
- .rwmb-label ~ .rwmb-input {
145
- width: 100%;
146
  }
147
  .rwmb-label {
148
- margin-bottom: 3px;
149
- }
150
- .rwmb-input input,
151
- .rwmb-input select {
152
  width: 100%;
153
- max-width: 100%;
154
  }
155
- .rwmb-input input[type="checkbox"],
156
- .rwmb-input input[type="radio"] {
157
- width: auto;
 
 
158
  }
159
  }
160
 
2
  -------------------------------------------------------------- */
3
 
4
  /* Clearfix for field */
5
+ .rwmb-field {
6
+ display: flex;
 
 
7
  }
8
  .rwmb-field:not(:last-of-type) {
9
  margin: 0 0 12px;
10
  }
 
 
 
 
 
 
11
  .rwmb-label {
12
  width: 25%;
13
  }
14
+ .rwmb-input {
15
+ flex: 1;
16
+ }
17
+
18
  .rwmb-label > label {
19
  font-weight: 600;
20
  }
23
  font-weight: bold;
24
  margin-left: 3px;
25
  }
 
 
 
 
26
 
 
 
 
 
 
 
 
27
  .rwmb-input h4 {
28
  margin: 0;
29
  }
30
+ .rwmb-input input:not([size]),
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"],
38
+ .rwmb-input input[type="radio"],
39
+ .rwmb-input input[type="button"] {
40
+ width: auto;
41
+ }
42
  .rwmb-textarea {
43
  resize: vertical;
44
  }
77
  box-shadow: none;
78
  }
79
  .rwmb-button.add-clone {
80
+ margin-top: 4px;
81
  }
82
  .rwmb-clone-icon {
83
  cursor: move;
97
  /* jQuery validation */
98
  p.rwmb-error {
99
  color: #dc3232;
100
+ margin: 4px 0;
101
  clear: both;
102
  }
103
  input.rwmb-error.rwmb-error,
124
  width: 100%;
125
  }
126
  #side-sortables .rwmb-label {
127
+ margin-bottom: 4px;
 
 
 
 
 
 
 
 
128
  }
129
 
130
  /* Mobile style */
131
  @media (max-width: 1023px) {
132
+ .rwmb-field {
133
+ flex-direction: column;
 
134
  }
135
  .rwmb-label {
 
 
 
 
136
  width: 100%;
137
+ margin-bottom: 4px;
138
  }
139
+ }
140
+ @media (max-width: 782px) {
141
+ .rwmb-input input[type="radio"],
142
+ .rwmb-input input[type="checkbox"] {
143
+ width: 1.5625em;
144
  }
145
  }
146
 
css/text-list.css CHANGED
@@ -6,6 +6,7 @@
6
  .rwmb-text_list-non-cloneable > .rwmb-input > label,
7
  .rwmb-text_list-clone > label {
8
  margin: 0 10px 10px 0;
 
9
  }
10
  .rwmb-text_list-non-cloneable > .rwmb-input > label:last-child,
11
  .rwmb-text_list-clone > label:last-child {
@@ -15,5 +16,5 @@
15
  .rwmb-text-list-label {
16
  font-weight: 600;
17
  display: block;
18
- margin-bottom: 5px;
19
  }
6
  .rwmb-text_list-non-cloneable > .rwmb-input > label,
7
  .rwmb-text_list-clone > label {
8
  margin: 0 10px 10px 0;
9
+ flex: 1;
10
  }
11
  .rwmb-text_list-non-cloneable > .rwmb-input > label:last-child,
12
  .rwmb-text_list-clone > label:last-child {
16
  .rwmb-text-list-label {
17
  font-weight: 600;
18
  display: block;
19
+ margin-bottom: 3px;
20
  }
inc/fields/autocomplete.php CHANGED
@@ -55,9 +55,8 @@ class RWMB_Autocomplete_Field extends RWMB_Multiple_Values_Field {
55
  // This field doesn't store field values, so it doesn't have "name" attribute.
56
  // The value(s) of the field is store in hidden input(s). See below.
57
  $html = sprintf(
58
- '<input type="text" class="rwmb-autocomplete-search" size="%s">
59
  <input type="hidden" name="%s" class="rwmb-autocomplete" data-options="%s" disabled>',
60
- esc_attr( $field['size'] ),
61
  esc_attr( $field['field_name'] ),
62
  esc_attr( $options )
63
  );
@@ -105,21 +104,4 @@ class RWMB_Autocomplete_Field extends RWMB_Multiple_Values_Field {
105
 
106
  return $html;
107
  }
108
-
109
- /**
110
- * Normalize parameters for field.
111
- *
112
- * @param array $field Field parameters.
113
- * @return array
114
- */
115
- public static function normalize( $field ) {
116
- $field = parent::normalize( $field );
117
- $field = wp_parse_args(
118
- $field,
119
- array(
120
- 'size' => 30,
121
- )
122
- );
123
- return $field;
124
- }
125
  }
55
  // This field doesn't store field values, so it doesn't have "name" attribute.
56
  // The value(s) of the field is store in hidden input(s). See below.
57
  $html = sprintf(
58
+ '<input type="text" class="rwmb-autocomplete-search">
59
  <input type="hidden" name="%s" class="rwmb-autocomplete" data-options="%s" disabled>',
 
60
  esc_attr( $field['field_name'] ),
61
  esc_attr( $options )
62
  );
104
 
105
  return $html;
106
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
inc/fields/color.php CHANGED
@@ -8,7 +8,7 @@
8
  /**
9
  * Color field class.
10
  */
11
- class RWMB_Color_Field extends RWMB_Text_Field {
12
  /**
13
  * Enqueue scripts and styles.
14
  */
8
  /**
9
  * Color field class.
10
  */
11
+ class RWMB_Color_Field extends RWMB_Input_Field {
12
  /**
13
  * Enqueue scripts and styles.
14
  */
inc/fields/datetime.php CHANGED
@@ -8,7 +8,7 @@
8
  /**
9
  * Datetime field class.
10
  */
11
- class RWMB_Datetime_Field extends RWMB_Text_Field {
12
  /**
13
  * Translate date format from jQuery UI date picker to PHP date().
14
  * It's used to store timestamp value of the field.
@@ -66,11 +66,12 @@ class RWMB_Datetime_Field extends RWMB_Text_Field {
66
  // Scripts.
67
  $url = RWMB_JS_URL . 'jqueryui';
68
  wp_register_script( 'jquery-ui-timepicker', "$url/jquery-ui-timepicker-addon.min.js", ['jquery-ui-datepicker', 'jquery-ui-slider'], '1.6.3', true );
 
69
  wp_register_script( 'jquery-ui-timepicker-i18n', "$url/jquery-ui-timepicker-addon-i18n.min.js", ['jquery-ui-timepicker'], '1.6.3', true );
70
 
71
- wp_register_script( 'rwmb-datetime', RWMB_JS_URL . 'datetime.js', ['jquery-ui-datepicker', 'jquery-ui-timepicker-i18n', 'underscore'], RWMB_VER, true );
72
  wp_register_script( 'rwmb-date', RWMB_JS_URL . 'date.js', ['jquery-ui-datepicker', 'underscore'], RWMB_VER, true );
73
- wp_register_script( 'rwmb-time', RWMB_JS_URL . 'time.js', ['jquery-ui-timepicker-i18n'], RWMB_VER, true );
74
 
75
  $handles = ['datetime', 'time'];
76
  $locale = str_replace( '_', '-', get_locale() );
@@ -237,8 +238,12 @@ class RWMB_Datetime_Field extends RWMB_Text_Field {
237
  'yearRange' => '-100:+100',
238
  'changeMonth' => true,
239
  'showButtonPanel' => true,
240
- 'controlType' => 'select',
241
  'oneLine' => true,
 
 
 
 
 
242
  )
243
  );
244
 
8
  /**
9
  * Datetime field class.
10
  */
11
+ class RWMB_Datetime_Field extends RWMB_Input_Field {
12
  /**
13
  * Translate date format from jQuery UI date picker to PHP date().
14
  * It's used to store timestamp value of the field.
66
  // Scripts.
67
  $url = RWMB_JS_URL . 'jqueryui';
68
  wp_register_script( 'jquery-ui-timepicker', "$url/jquery-ui-timepicker-addon.min.js", ['jquery-ui-datepicker', 'jquery-ui-slider'], '1.6.3', true );
69
+ wp_register_script( 'jquery-ui-timepicker-slider', "$url/jquery-ui-sliderAccess.js", ['jquery-ui-datepicker', 'jquery-ui-slider'], '0.3', true );
70
  wp_register_script( 'jquery-ui-timepicker-i18n', "$url/jquery-ui-timepicker-addon-i18n.min.js", ['jquery-ui-timepicker'], '1.6.3', true );
71
 
72
+ wp_register_script( 'rwmb-datetime', RWMB_JS_URL . 'datetime.js', ['jquery-ui-datepicker', 'jquery-ui-timepicker-i18n', 'underscore', 'jquery-ui-button', 'jquery-ui-timepicker-slider'], RWMB_VER, true );
73
  wp_register_script( 'rwmb-date', RWMB_JS_URL . 'date.js', ['jquery-ui-datepicker', 'underscore'], RWMB_VER, true );
74
+ wp_register_script( 'rwmb-time', RWMB_JS_URL . 'time.js', ['jquery-ui-timepicker-i18n', 'jquery-ui-button', 'jquery-ui-timepicker-slider'], RWMB_VER, true );
75
 
76
  $handles = ['datetime', 'time'];
77
  $locale = str_replace( '_', '-', get_locale() );
238
  'yearRange' => '-100:+100',
239
  'changeMonth' => true,
240
  'showButtonPanel' => true,
 
241
  'oneLine' => true,
242
+ 'controlType' => 'select', // select or slider
243
+ 'addSliderAccess' => true,
244
+ 'sliderAccessArgs' => [
245
+ 'touchonly' => true, // To show sliderAccess only on touch devices
246
+ ],
247
  )
248
  );
249
 
inc/fields/fieldset-text.php CHANGED
@@ -8,7 +8,7 @@
8
  /**
9
  * Fieldset text class.
10
  */
11
- class RWMB_Fieldset_Text_Field extends RWMB_Text_Field {
12
  /**
13
  * Enqueue field scripts and styles.
14
  */
@@ -34,7 +34,7 @@ class RWMB_Fieldset_Text_Field extends RWMB_Text_Field {
34
  $html[] = sprintf( $tpl, $label, parent::html( $value, $field ) );
35
  }
36
 
37
- $out = '<fieldset><legend>' . $field['desc'] . '</legend>' . implode( ' ', $html ) . '</fieldset>';
38
 
39
  return $out;
40
  }
8
  /**
9
  * Fieldset text class.
10
  */
11
+ class RWMB_Fieldset_Text_Field extends RWMB_Input_Field {
12
  /**
13
  * Enqueue field scripts and styles.
14
  */
34
  $html[] = sprintf( $tpl, $label, parent::html( $value, $field ) );
35
  }
36
 
37
+ $out = '<fieldset>' . ( $field['desc'] ? '<legend>' . $field['desc'] . '</legend>' : '' ) . implode( ' ', $html ) . '</fieldset>';
38
 
39
  return $out;
40
  }
inc/fields/file-input.php CHANGED
@@ -36,9 +36,11 @@ class RWMB_File_Input_Field extends RWMB_Input_Field {
36
  public static function html( $meta, $field ) {
37
  $attributes = self::get_attributes( $field, $meta );
38
  return sprintf(
39
- '<input %s>
40
- <a href="#" class="rwmb-file-input-select button">%s</a>
41
- <a href="#" class="rwmb-file-input-remove button %s">%s</a>',
 
 
42
  self::render_attributes( $attributes ),
43
  esc_html__( 'Select', 'meta-box' ),
44
  $meta ? '' : 'hidden',
36
  public static function html( $meta, $field ) {
37
  $attributes = self::get_attributes( $field, $meta );
38
  return sprintf(
39
+ '<div class="rwmb-file-input-inner">
40
+ <input %s>
41
+ <a href="#" class="rwmb-file-input-select button">%s</a>
42
+ <a href="#" class="rwmb-file-input-remove button %s">%s</a>
43
+ </div>',
44
  self::render_attributes( $attributes ),
45
  esc_html__( 'Select', 'meta-box' ),
46
  $meta ? '' : 'hidden',
inc/fields/input.php CHANGED
@@ -60,9 +60,10 @@ abstract class RWMB_Input_Field extends RWMB_Field {
60
  $field,
61
  array(
62
  'autocomplete' => false,
63
- 'size' => 30,
64
  'datalist' => false,
65
  'readonly' => false,
 
 
66
  'prepend' => '',
67
  'append' => '',
68
  )
@@ -97,9 +98,11 @@ abstract class RWMB_Input_Field extends RWMB_Field {
97
  'value' => $value,
98
  'placeholder' => $field['placeholder'],
99
  'type' => $field['type'],
100
- 'size' => $field['size'],
101
  )
102
  );
 
 
 
103
 
104
  return $attributes;
105
  }
60
  $field,
61
  array(
62
  'autocomplete' => false,
 
63
  'datalist' => false,
64
  'readonly' => false,
65
+ 'maxlength' => false,
66
+ 'pattern' => false,
67
  'prepend' => '',
68
  'append' => '',
69
  )
98
  'value' => $value,
99
  'placeholder' => $field['placeholder'],
100
  'type' => $field['type'],
 
101
  )
102
  );
103
+ if ( isset( $field['size'] ) ) {
104
+ $attributes['size'] = $field['size'];
105
+ }
106
 
107
  return $attributes;
108
  }
inc/fields/key-value.php CHANGED
@@ -8,7 +8,11 @@
8
  /**
9
  * Key-value field class.
10
  */
11
- class RWMB_Key_Value_Field extends RWMB_Text_Field {
 
 
 
 
12
  /**
13
  * Get field HTML.
14
  *
@@ -71,17 +75,6 @@ class RWMB_Key_Value_Field extends RWMB_Text_Field {
71
  return '';
72
  }
73
 
74
- /**
75
- * Do not show field description.
76
- *
77
- * @param array $field Field parameters.
78
- *
79
- * @return string
80
- */
81
- public static function label_description( $field ) {
82
- return '';
83
- }
84
-
85
  /**
86
  * Escape meta for field output.
87
  *
8
  /**
9
  * Key-value field class.
10
  */
11
+ class RWMB_Key_Value_Field extends RWMB_Input_Field {
12
+ public static function admin_enqueue_scripts() {
13
+ wp_enqueue_style( 'rwmb-key-value', RWMB_CSS_URL . 'key-value.css', array(), RWMB_VER );
14
+ }
15
+
16
  /**
17
  * Get field HTML.
18
  *
75
  return '';
76
  }
77
 
 
 
 
 
 
 
 
 
 
 
 
78
  /**
79
  * Escape meta for field output.
80
  *
inc/fields/oembed.php CHANGED
@@ -8,7 +8,7 @@
8
  /**
9
  * OEmbed field class.
10
  */
11
- class RWMB_OEmbed_Field extends RWMB_Text_Field {
12
  /**
13
  * Normalize parameters for field.
14
  *
8
  /**
9
  * OEmbed field class.
10
  */
11
+ class RWMB_OEmbed_Field extends RWMB_Input_Field {
12
  /**
13
  * Normalize parameters for field.
14
  *
inc/fields/password.php CHANGED
@@ -8,7 +8,7 @@
8
  /**
9
  * Password field class.
10
  */
11
- class RWMB_Password_Field extends RWMB_Text_Field {
12
  /**
13
  * Store secured password in the database.
14
  *
8
  /**
9
  * Password field class.
10
  */
11
+ class RWMB_Password_Field extends RWMB_Input_Field {
12
  /**
13
  * Store secured password in the database.
14
  *
inc/fields/range.php CHANGED
@@ -17,9 +17,14 @@ class RWMB_Range_Field extends RWMB_Number_Field {
17
  * @return string
18
  */
19
  public static function html( $meta, $field ) {
20
- $output = parent::html( $meta, $field );
21
- $output .= sprintf( '<span class="rwmb-output">%s</span>', $meta );
22
- return $output;
 
 
 
 
 
23
  }
24
 
25
  /**
17
  * @return string
18
  */
19
  public static function html( $meta, $field ) {
20
+ return sprintf(
21
+ '<div class="rwmb-range-inner">
22
+ %s
23
+ <span class="rwmb-range-output">%s</span>
24
+ </div>',
25
+ parent::html( $meta, $field ),
26
+ $meta
27
+ );
28
  }
29
 
30
  /**
inc/fields/select-advanced.php CHANGED
@@ -56,6 +56,7 @@ class RWMB_Select_Advanced_Field extends RWMB_Select_Field {
56
  'allowClear' => true,
57
  'dropdownAutoWidth' => true,
58
  'placeholder' => $field['placeholder'],
 
59
  )
60
  );
61
 
56
  'allowClear' => true,
57
  'dropdownAutoWidth' => true,
58
  'placeholder' => $field['placeholder'],
59
+ 'width' => 'style',
60
  )
61
  );
62
 
inc/fields/slider.php CHANGED
@@ -33,7 +33,7 @@ class RWMB_Slider_Field extends RWMB_Field {
33
  public static function html( $meta, $field ) {
34
  $attributes = self::call( 'get_attributes', $field, $meta );
35
  return sprintf(
36
- '<div class="clearfix">
37
  <div class="rwmb-slider-ui" id="%s" data-options="%s"></div>
38
  <span class="rwmb-slider-label">%s<span>%s</span>%s</span>
39
  <input type="hidden" value="%s" %s>
33
  public static function html( $meta, $field ) {
34
  $attributes = self::call( 'get_attributes', $field, $meta );
35
  return sprintf(
36
+ '<div class="rwmb-slider-inner">
37
  <div class="rwmb-slider-ui" id="%s" data-options="%s"></div>
38
  <span class="rwmb-slider-label">%s<span>%s</span>%s</span>
39
  <input type="hidden" value="%s" %s>
inc/fields/text.php DELETED
@@ -1,55 +0,0 @@
1
- <?php
2
- /**
3
- * The text field.
4
- *
5
- * @package Meta Box
6
- */
7
-
8
- /**
9
- * Text field class.
10
- */
11
- class RWMB_Text_Field extends RWMB_Input_Field {
12
- /**
13
- * Normalize parameters for field.
14
- *
15
- * @param array $field Field parameters.
16
- * @return array
17
- */
18
- public static function normalize( $field ) {
19
- $field = parent::normalize( $field );
20
-
21
- $field = wp_parse_args(
22
- $field,
23
- array(
24
- 'size' => 30,
25
- 'maxlength' => false,
26
- 'pattern' => false,
27
- )
28
- );
29
-
30
- return $field;
31
- }
32
-
33
- /**
34
- * Get the attributes for a field.
35
- *
36
- * @param array $field Field parameters.
37
- * @param mixed $value Meta value.
38
- *
39
- * @return array
40
- */
41
- public static function get_attributes( $field, $value = null ) {
42
- $attributes = parent::get_attributes( $field, $value );
43
- $attributes = wp_parse_args(
44
- $attributes,
45
- array(
46
- 'size' => $field['size'],
47
- 'maxlength' => $field['maxlength'],
48
- 'pattern' => $field['pattern'],
49
- 'placeholder' => $field['placeholder'],
50
- )
51
- );
52
-
53
- return $attributes;
54
- }
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.3' );
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.4' );
22
 
23
  list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
 
js/clone.js CHANGED
@@ -255,4 +255,11 @@
255
  .on( 'mb_ready', init )
256
  .on( 'click', '.add-clone', addClone )
257
  .on( 'click', '.remove-clone', removeClone );
 
 
 
 
 
 
 
258
  } )( jQuery, rwmb );
255
  .on( 'mb_ready', init )
256
  .on( 'click', '.add-clone', addClone )
257
  .on( 'click', '.remove-clone', removeClone );
258
+
259
+ // Export for use outside.
260
+ rwmb.cloneIndex = cloneIndex;
261
+ rwmb.cloneValue = cloneValue;
262
+ rwmb.sortClones = sortClones;
263
+ rwmb.toggleRemoveButtons = toggleRemoveButtons;
264
+ rwmb.toggleAddButton = toggleAddButton;
265
  } )( jQuery, rwmb );
js/jqueryui/jquery-ui-sliderAccess.js ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI Slider Access
3
+ * By: Trent Richardson [http://trentrichardson.com]
4
+ * Version 0.3
5
+ * Last Modified: 10/20/2012
6
+ *
7
+ * Copyright 2011 Trent Richardson
8
+ * Dual licensed under the MIT and GPL licenses.
9
+ * http://trentrichardson.com/Impromptu/GPL-LICENSE.txt
10
+ * http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
11
+ *
12
+ */
13
+ (function($){
14
+
15
+ $.fn.extend({
16
+ sliderAccess: function(options){
17
+ options = options || {};
18
+ options.touchonly = options.touchonly !== undefined? options.touchonly : true; // by default only show it if touch device
19
+
20
+ if(options.touchonly === true && !("ontouchend" in document)){
21
+ return $(this);
22
+ }
23
+
24
+ return $(this).each(function(i,obj){
25
+ var $t = $(this),
26
+ o = $.extend({},{
27
+ where: 'after',
28
+ step: $t.slider('option','step'),
29
+ upIcon: 'ui-icon-plus',
30
+ downIcon: 'ui-icon-minus',
31
+ text: false,
32
+ upText: '+',
33
+ downText: '-',
34
+ buttonset: true,
35
+ buttonsetTag: 'span',
36
+ isRTL: false
37
+ }, options),
38
+ $buttons = $('<'+ o.buttonsetTag +' class="ui-slider-access">'+
39
+ '<button data-icon="'+ o.downIcon +'" data-step="'+ (o.isRTL? o.step : o.step*-1) +'">'+ o.downText +'</button>'+
40
+ '<button data-icon="'+ o.upIcon +'" data-step="'+ (o.isRTL? o.step*-1 : o.step) +'">'+ o.upText +'</button>'+
41
+ '</'+ o.buttonsetTag +'>');
42
+
43
+ $buttons.children('button').each(function(j, jobj){
44
+ var $jt = $(this);
45
+ $jt.button({
46
+ text: o.text,
47
+ icons: { primary: $jt.data('icon') }
48
+ })
49
+ .click(function(e){
50
+ var step = $jt.data('step'),
51
+ curr = $t.slider('value'),
52
+ newval = curr += step*1,
53
+ minval = $t.slider('option','min'),
54
+ maxval = $t.slider('option','max'),
55
+ slidee = $t.slider("option", "slide") || function(){},
56
+ stope = $t.slider("option", "stop") || function(){};
57
+
58
+ e.preventDefault();
59
+
60
+ if(newval < minval || newval > maxval){
61
+ return;
62
+ }
63
+
64
+ $t.slider('value', newval);
65
+
66
+ slidee.call($t, null, { value: newval });
67
+ stope.call($t, null, { value: newval });
68
+ });
69
+ });
70
+
71
+ // before or after
72
+ $t[o.where]($buttons);
73
+
74
+ if(o.buttonset){
75
+ $buttons.removeClass('ui-corner-right').removeClass('ui-corner-left').buttonset();
76
+ $buttons.eq(0).addClass('ui-corner-left');
77
+ $buttons.eq(1).addClass('ui-corner-right');
78
+ }
79
+
80
+ // adjust the width so we don't break the original layout
81
+ var bOuterWidth = $buttons.css({
82
+ marginLeft: ((o.where === 'after' && !o.isRTL) || (o.where === 'before' && o.isRTL)? 10:0),
83
+ marginRight: ((o.where === 'before' && !o.isRTL) || (o.where === 'after' && o.isRTL)? 10:0)
84
+ }).outerWidth(true) + 5;
85
+ var tOuterWidth = $t.outerWidth(true);
86
+ $t.css('display','inline-block').width(tOuterWidth-bOuterWidth);
87
+ });
88
+ }
89
+ });
90
+
91
+ })(jQuery);
js/range.js CHANGED
@@ -6,7 +6,7 @@
6
  */
7
  function update() {
8
  var $this = $( this ),
9
- $output = $this.siblings( '.rwmb-output' );
10
 
11
  $this.on( 'input propertychange change', function () {
12
  $output.html( $this.val() );
6
  */
7
  function update() {
8
  var $this = $( this ),
9
+ $output = $this.siblings( '.rwmb-range-output' );
10
 
11
  $this.on( 'input propertychange change', function () {
12
  $output.html( $this.val() );
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.3
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.4
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.7.2
8
- Stable tag: 5.4.3
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.3 - 2021-06-30 =
172
  - Fix trailing comma in function call for PHP < 7.3
173
 
5
  Requires at least: 4.3
6
  Requires PHP: 5.6
7
  Tested up to: 5.7.2
8
+ Stable tag: 5.4.4
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.4 - 2021-07-06 =
172
+
173
+ - Improve usability for time picker on mobile by adding +/- buttons
174
+ - Make all input, select, textarea 100% width
175
+ - Export clone functions to the global "rwmb"
176
+
177
  = 5.4.3 - 2021-06-30 =
178
  - Fix trailing comma in function call for PHP < 7.3
179