Skip to content
Ghost1227 edited this page Aug 30, 2016 · 7 revisions

The arguments id, name, desc and type are required for every field! Arguments in bold are required.

header (implements a simple header)

Beyond the required options, this field type takes no arguments.

checkbox (implements a checkbox)

Field Description Default
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

color (implements a color select field)

Field Description Default
std The default value for this field as an RGB hex code empty string
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

descriptive_text (implements a descriptive text field)

Field Description Default
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

editor (implements a rich text editor)

Field Description Default
std The default value for this field empty string
allow_blank A boolean specifying whether or not to allow blank values. If set to false and a blank value is saved, will revert to the value of std true
size The number of rows to display for this field as an integer 10
wpautop A boolean specifying whether or not to run text through the wpautop filter true
buttons A boolean specifying whether or not to display the editor buttons true
teeny A boolean specifying whether or not to use the editor 'teeny' mode false
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

html (implements a CodeMirror HTML field)

Field Description Default
std The default value for this field empty string
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

multicheck (implements a multicheck field)

Field Description Default
options A multi-dimensional array of options in the format 'option-value' => 'Option Name' null
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

number (implements a number field)

Field Description Default
std The default value for this field empty string
max An integer identifying the highest allowed value for this field 999999
min An integer identifying the lowest allowed value for this field 0
step A float identifying what to increment the field by when the up/down arrows are pressed 1
size The size to display for this field. Valid values are small, regular and large regular
readonly A boolean specifying whether or not this field should be read only false
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

password (implements a password field)

Field Description Default
std The default value for this field empty string
size The size to display for this field. Valid values are small, regular and large regular
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

radio (implements a radio button list field)

Field Description Default
std The default item key for this field empty string
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

select (implements a select field)

Field Description Default
std The default item key for this field empty string
placeholder The placeholder to display if no option is selected empty string
select2 A boolean specifying whether or not to implement the Select2 library for this field false
multiple A boolean specifying whether the select box should allow multiple selections false
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

sysinfo (implements a system info display field)

Field Description Default
tab The settings tab to load sysinfo on (this may seem redundant, but it prevents compiling everything on every page load) empty string
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

text (implements a text field)

Field Description Default
std The default value for this field empty string
readonly A boolean specifying whether or not this field should be read only false
size The size to display for this field. Valid values are small, regular and large regular
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

textarea (implements a text area)

Field Description Default
std The default value for this field empty string
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

upload (implements an upload field)

Field Description Default
std The default value for this field empty string
size The size to display for this field. Valid values are small, regular and large regular
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

license (implements a license field)

The license field is a special field which implements a field for use with the Software Licensing extension for Easy Digital Downloads. See Software Licensing for more details.

Field Description Default
std The default value for this field empty string
size The size to display for this field. Valid values are small, regular and large regular
tooltip_title The title to (optionally) use for tooltips (requires tooltip_desc) null
tooltip_desc The description to (optionally) use for tooltips (requires tooltip_title) null

hook (implements a custom field through a WordPress action)

Beyond the required options, this field type takes no arguments. This field is rendered based on the action your_plugin_<field_id>. In other words, if you added a hook field with an ID of custom_field, you would have to hook your_plugin_custom_field to render it.