Skip to content
Justin Sternberg edited this page Aug 17, 2016 · 45 revisions

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.

The best way to get started is look at example-functions.php and read the Basic Usage tutorial.


Documentation:

  1. Basic Usage
    Get up and running

  2. Field Types
    A breakdown of each of the field types included with CMB2.

  3. Field Parameters
    A breakdown of each of the common field parameters.

  4. Display Options
    Limit the display of your metaboxes

  5. Troubleshooting
    Some common issues and how to deal with them

  6. Notable Changes in CMB2 (from original CMB)
    CMB2 is a complete re-write

  7. Tips & Tricks
    10x your CMB2 skills.

Advanced tutorials:

  1. Adding your own field types
    There's no limit to the kinds of fields you can make with CMB2

  2. Adding your own show_on filters
    Even more ways to limit the display of your metaboxes

  3. Displaying metaboxes on the front-end
    Let's take this outside wp-admin

  4. Using CMB to create an Admin Theme Options Page
    Optional replacement for the WordPress Settings API

External Resources:

  1. CMB2 Metabox Code Generator - Generate CMB2 Metabox code with this visual form builder and save your time

  2. Adding interactivity in metaboxes with javascript

  3. CMB2 Snippet Library

  4. Basic CMB2 qTranslate-X integration plugin https://wordpress.org/plugins/integration-cmb2-qtranslate/

  5. Tutorial: Disable CMB2 Styles on Front End Forms