Meta Box Group is an extension of the WordPress Meta Box plugin which allows you to put custom fields in groups to organize, arrange post meta data clearly and logically. These groups of custom fields can be cloned (repeated) and reordered.
Organizing custom fields in groups can be useful in situations where:
- Your data is hierarchical and you want to arrange and store it in a more structured way. This kind of data will be stored by the extension in a multi-dimensional format, making is more efficient at accessing information.
- Some custom post types require un unknown number of entries and each entry contains some custom fields. For example, a collection can have multiple books, each with the different author, content, publish date, etc. The Meta Box clone feature will store this information with ease.
Multi-level nested groups are supported
Since version 1.1, the Meta Box Group supports multi-level nested groups with no limit for nesting level. The groups, sub-groups, and fields can be cloned as you see in the screenshot above.
This feature allows you to create a better structure for your data and opens an unlimited possibility using the extension to add more data for your posts.
Technically, Meta Box Group extension creates a new field type
group, which can contain other fields. Declaring sub-fields of a
group is the same as normal fields, so you don’t have to change your code too much to use this extension.
In order to display custom fields of a group better, you can incorporate Meta Box Group with Meta Box Columns to arrange fields horizontally in columns in a grid (see the screenshots below). By default, Meta Box Group displays fields vertically like normal fields.
- Organizes custom fields in groups for better appearance and data structure
- Groups are clonable (repeatable)
- Supports clonable (repeatable) field types. All field types now can be cloned.
- Supports nested groups since 1.0.7 and multi-level nested groups since 1.1
- Integrates with existing meta boxes and custom fields easily with a few lines of code
Example of use cases:
- You have an “album” post type and each album has a list of tracks (unknown number), each track has information: title, single, composer, genre. Then you can create a group for the album, which has 4 sub-fields for title, single, composer, genre. The group is cloneable which allows you to add more tracks.
- You have an “event” post type which can happen in several days, each day will have different opening times. Then you can create a group (cloneable) for the event, which holds information of the event in a single day. And you need a sub-group to store opening times of the event each day.
Note: If you use multi-level nested groups, then cloning media fields and WYSIWYG fields can be buggy. It works ok without multi-level nested groups.
Version 1.1.6 - October 4th, 2016:
- Fix WYSIWYG field does not save HTML correctly in the settings page. See #971.
Version 1.1.5 - September 8th, 2016:
- Fix hook priority to compatible with Meta Box 4.9
Version 1.1.4 - August 4th, 2016:
- Improvement: Trigger when clone completed.
Version 1.1.3 - June 28th, 2016:
- Improvement: Better add actions and enqueue resources for sub fields.
- Fix: No versions for CSS/JS files, which make those files cached incorrectly.
- Fix: Update group index only for the new clone group.
- Fix: Wrong condition for checking class exists.
Version 1.1.2 - June 3rd, 2016:
- Fix: Fix clone issue for color field.
- Fix: Wrong group index when cloning fields in a cloned group
Version 1.1.1 - May 16th, 2016:
- Fix: Compatibility with Meta Box Columns extension.
- Improvement: Optimize JS code for better performance.
Version 1.1 - May 13rd, 2016:
- Improvement: Add support for multi-level nested group (cloning group and cloning fields are supported, too). It does not work with media fields and wysiwyg, though.
- Improvement: Fix for including the extension directly in a theme.
Version 1.0.8 - May 2nd, 2016:
- Improvement: Add support for cloned fields inside a group.
- Improvement: It's now safe to include the extension into a plugin or a theme. Requires Meta Box 4.8.5+.
Version 1.0.7 - March 25th, 2016:
- Improvement: Nested group is supported
Version 1.0.6 - March 7th, 2016:
- Fields in a cloned groups now have unique ID, which supports cloning WYSIWYG in group
Version 1.0.5 - February 18th, 2016:
- Fix compatibility with Meta Box 4.8.0
Version 1.0.4 - December 14th, 2015:
- Refactor the code
- Update to works with Meta Box 4.7.3
Version 1.0.3 - November 20th, 2015:
- Fix: value not saved in Meta Box 4.7
Version 1.0.2 - September 30th, 2015:
- Fix: Wrong position of color inputs
Version 1.0.1 - March 25th, 2015:
- Improvement: Add filter
rwmb_group_add_clone_button_textfor developers to change clone button text
- Improvement: Better file name and file include
Version 1.0 - February 6th, 2015:
- First release