Meta Box - Version 5.3.10

Version Description

  • 2021-04-24 =
  • Disable autocomplete for date/datetime fields
  • Input list field: Fix label not working if contains HTML
  • Fix multiple OSM on the same page
  • Add auto update for solutions
  • Fix various bugs for the wysiwyg editor field (mostly in blocks) and allows to pass tinyMCE/quicktags settings to the editor
Download this release

Release Info

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

Code changes from version 5.3.9 to 5.3.10

inc/fields/datetime.php CHANGED
@@ -211,10 +211,11 @@ class RWMB_Datetime_Field extends RWMB_Text_Field {
211
  $field = wp_parse_args(
212
  $field,
213
  array(
214
- 'timestamp' => false,
215
- 'inline' => false,
216
- 'js_options' => array(),
217
- 'save_format' => '',
 
218
  )
219
  );
220
 
211
  $field = wp_parse_args(
212
  $field,
213
  array(
214
+ 'timestamp' => false,
215
+ 'inline' => false,
216
+ 'js_options' => array(),
217
+ 'save_format' => '',
218
+ 'autocomplete' => 'off',
219
  )
220
  );
221
 
inc/fields/wysiwyg.php CHANGED
@@ -15,7 +15,7 @@ class RWMB_Wysiwyg_Field extends RWMB_Field {
15
  public static function admin_enqueue_scripts() {
16
  wp_enqueue_editor();
17
  wp_enqueue_style( 'rwmb-wysiwyg', RWMB_CSS_URL . 'wysiwyg.css', array(), RWMB_VER );
18
- wp_enqueue_script( 'rwmb-wysiwyg', RWMB_JS_URL . 'wysiwyg.js', array( 'jquery' ), RWMB_VER, true );
19
  }
20
 
21
  /**
@@ -51,7 +51,7 @@ class RWMB_Wysiwyg_Field extends RWMB_Field {
51
  }
52
 
53
  wp_editor( $meta, $attributes['id'], $options );
54
- echo '<script class="rwmb-wysiwyg-id" type="text/html" data-id="', esc_attr( $attributes['id'] ), '"></script>';
55
 
56
  return ob_get_clean();
57
  }
15
  public static function admin_enqueue_scripts() {
16
  wp_enqueue_editor();
17
  wp_enqueue_style( 'rwmb-wysiwyg', RWMB_CSS_URL . 'wysiwyg.css', array(), RWMB_VER );
18
+ wp_enqueue_script( 'rwmb-wysiwyg', RWMB_JS_URL . 'wysiwyg.js', ['jquery', 'rwmb'], RWMB_VER, true );
19
  }
20
 
21
  /**
51
  }
52
 
53
  wp_editor( $meta, $attributes['id'], $options );
54
+ echo '<script class="rwmb-wysiwyg-id" type="text/html" data-id="', esc_attr( $attributes['id'] ), '" data-options="', esc_attr( wp_json_encode( $options ) ), '"></script>';
55
 
56
  return ob_get_clean();
57
  }
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.9' );
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.3.10' );
22
 
23
  list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
 
inc/update/checker.php CHANGED
@@ -93,6 +93,10 @@ class RWMB_Update_Checker {
93
  'meta-box-show-hide',
94
  'meta-box-tabs',
95
  'meta-box-template',
 
 
 
 
96
  );
97
  $plugins = get_plugins();
98
  $plugins = array_map( 'dirname', array_keys( $plugins ) );
@@ -189,6 +193,7 @@ class RWMB_Update_Checker {
189
  $args,
190
  array(
191
  'api_key' => $this->option->get_api_key(),
 
192
  )
193
  );
194
  $args = array_filter( $args );
93
  'meta-box-show-hide',
94
  'meta-box-tabs',
95
  'meta-box-template',
96
+
97
+ 'mb-favorite-posts',
98
+ 'mb-testimonials',
99
+ 'mb-user-avatar',
100
  );
101
  $plugins = get_plugins();
102
  $plugins = array_map( 'dirname', array_keys( $plugins ) );
193
  $args,
194
  array(
195
  'api_key' => $this->option->get_api_key(),
196
+ 'url' => home_url(),
197
  )
198
  );
199
  $args = array_filter( $args );
inc/walkers/input-list.php CHANGED
@@ -47,7 +47,7 @@ class RWMB_Walker_Input_List extends RWMB_Walker_Base {
47
  '<li><label><input %s %s>%s</label>',
48
  RWMB_Field::render_attributes( $attributes ),
49
  checked( in_array( $object->value, $this->meta ), true, false ),
50
- esc_html( $object->label )
51
  );
52
  }
53
 
47
  '<li><label><input %s %s>%s</label>',
48
  RWMB_Field::render_attributes( $attributes ),
49
  checked( in_array( $object->value, $this->meta ), true, false ),
50
+ $object->label
51
  );
52
  }
53
 
js/osm-frontend.js CHANGED
@@ -1,14 +1,13 @@
1
  jQuery( function( $ ) {
2
  'use strict';
3
 
4
- var osmTileLayer = L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
5
- attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
6
- } );
7
-
8
  /**
9
  * Display Open Street Map
10
  */
11
  function displayMap() {
 
 
 
12
  var options = $( this ).data( 'osm_options' ),
13
  mapOptions = options.js_options,
14
  center = L.latLng( options.latitude, options.longitude ),
@@ -49,4 +48,4 @@ jQuery( function( $ ) {
49
 
50
  // Loop through all map instances and display them
51
  $( '.rwmb-osm-canvas' ).each( displayMap );
52
- } );
1
  jQuery( function( $ ) {
2
  'use strict';
3
 
 
 
 
 
4
  /**
5
  * Display Open Street Map
6
  */
7
  function displayMap() {
8
+ var osmTileLayer = L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
9
+ attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
10
+ } );
11
  var options = $( this ).data( 'osm_options' ),
12
  mapOptions = options.js_options,
13
  center = L.latLng( options.latitude, options.longitude ),
48
 
49
  // Loop through all map instances and display them
50
  $( '.rwmb-osm-canvas' ).each( displayMap );
51
+ } );
js/wysiwyg.js CHANGED
@@ -8,7 +8,7 @@
8
  var $this = $( this ),
9
  $wrapper = $this.closest( '.wp-editor-wrap' ),
10
  id = $this.attr( 'id' ),
11
- isInBlock = $this.closest( '.wp-block' ).length > 0;
12
 
13
  // Update the ID attribute if the editor is in a new block.
14
  if ( isInBlock ) {
@@ -25,7 +25,8 @@
25
 
26
  // Get id of the original editor to get its tinyMCE and quick tags settings
27
  var originalId = getOriginalId( this ),
28
- settings = getEditorSettings( originalId );
 
29
 
30
  // TinyMCE
31
  if ( window.tinymce ) {
@@ -35,20 +36,21 @@
35
  editor.save(); // Required for live validation.
36
  $this.trigger( 'change' );
37
  } );
38
- }
39
 
40
  // Set editor mode after initializing.
41
  settings.tinymce.init_instance_callback = function() {
42
  switchEditors.go( id, mode );
43
- }
44
 
45
- tinymce.init( settings.tinymce );
 
46
  }
