| CARVIEW |
Select Language
HTTP/2 200
date: Sat, 27 Dec 2025 08:56:54 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-robots-tag: none
etag: W/"9a11bdf7629d8696a946c5376d17d116"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com github.githubassets.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=pC236kJqBKAwTvTiWgTLlAOBHrdxPAkK4R5G61wHjNETQqRVsjAth8804nGGKdE5ey6A6f5qOva2I3NmfP3UK5fIDcqDPU85Ip21G6YTDUfniNv%2BI4Mgy0Kpi%2B0CzchOXOntPmje5XVmwYkGiaSnJQzaLWsy7IUg%2F2EXkMiP65klovGmedFoW6qcxYf%2Fo9z9Lz63yn5L3taqZ7mS0g7I8RhLAXB%2BzxD0APXDm84Y0X%2Fc4TOM%2FpQ5GGckOGdZABju5MMXHokvJDjrqAn3sj%2BXHw%3D%3D--Z00WU6Qe0RggL6Aq--1luAhum%2FbL8n0AGr%2F8NHJw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.680691748.1766825814; Path=/; Domain=github.com; Expires=Sun, 27 Dec 2026 08:56:54 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 27 Dec 2026 08:56:54 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: D42E:26833B:4152087:4EBBB7A:694F9F56
Installation · CMB2/CMB2 Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 566
Installation
Justin Sternberg edited this page Apr 5, 2020
·
15 revisions
Table of Contents generated with DocToc
- If installing the plugin from wordpress.org:
- If including the library in your plugin or theme:
- If including the library via composer in PSR-4 format (Example Antonella Framework)
- If including the library via composer (not PSR-4 format)
- Upload the entire
/CMB2directory to the/wp-content/plugins/directory. - Activate CMB2 through the 'Plugins' menu in WordPress.
- Copy (and rename if desired)
example-functions.phpinto to your theme or plugin's directory andrequire_oncefrom your theme or plugin's main file. - Edit to only include the fields you need and rename the functions.
- Profit.
- Place the CMB2 directory inside of your theme or plugin.
- Copy (and rename if desired)
example-functions.phpinto a folder above the CMB2 directory OR copy the entirety of its contents to your theme'sfunctions.phpfile. - Edit to only include the fields you need and rename the functions (CMB2 directory should be left unedited in order to easily update the library).
- Profit.
Important Notes
- Please review the caveats for bundling and including CMB2 .
- when bundling CMB2 with your theme or plugin, you will want to use the release package. You can download the zip file from the WordPress plugin repo, or using the download link on Github. It is recommended that you not clone CMB2 into your project. This will ensure your bundled version does not contain the development-only files/folders.
in composer.json file:
"require": {
"cmb2/cmb2": "dev-master"
},
"autoload": {
"files": ["vendor/cmb2/cmb2/init.php"]
}in composer.json file:
{
"require": {
"php": ">=5.3.0",
"composer/installers": "v1.0.12",
"cmb2/cmb2": "dev-master"
},
"autoload": {
"files": ["vendor/cmb2/init.php"]
},
"extra": {
"installer-paths": {
"vendor/{$name}/": ["cmb2/cmb2"]
}
}
}Documentation:
-
Installation
Installation instructions for various environments -
Basic Usage
Get up and running -
Advanced Usage
Not for the faint of heart -
Field Types
Breakdown of field types -
Examples
Examples for registering fields -
Field Parameters
Breakdown of common field parameters -
Display Options
Limit display of boxes -
Box Properties
Breakdown of box properties -
Troubleshooting
Common issues & how to deal with them -
Notable Changes in CMB2 (from original CMB)
CMB2 — a complete re-write -
Tips & Tricks
10x your CMB2 skills -
REST API
CMB2 data through WordPress REST API -
Javascript API
Work with CMB2 JS events & hooks
Advanced tutorials:
- Adding your own field types
- Adding your own show_on filters
- Displaying boxes on the front-end
- Using CMB to create an Admin Theme Options Page
- Create New Posts (or Custom Post Type) Entries Using A Front End Form
- Disable CMB2 Styles on Front End Forms
External Resources:
Clone this wiki locally
You can’t perform that action at this time.