Home › Forums › General Issues › ACF fields show up on password protected page › Reply To: ACF fields show up on password protected page
Ok,
Figured this one out myself.
By default WordPress doesn’t protect custom fields, and as such, also custom fields generated by ACF.
To work around this, all you have to do is wrap this simple if statement around your ACF code in a template file:
if ( ! post_password_required() ) {
//All of your code goes here
}
By magic, WordPress asks the visitor of the page for the password before showing your ACF fields.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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.