47
 
48
  // Quick tags
49
  if ( window.quicktags ) {
50
  settings.quicktags.id = id;
51
- quicktags( settings.quicktags );
52
  QTags._buttonsInit();
53
  }
54
  }
@@ -141,11 +143,11 @@
141
  * this = textarea element.
142
  */
143
  function setupEvents() {
144
- if ( ! window.tinymce ) {
145
  return;
146
  }
147
  var editor = tinymce.get( this.id );
148
- if ( ! editor ) {
149
  return;
150
  }
151
  var $this = $( this );
8
  var $this = $( this ),
9
  $wrapper = $this.closest( '.wp-editor-wrap' ),
10
  id = $this.attr( 'id' ),
11
+ isInBlock = $this.closest( '.wp-block, .components-panel' ).length > 0;
12
 
13
  // Update the ID attribute if the editor is in a new block.
14
  if ( isInBlock ) {
25
 
26
  // Get id of the original editor to get its tinyMCE and quick tags settings
27
  var originalId = getOriginalId( this ),
28
+ settings = getEditorSettings( originalId ),
29
+ customSettings = $this.closest( '.rwmb-input' ).find( '.rwmb-wysiwyg-id' ).data( 'options' );
30
 
31
  // TinyMCE
32
  if ( window.tinymce ) {
36
  editor.save(); // Required for live validation.
37
  $this.trigger( 'change' );
38
  } );
39
+ };
40
 
41
  // Set editor mode after initializing.
42
  settings.tinymce.init_instance_callback = function() {
43
  switchEditors.go( id, mode );
44
+ };
45
 
46
+ tinymce.remove( '#' + id );
47
+ tinymce.init( $.extend( settings.tinymce, customSettings.tinymce ) );
48
  }
49
 
50
  // Quick tags
51
  if ( window.quicktags ) {
52
  settings.quicktags.id = id;
53
+ quicktags( $.extend( settings.quicktags, customSettings.quicktags ) );
54
  QTags._buttonsInit();
55
  }
56
  }
143
  * this = textarea element.
144
  */
145
  function setupEvents() {
146
+ if ( !window.tinymce ) {
147
  return;
148
  }
149
  var editor = tinymce.get( this.id );
150
+ if ( !editor ) {
151
  return;
152
  }
153
  var $this = $( this );
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.9
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.10
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
8
- Stable tag: 5.3.9
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,13 @@ To getting started with the plugin, please read the [Quick Start Guide](https://
168
 
169
  == Changelog ==
170
 
 
 
 
 
 
 
 
171
  = 5.3.9 - 2021-03-10 =
172
  - Fix taxonomy_advanced doesn't load options in attachment with media_modal set to true.
173
  - Fix `rwmb_{$field_id}_choice_label` not working for checkbox_list field type
5
  Requires at least: 4.3
6
  Requires PHP: 5.6
7
  Tested up to: 5.7
8
+ Stable tag: 5.3.10
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.3.10 - 2021-04-24 =
172
+ - Disable autocomplete for date/datetime fields
173
+ - Input list field: Fix label not working if contains HTML
174
+ - Fix multiple OSM on the same page
175
+ - Add auto update for solutions
176
+ - Fix various bugs for the wysiwyg editor field (mostly in blocks) and allows to pass tinyMCE/quicktags settings to the editor
177
+
178
  = 5.3.9 - 2021-03-10 =
179
  - Fix taxonomy_advanced doesn't load options in attachment with media_modal set to true.
180
  - Fix `rwmb_{$field_id}_choice_label` not working for checkbox_list field type