Password field
Purpose
A secret such as an API key or a password for a third-party service.
Field type name
password
Settings
| Setting | Description |
|---|---|
| Instructions | Shown to editors below the field label. (max 2000 characters) |
| Placeholder | Hint shown inside the empty input. (max 255 characters) |
| Minimum Length | Minimum number of characters. (min 0, whole number) |
| Maximum Length | Maximum number of characters. (min 1, max 4096, whole number) |
| Translation | How the field behaves in other languages: translate, copy, copy_once or do_not_translate. Used on top-level fields when WPML is active. See WPML. |
| Width | Width on edit screens, to place fields side by side: 100 (full), 75, 66, 50, 33 or 25 (%). Phones always show full width. |
| Label per language | The label and instructions per language code while editing in that language, e.g. {"nl": {"label": "Prijs"}}. Set on the Translation tab when WPML is active. See WPML. |
PHP return value
string: only when you ask for it explicitly with cafe_get_field().
Example
// Store an API key for a service your plugin calls.
cafe_update_option( 'mailchimp_api_key', $api_key );
$api_key = cafe_get_option( 'mailchimp_api_key' );