I’m happy to announce that the version 3.2 of the Meta Box Script for WordPress is released. If you cannot wait for the explanation, head over to the project page and get the latest version now. This version comes with some major changes, some improvements in code and bug fixed.
There are 2 major changes that I made in this version
- enhancing the image uploader
When I looked into the code in earlier version, I realized that the code is messing up as many features are being added over the time. And because the JS code is complicated so separating it into another file is a good idea.
To do so, I tried to modify the JS code to make it more general (some functions required field ID before). I also changed the HTML markup to include some additional CSS classes that needed for the JS.
Separating CSS code into another file also helps you to style the elements easily. Now all fields now has the class ‘rw-$type’, and table cells have class ‘rw-label’ and ‘rw-field’. This is the screenshot with some notes about CSS classes and IDs that will help you style the meta box the way you want (click to enlarge):
As you can style the fields now using CSS file, there’s no reason to keep the
style attribute of fields. So I removed it.
Enhancing the image uploader
Now you can upload multiple images at once (using the flash uploader) and insert them altogether! Look at this screenshot and you’ll understand what I mean:
You don’t need to upload each image, click the button “Insert into post” for it, and then upload another image and insert, and so on. Just upload all images you need, and add them at once.
You can use this feature in both new uploaded images and in Media Library (or Gallery). Note that you also can reorder images in the Media Library before inserting them. The reordering images still works but it may affect on the order you’ve set.
Minor Changes and Fixes
- allow to use file uploader for images as well, someones don’t like the image uploader!
- when delete uploaded images, they’re not deleted from the server (in case you insert them from the media, not the uploader). Also remove hook to delete all attachments when delete post. This may fix some un-wanted action. Look here.
- change hook for adding meta box to ‘add_meta_boxes’, according Codex. Required WP 3.0+
- fix image uploading when custom post type doesn’t support “editor”. Many people met this problem, it looks like the “famous” one.
- fix showing many alerts when delete files
- fix js comma missing bug when implement multiple fields with same type
- fix order of uploaded images
- fix deleting new uploaded image
- fix bug when save meta value = zero (0), this was a silly bug!
- show uploaded images as thumbnail
These bugs are reported by so many users and developers, who love this script! I want to give big thanks to them.
If you posted any bugs in this blog and haven’t receipt any reply or updates or fixes, don’t worry because I always track all your comments here, and note all your reports. The no updates means I haven’t got a solution for this problem. And I really need help from WP developers (maybe you?).
So, I think this’s enough for this version. You can download the script at the project page. And if you like it, don’t forget to buy me a beer!