These are a few of the types of questions I get asked when talking about CMB2. I agree–it IS confusing! With this post, I’m hoping to shed some light on these questions, as well as properly introduce you to CMB2, and officially announce its release from beta! In short, CMB2 is a metabox, custom fields, and forms library for WordPress much like its predecessor, (affectionately known as CMB), but with some new bells and whistles and a new name.
The story goes…after having been burned by some issues with other custom field plugins, we determined it was best to stick with code that we had some control over. We fell in love with CMB because it was a library we could include in any of our projects and it would just work while letting us keep all of the field configuration in the code, and more importantly, in our version control system.
Quickly CMB became a large part of our process and projects at WebDevStudios, and we were actively maintaining it. We took over the CMB github repo from Jared Atchison in December of 2013. In fact, my very last post on this blog was .
CMB was (and still is) an incredible library, but it had some glaring shortcomings. The biggest issue we were beginning to bump against was the fact that only one copy of the library could/would be loaded at once. That’s not an issue until you consider the fact that one plugin’s bundled (and outdated!) version may be loaded before the bundled version in your theme or plugin. This meant that you had to plan for the lowest common denominator, which is not a long-term viable solution.
Enter CMB2.
After many hours of deliberation and discussion among the team at WDS, we determined it would be best to start fresh by forking CMB and creating an entirely new project that would no longer have to ‘care’ about backwards compatibility. We accomplished this by completely renaming every class, function, hook, and filter in the library. This ensures that CMB2 will not conflict with any version of the original CMB. Of course, none of that really mattered if we couldn’t solve the core issue: version management. As a result, CMB2 was built with a new mechanism to ensure it only loads the most recent version of CMB2 in your system. This ensures that a plugin with an old bundled version will not conflict or take precendent over your up-to-date version.
But of course we didn’t stop there.
Since we completely re-wrote the project, and didn’t need to keep backwards-compatibility, we spent a lot of time refactoring things to make them more functional and more flexible. We made so many changes, and we changed the name to the ambigous “CMB2”, hopefully abandoning the idea that the plugin is for ‘metaboxes only.’
A few examples of creative uses of CMB2 include , , , , , and . As you can see, its flexibility has outgrown its original title.
What has changed?
CMB2 has undergone so many changes under the hood, it’s impossible to list them all, but I’ll do my best to list a few of the notable ones:
I would be remiss if I didn’t mention the awesome support and community we have on github. We thank so many contributors for making CMB2 awesome and continuing to push it forward. !
Until today, CMB2 has been stamped with a big “beta” label as we wanted everyone to clearly understand that things could and probably would break. Now, we are officially releasing CMB2 (technically now 2.0.1), and we plan on maintaining strict backwards-compatibility going forward.
Thanks for letting me introduce you to CMB2, and I hope it becomes as invaluable a tool in your WordPress toolbox as it has ours.
If you can’t get enough of CMB2, here are some additional resources:
Give me a shout in the comments if you love (or hate?) CMB2.
Download (or fork) , or install from .