Today the latest version of the Meta Box plugin – 4.8.7 – is released. This version has a big refactor of the code that reduces the complexity in the code architecture and thanks to that the plugin is simpler but still very powerful.

Refactoring the plugin

In order to measure the complexity of the plugin, we use the script PHPMetrics which is the best script that analyzes the code and offers very useful statistics. We also compare it with other popular plugins such as Advanced Custom Fields and CMB2 and the result is quite good. For more details, please read the post on my blog.

Supports all HTML 5 input types

Now Meta Box supports all HTML 5 input types. You don’t need to create a custom field type for telephone, week, month, etc. Instead of that, you can simply use the following code:

array(
    'id'   => 'field_id',
    'type' => 'tel', // New HTML 5 input type
    'name' => 'Telephone',
)

Other improvements

  • Use 1 single localization file for jQuery date picker for simplicity
  • Add support for custom marker for map field (param marker_icon) in rwmb_meta function
  • Add limit option for media fields in rwmb_meta function when retrieving meta value.
  • Add rwmb_option_label filter for choice fields (user, post, taxonomy) so users can choose which object field is used as label
  • Use WP_User_Query for user field which supports more options for querying
  • Optimize code for oembed, also use esc_html__ for better security
  • Compatibility with Meta Box Geolocation

Fixes

  • Fix first option is auto selected in select_advanced field.
  • Fix clone issue for color in Meta Box Group extension.
  • Fix clone issue for image advanced in Meta Box Group extension.
  • Fix not parsing $args to array in helper functions.

Leave a Reply