Password

Last updated Mar 31, 2023
Link to heading

Description

The Password field creates an input for providing a password using a masked field.

Link to heading

Screenshots

Creating a Password field in the ACF UI.

Creating a Password field.

Settings on the Presentation tab allow you to control how the Password field will appear.

Settings on the Presentation tab allow you to control how the Password field will appear.

How the password field might appear to content editors. Instructions added in the Presentation tab are visible here.

How the password field might appear to content editors. Instructions added in the Presentation tab are visible here.

Link to heading

Settings

  • Required
    Found on the Validation tab, this requires a valid password be provided as the input and prevents the field from accepting empty values. Defaults to off.

  • Instructions
    Shows instructions when submitting data.

  • Placeholder Text
    Appears within input when no value exists.

  • Prepend
    Adds a visual text element before the input.

  • Append
    Adds a visual text element after the input.

Link to heading

Template usage

Link to heading

Get value

It’s unlikely you’re going to want to output password fields to the frontend, but rather use the value in other code. The following example shows how to load the value of the field “password” from an ACF options page.

$value = get_field( "password", "option");
Supercharge Your Website With Premium Features Using ACF PRO

Speed up your workflow and unlock features to better develop websites using ACF Blocks and Options Pages, with the Flexible Content, Repeater, Clone, Gallery Fields & More.

Explore Features View Pricing

PRO Features
ACF Blocks
Options Pages
PRO Fields
Repeater
Flexible Content
Gallery
Clone

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.