Documentation / Tutorials / Triggers
Creating Meta Boxes
/ Triggers / Creating Meta Boxes
Create a Global Triggers and it will create a Meta box, it takes all the parameter of CMB2, fields are added separately
[aw2.register metabox part=start id=gallery] { "id" :"gallery", "title" :"Gallery", "object_types" : [ "as_gallery" ], "context" :"normal", "priority" :"high", "show_names" : true } [/aw2.register] [aw2.register metabox part=field id=gallery] { "name":"Images", "id" : "gallery_images", "type":"file_list" } [/aw2.register]
Various Fields Type
Here's the built-in fields you can include in your metabox. You can also add your own field types.
title
An arbitrary title field *text
text_small
text_medium
text_email
text_url
text_money
textarea
textarea_small
textarea_code
text_time
Time pickerselect_timezone
Time zone dropdowntext_date_timestamp
Date Picker (UNIX timestamp)text_datetime_timestamp
Text Date/Time Picker Combo (UNIX timestamp)text_datetime_timestamp_timezone
Text Date/Time Picker/Time zone Combo (serialized DateTime object)hidden
Hidden input typecolorpicker
Color pickerradio
*radio_inline
*taxonomy_radio
*taxonomy_radio_inline
*select
taxonomy_select
*checkbox
*multicheck
andmulticheck_inline
taxonomy_multicheck
*taxonomy_multicheck_inline
wysiwyg
(TinyMCE) *file
Image/File upload *†file_list
Image/File list uploadoembed
Converts oembed urls (instagram, twitter, youtube, etc. oEmbed in the Codex)group
Hybrid field that supports adding other fields as a repeatable group. *
For more details read this article https://github.com/WebDevStudios/CMB2/wiki/Field-Types