Update: Meta Box Script v3.2 Is Available

new version Update: Meta Box Script v3.2 Is Available

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.

Major Changes

There are 2 major changes that I made in this version

  1. separating Javascript, CSS codes into meta-box.js and meta-box.css files
  2. enhancing the image uploader

Separating Javascript and CSS

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):

meta box style Update: Meta Box Script v3.2 Is Available

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:

insert images Update: Meta Box Script v3.2 Is Available

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!

12 Comments

  1. Hello,

    I was wondering if there was anyway to use the meta box script to add custom fields to the user profile?

    Thanks in advance,

    Matt.

    Reply
    • Short answer, NO. Because user profile and post editing pages are using 2 different API to save information. I hope in the future, I can do this.

      Reply
  2. Hi,
    When you click on “Add more images” and select an image does not add it to the post.

    PS. On localhost after you delete a picture, save the post and re-add a picture, no picture, I must add a second time.

    Reply
  3. Any reason why the image upload checkboxes take a while to appear? Or is it because the images are still being uploaded even after they appear all ready?

    Reply
    • They don’t take a while to appear. They appear when you hover the Insert button. I have no better way to show them when upload completed.

      Reply
      • Excellent update, everything works great and love the bulk image uploader, it makes uploading several images much easier.

        There is one bug that I cannot figure out, when I upload an mag and click insert on post, the preview thumbnail is broken in your “screenshots” module but when I publish or update the post the image preview thumbnail is there, I’ve checked the code and there are two different functions for this, and the one to display right after the image was inserted is the one that is not doing it.
        Can you help me with this? I’ll be more than happy to pay for your services to get this working correctly.

        Reply
  4. Hi, first of all thanks for this wonderful script. But does anybody have an idea why when I try to delete or to reorder images I get “You don’t have permission to reorder images” message?

    Reply
  5. …and the “Edit” button in the attachment details of the thickbox is broken with this new version. OK, I’m gonna stop complaining. This is a great tool, which saved my life many times :D

    Reply
  6. Definitely, I prefer the original simple file uploader… Primo because going through the Worpress thickbox is more complicated and non-inituitive for who are using WP for the first time. Secundo, after the “publish” button has been clicked, the thumbnail of the attached image disappears from above the “add a new image” button. I always have to attach it twice for the process to be effective :(

    Reply

Leave a Reply