Skip to content

Field Types

MD Sultan Nasir Uddin edited this page Jun 20, 2018 · 2 revisions

Here are the built-in fields you can include in your metabox.

Types

  • text
  • textarea
  • number
  • email
  • hidden
  • url
  • colorpicker
  • select
  • wysiwyg
  • checkbox
  • radio
  • date

text

[
	'type'          => 'text', // type of the fields
	'name'          => 'custom_text', //meta name 
	'id'            => 'custom_text', //optional
	'label'         => 'Custom Text',
	'value'         => 'Default value', //optional
	'placeholder'   => 'Type a text', //optional
	'sanitize'      => 'esc_html',//optional
	'help'          => 'some helping hints', //optional
	'tooltip'       => 'Text that will be in tooltip', //optional
	'class'         => 'custom-css-class', //optioanal
	'wrapper_class' => 'custom-wrapper-css-class', //optional
	'required'      => 'true', //optional
]
Clone this wiki locally