Custom Metaboxes 0.7

Use this code library to easily create metaboxes with all different types of fields. I review some of the newest features to CMB 0.7

» Download the CMB Library here

It's been about six months since my original Custom Metaboxes post announcing the release of this code library for easily creating metaboxes. If you haven't had a look at it since then, I highly recommend you hop on Github and look at the latest version  and the wiki .

Some of the features:

My favorite field types:

  • WYSIWYG. If you're using WordPress 3.3, this will automatically use the new wp_editor which gives you a ton of flexibility.
  • Taxonomy field types (select, radio, multicheck). If you're dealing with a lot of taxonomies, the default metabox provided by WordPress takes up a lot of screen real estate. Include taxonomies in your custom metabox instead. Using select or radio is also a great way to force users to only select one taxonomy term.
  • File upload. Use the built-in media uploader to allow the user to upload any file they want. You can also store the attachment ID in case you want to retrieve other image sizes.
  • Title. If your metabox has a lot of fields in it, use the title field type to create subheadings and instructions.
  • Text (standard, medium, and small). This is as simple as it comes, but also the one you'll use most often.
  • text_date_timestamp. This one uses a date picker to let the user select a date, and then saves it as a UNIX timestamp. This is great for event metaboxes because you can then query based on the date .

The contributors of this code library, in no particular order, include: Andrew Norcross, Jared Atchison, Travis Smith, Randy Hoyt, Jeremy Pry, Andrew Ryno, Patrick Forringer, Chris Olbekson, Stefan Crain  ...and me.

Please use this code, and consider contributing any improvements you make. If you create any field types or show_on filters , post them on the wiki. If you find any bugs, post them in issues (and even better, post the fix!).

No comments yet