A Text field can be inserted in:
- an Admin Page, as an option or a user_meta
- a User Profile, as a user_meta
- a Metabox, as a post_meta
The code below is used to generate this section in an Admin Page, for an option:
Copy to Clipboard
The code below is used to generate this section in an Admin Page, for a user_meta:
Copy to Clipboard
A Text inherit from a Field, and an Item, then all settings described in Field Settings and Item Settings are also used.
Specific settings for Text:
Field Settings | Description |
---|---|
css string / Default: ” |
CSS rules to be used with this field. See tutorial on CSS |
placeholder string / Default: ” |
The placeholder label shown when the input field is blank |
size string / Default: ‘regular’ |
Set size of the field, ‘large’, ‘regular’, ‘small’ |
is_password boolean / Default: false |
If true, the value of the input field will be hidden while typing |
maxlength string / Default: ” |
The maximum character length allowed for the input field |
unit string / Default: ” |
An additional label, located immediately after the form field. Accepts alphanumerics and symbols. Potential applications include indication of the unit, especially if the field is used with numbers. |