Password

Last updated Mar 31, 2023

Description

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

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.

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.

Template usage

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");