Home
Welcome to the CMB2 wiki! This is a code library for WordPress themes and plugins that makes it easy to add metaboxes, fields, and forms to WordPress. Easily manage meta for posts, terms, users, comments, or create custom option pages.
The best way to get started is look at example-functions.php and read the Basic Usage tutorial.
Documentation:
Installation
Installation instructions for various environmentsBasic Usage
Get up and runningAdvanced Usage
Not for the faint of heartField Types
A breakdown of each of the field types included with CMB2.Examples
Examples for registering fields for the different object types.Field Parameters
A breakdown of each of the common field parameters.Display Options
Limit the display of your boxesBox Properties
Docs for the possible CMB2 box properties.Troubleshooting
Some common issues and how to deal with themNotable Changes in CMB2 (from original CMB)
CMB2 is a complete re-writeTips & Tricks
10x your CMB2 skills.REST API
Access your CMB2 data through the WordPress REST API.Javascript API
How to work with the various CMB2 events and hooks in Javascript.
Advanced tutorials:
Adding your own field types
There's no limit to the kinds of fields you can make with CMB2Adding your own show_on filters
Even more ways to limit the display of your boxesDisplaying boxes on the front-end
Let's take this outside wp-adminUsing CMB to create an Admin Theme Options Page
Optional replacement for the WordPress Settings APICreate New Posts (or Custom Post Type) Entries Using A Front End Form
Leverage CMB2 create a front-end submission form
External Resources:
CMB2 Box Registration Code Generator
Use this generator to create fully functional CMB2 boxes easily.